Description of problem: The message "Too many root sets" sometimes appears, especially using Eclipse. Version-Release number of selected component (if applicable): libgcj-4.0.0-0.42 How reproducible: Sometimes Steps to Reproduce: 1. See bug 154525 Additional info: If I am understanding libgcj correctly, it seems that the problem is that some libraries (such as ant when exporting Eclipse plugins) are mapped several times, with a root set for each instance. This results in exceeding the limit in real usage. Possible fix: Make the root sets table dynamically sized or raise MAX_ROOT_SETS.
I can't find MAX_ROOT_SETS nor anything similar in libjava, nor such message.
It is in Boehm GC: look in boehm-gc/include/private/gc_priv.h The error message is printed from boehm-gc/mark_rts.c
The right thing to do is gc_cflags="-DLARGE_CONFIG" in boehm-gc/configure.host IMO this is acceptable for mainline.
I agree. Longer-term, the structures ought to made dynamically sized.
I don't think that these structures hould be dynamically sized. Ths simple fact of it is that we have too many static roots; finding ways to accomodate what is essentially a bug is not the route I'd like us to take.
Aren't static root sets the sets of static variables of each dynamic library (or an area with pointers to blocks of such variables)? If so, we would want to have an unlimited number of static root sets, since we obviously would like to be able to load an unlimited number of libraries. BTW, it may be possible to just set a very high value for MAX_ROOT_SETS and rely on virtual memory on-demand allocation.
Static root sets are indeed the static variables of each dynamic library. The problem at the present time is that we do a conservative scan of the static data area. This is inefficient and can leak memory. If we do the right thing, which is to switch to a precise scan of everything except the stack. this issue will go away.
What is the relation of the conservativeness of the scan to the number of root sets? They seem to be independent issues unless GCJ creates a lot of root sets to try to avoid covering non-pointer areas.
The root sets in each shared library exist only because we're conservatively scanning static data areas. When we move to a precise scan we will no longer register these root sets because every static datum is reachable from its class.
The FC6 gcj has a change that dramatically reduces the number of roots. I think this bug is fixed there. If you can try it, please do. Otherwise I think we should close this PR.
It has been a few months since the last note here. I believe this was fixed in FC6, so I am closing it. If you disagree please reopen or comment. Thanks.