classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Memory leak in java.lang.Thread ?


From: Jeroen Frijters
Subject: RE: Memory leak in java.lang.Thread ?
Date: Fri, 10 Dec 2004 14:47:54 +0100

David Holmes wrote:
> Jeroen writes:
> > I've attached my first stab at implementing this.
> 
> Looks good to me. The only thing I'm a little concerned with is the
> finalize() method. I know it is the correct thing to do, to avoid a
> different form of "leak", but I dislike the idea of adding 
> finalizers to core classes like Thread.

I didn't like it either and after thinking a little more about it I
dislike it even more, because subclasses that override finalize and
forget to call the base class (in my experience this is *highly* likely)
would cause the leak anyway.

Experimentation seems to indicate that Sun actually "leaks" unstarted
threads in daemon groups... Maybe we should do the same?

Oh and I realized that my patch wasn't quite correct. Attached is an
improved version.

Regards,
Jeroen

Attachment: Thread.patch.txt
Description: Thread.patch.txt


reply via email to

[Prev in Thread] Current Thread [Next in Thread]