This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Short questions about GCJ
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Harmanpaul S Gill <harmangill23 at yahoo dot com>
- Cc: gcc at gcc dot gnu dot org, <green at redhat dot com>
- Date: Wed, 15 Oct 2003 15:33:41 -0400 (EDT)
- Subject: Re: Short questions about GCJ
On Wed, 15 Oct 2003, Harmanpaul S Gill wrote:
> 1. What is meant by libgcj being "conservative"
> garbage collector?
Briefly, conservative GC is an implementation strategy that does not rely
on type information to determine with 100% accuracy whether a given memory
object identifies a pointer. Essentially, anything that resembles a valid
pointer is treated as a pointer.
Conservative GC is common for C/C++, in part because of the difficulty of
handling ambiguous memory objects like:
union {
int n;
void *p
} something_that_may_or_may_not_be_a_pointer;
The GC implementation in libgcj is neither fully conservative nor
precise, for example it has type information for all heap objects.
I recommend Hans Boehm's website for an explanation
of the tradeoffs of conservative vs. precise collection, in particular
http://www.hpl.hp.com/personal/Hans_Boehm/gc/issues.html and
http://www.hpl.hp.com/personal/Hans_Boehm/gc/conservative.html.
> How does it differ from JRE provided by SUN?
Depends on the product. My understanding from public information is that
Sun has utilized both conservative and precise GC in various JRE packages.
Jeff