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 16:38:21 +0100

Stuart Ballard wrote:
> On Fri, 10 Dec 2004 14:47:54 +0100, Jeroen Frijters 
> <address@hidden> wrote:
> > 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.
> 
> Would it be possible to keep a list of weak references and use one of
> those magic queue things that notifies you when your objects become
> unreachable?

Yeah, we could use a phantom reference to clean up. This is better than
a finalize method, but it isn't cheap either. An additional downside of
them is that IKVM doesn't really support them :-(

The .NET weak references are very weak compared to Java (pun intended).

I'm currently leaning towards not cleaning up.

Regards,
Jeroen




reply via email to

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