Interesting stuff found on the GCC list. Doesn't this
affect GCJ as well where we use the conservative
Boehm GC?
-------- Original Message --------
Subject: Uninitialized stack gaps and conservative garbage collection
Date: Tue, 24 May 2005 17:40:46 -0400
From: Camm Maguire <camm@enhanced.com>
Newsgroups: gmane.comp.gcc.devel,gmane.lisp.gcl.devel
Greetings! GCL is a lisp system that compiles to native object code
via the intermediary of gcc. It uses a conservative garbage
collection algorithm, which means that it walks the C stack to find
likely objects in use by automatic variables, and holds on to these.
This works quite well in practice.
For very large systems, the likelihood of holding onto objects which
should be collected increases. In looking into this, it has come to
my attention that regardless of how carefully the C programmer
initializes variables on the stack, gcc will quite commonly allocate
extra space inaccessbile via any C variable. These 'stack gaps' can
wind up permanently preventing a large portion of user memory from
ever being collected with this algorithm.