Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 155273 - "Too many root sets" when using Eclipse
Summary: "Too many root sets" when using Eclipse
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-04-18 18:52 UTC by Luca Barbieri
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version: fc6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-03-08 23:46:24 UTC

Attachments (Terms of Use)

Description Luca Barbieri 2005-04-18 18:52:22 UTC
Description of problem:
The message "Too many root sets" sometimes appears, especially using Eclipse.

Version-Release number of selected component (if applicable):

How reproducible:

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.

Comment 1 Jakub Jelinek 2005-04-24 12:10:59 UTC
I can't find MAX_ROOT_SETS nor anything similar in libjava, nor such message.

Comment 2 Luca Barbieri 2005-04-24 13:06:27 UTC
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

Comment 3 Andrew Haley 2005-04-24 14:48:08 UTC
The right thing to do is


in boehm-gc/

IMO this is acceptable for mainline.

Comment 4 Luca Barbieri 2005-04-24 15:41:27 UTC
I agree.

Longer-term, the structures ought to made dynamically sized.

Comment 5 Andrew Haley 2005-04-25 09:46:36 UTC
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.

Comment 6 Luca Barbieri 2005-04-25 10:09:29 UTC
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.

Comment 7 Andrew Haley 2005-04-25 10:14:59 UTC
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.

Comment 8 Luca Barbieri 2005-04-25 10:21:46 UTC
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.

Comment 9 Andrew Haley 2005-04-25 10:27:14 UTC
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.

Comment 10 Tom Tromey 2006-09-27 18:13:39 UTC
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.

Comment 11 Tom Tromey 2007-03-08 23:46:24 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.