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 22:46:13 +0100

Archie Cobbs wrote:
> Jeroen Frijters wrote:
> >>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.
> 
> Just to be clear: a weak reference would suffice, right?
> I.e. a phantom reference is not required.

I think that to be strictly correct you need a phantom reference.
Consider the following (pathological) example:

class MyThread extends Thread
{
  protected void finalize()
  {
    start();
  }
}

Regards,
Jeroen




reply via email to

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