> -----Original Message-----
> From: Niclas Hedhman [mailto:[EMAIL PROTECTED] 
> Sent: den 16 december 2003 02:15
> To: Avalon framework users
> Subject: Re: When use ServiceManager.release(obj)?
> 
> 
> 
> /LS,
> I am not sure you argue with or against me, but you also fail 
> to use the 
> proper terminology, and total solution of state transition.

Niclas,

I fail to see what the problem is in this discussion - objects get
created, they get unreachable, and *maybe* they get garbage collected.

What, precisely, are we arguing over?

First, the question was whether a soft reference to an object
would be cleared before or after the object was gc'd. The answer is
"before".

Now, I don't really know what we're arguing about. Are we arguing about
anything? Or is this a thread where we're just chatting about the exact
contract for Java GC?
 
> I must stress to go back to the JLS and do the hardwork of 
> understanding the state transitions. All other texts I have seen 
> so far fail to explain in detail what actually happens.
> 
> For instance, a finalizer-reachable/finalizable object becomes 
> reachable(!)/finalized, just prior to the execution of the 
> finalize() method 
> is called (because the object is basically assigned to the 
> queue of the 
> finalizer thread).

That doesn't count. The finalizer thread, just as other internals
of the JVM, can't count as references, since they're not accessible
from the set of root references.

You are correct, however, in that an object may create a hard reference
to itself in finalize(), and thus escape being discarded.

/LS



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to