wood burning stoves 2.0*
The moose likes Threads and Synchronization and the fly likes Thread memory leak Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Thread memory leak" Watch "Thread memory leak" New topic
Author

Thread memory leak

muthu muruges
Ranch Hand

Joined: Feb 28, 2003
Posts: 70
The following program leaks memory if I run it in java1.1.6 but, it is working fine in java 1.4.
any workaround for this problem since my appln. is running in java1.1.6?
Leak is MyThread object
I am posting here again because, my previous post reached the limit of 12 updates and I am not getting good response afterwards. Please give me some good workaround to come out of this problem.
[ November 05, 2003: Message edited by: m muruges ]
muthu muruges
Ranch Hand

Joined: Feb 28, 2003
Posts: 70
Sorry formating the code.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

What are the observable symptoms of this "memory leak?" How do you measure them? Did you search the Java Developer's Connection Bug Parade for relevant bugs?


[Jess in Action][AskingGoodQuestions]
muthu muruges
Ranch Hand

Joined: Feb 28, 2003
Posts: 70
I observed the leak using the OptimizeIt profiler. I couldn't get related bugs in the BugParade.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Nobody can help without more information.
What are the observable symptoms of this "memory leak?" How do you measure them? In other words, what did you see in OptimizeIt? Did you press the "run garbage collection" button in OptimizeIt to see if that made the threads go away (I'm assuming it's the MyThread objects that you say are leaking?)
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8710
    
    6

Originally posted by Ernest Friedman-Hill:
Nobody can help without more information.

The previous thread is here
And m muruges, as for "not getting good response afterwards" you only got around to mentioning the unsupported VM you were using in post 17 and the operating system you are using in post 19. We can only work with the information you give us. And changing forums doesn't make finding that information any easier.
I think you are between a rock and a hard place. The code you have looks reasonable and runs fine under JDK1.4, so that points to a bug in 1.1.6, but JDK's newer than 1.1.6 are unsupported on Solaris 6. I'd say migrate the app to a more favorable OS/JVM combination.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30


I couldn't get related bugs in the BugParade.

I don't think you looked very hard. It took me only a minute to find this, which is almost certainly what you're seeing. The "workaround" section shows that the only fix is a patch to the JVM source code, and claims the patch will be in 1.1.6, but several user comments from 6-8 months later indicate that the bug was still in 1.1.6, so it probably didn't make it in until 1.1.7 .
So there you go. Creating threads in 1.1.6 leaks memory. No workarounds. Sorry. Upgrade to 1.1.8, if you can.
muthu muruges
Ranch Hand

Joined: Feb 28, 2003
Posts: 70
Firstly thanks a lot for all.
I am in a tight situation to solve this problem. Now only I entered to this maintenance part of this product which is running in the field for nearly 3 years. Initially the customers were okay for resetting the appln.(Admin console for an embedded system) but, now they are creating sev0 bugs for this mem. leak. I dont know whether it is my bad time in this project. So I am in a hurry to fix this problem. I am feeling sorry for posting it 2 different forums.
I will try it in java1.1.8.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread memory leak
 
Similar Threads
memory leackage
Memory Leak
How to troubleshoot a memory leak or an out-of-memory exception in the Weblogic Server
Memory Leak With Entity Bean 2.0
Memory Leak Problem