[gclist] some questions about Generational GCs.

Ole Agesen - SunLabs agesen@galileo.East.Sun.COM
Wed, 24 Mar 1999 23:12:48 -0500 (EST)


Hi Basile:

I wanted to answer this question:

> 3) an unrelated question - just out of curiosity, does Java requires a
>    conservative GC? By reading the Java VM spec, it seems to me that
>    yes (the JavaVM GC can't know what words on the Java stack are
>    references?) but I am not sure of it.

You are right that it is not straightforward to tell which slots in
Java stack frames contain references and which ones contain integers,
floats, and other "primitive values." However, it is not impossible,
largely (but not entirely) thanks to constraints that the bytecode
verifier enforces. So, to state it directly: you *can* use 
non-conservative collection in a Java virtual machine. 

For more details, allow me to refer you to a paper that David Detlefs 
and I wrote about this topic for the 1997 GC workshop. You may find 
the paper, as well as other Java/GC related papers, at this URL:   

   http://www.sunlabs.com/research/java-topics/pubs/

(title of the above-mentioned paper is "Finding References in Java Stacks").

In fact, the Solaris production release 1.2 JVM uses a non-conservative,
generational memory system written by the group that I work in (Java 
Topics group in Sun Labs).

Regards,
Ole