harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin Garner <robin.gar...@anu.edu.au>
Subject Re: [General VM] GC strategy:how to garbage collect short-lived objects quickly.
Date Tue, 19 Sep 2006 10:52:09 GMT

>>
>> I don't understand. How can weak references help short-lived objects 
>> reclaim?
> 
> Really what I'm saying is that this is the closest thing we have to a
> hint to GC that objects can be collected soon - but it is not anything
> like a proper free() call. There is no immediate reclaim of memory,
> just the possibility that it will be reclaimed soon - and the object
> may be garbage collected before you are finished with it!
> 
> Regards,
> Oliver
> 

Actually, it's kind of the other way around isn't it ?  Nulling the last 
pointer to an object tells the GC that it can collect it (explicitly in 
the case of reference counting), whereas having a Weak Reference to an 
object says 'please tell me when on-one else wants this object', which 
results in the object staying around even longer.

cheers,
Robin

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message