This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]