This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Garbage collector question - "too many roots set"
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- Cc: java at gcc dot gnu dot org
- Date: Thu, 22 May 2003 09:42:55 -0400 (EDT)
- Subject: Re: Garbage collector question - "too many roots set"
On Wed, 21 May 2003, [iso-8859-1] Øyvind Harboe wrote:
> In trying to track down a heap corruption problem (GDB has a warning
> about heap corruption), I've stumbled across a weird failure.
>
> "Too many root sets"
>
> I think my test isn't eating memory, so why does the garbage
> collector go gaga?
That message comes from the GC, indicating that the root set table has
overflowed. It has nothing to do with memory consumption.
I suppose this is on Windows? My guess is VirtualQuery() is running wild,
returning more results than the static-allocated root set table can handle
(MAX_ROOT_SETS, usually 1024).
Is it possible you have native code that allocates a large number of small
noncontiguous memory regions from the OS? (As I understand the code in
GC_add_roots_inner, it should merge adjacent or overlapping regions so
they count as one region.)
Workarounds available are increasing the compile-time MAX_ROOT_SETS
constant, or disabling DYNAMIC_LOADING entirely if you can be certain that
you are static-linking you gcj libraries and no java pointers can exist in
a DLL data region.
Jeff