[kaffe] Bug report: weak references and GC with Kaffe

Le Sommer Nicolas Nicolas.Le-Sommer at univ-ubs.fr
Fri May 31 06:05:58 PDT 2002


 It seems that the GC abstains from ever reclaiming weakly referenced
 objects (that is, objects that are only 'referenced' by an instance of
 WeakReference, as defined in package java.lang.ref), even when the
 VM is running out of memory.
 Is there a bug in the way weak references (and possibly soft and
 phantom references as well) are implemented and/or dealt with by
 the GC in Kaffe?
 The attached piece of code creates both strongly referenced and
 unreferenced 'big' objects. A message is displayed whenever an
 unreferenced object is reclaimed (or, more precisely, finalized)
 by the GC.
 A weak reference is maintained to an otherwise not strongly referenced
 object. This object *should* be reclaimed by the GC. Apparently
 this is not the case...

best regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Dummy.java
Type: application/octet-stream
Size: 1922 bytes
Desc: Example of java code with weak references
Url : http://kaffe.org/pipermail/kaffe/attachments/20020531/c7925342/attachment-0003.obj 

More information about the kaffe mailing list