[kaffe] Bug report: GC misses one object

Guilhem Lavaux guilhem at kaffe.org
Tue Nov 2 10:25:23 PST 2004


Laurent Martelli wrote:
> It looks like the GC misses one object.
> 
> Running the attached gives me the following result:
> 
> laurent at stan:~/tmp$ kaffe GC 3 
> new 0
> new 1
> new 2
> GC run 1
> finalize 0
> finalize 1
> GC run 2
> GC run 3
> End.
> 
> The third object is either not finalize or not collected by the GC.
> 
> 

Hi Laurent,

Thanks for the bug report though I don't yet know if it is a real bug. 
If you start your program with a greater number you'll see that all 
objects are finalized except the final one. Actually if you create the 
objects in a different function you'll see that they are all finalized. 
So the last object must remain somewhere in the stack of the function. 
So this is not a bug in the GC but rather a "bug" in the JIT which does 
not cleanup the stack.

I don't yet know if it is time expensive to clean up the stack if the 
value is not used (as it is the case here) or we should rather keep the 
current logic as the object is anyway freed when the function exits.

Cheers,

Guilhem.




More information about the kaffe mailing list