Bug 155273

Summary: "Too many root sets" when using Eclipse
Product: [Fedora] Fedora Reporter: Luca Barbieri <luca.barbieri>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: aph, tromey
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: fc6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-03-08 23:46:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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):
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.

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

gc_cflags="-DLARGE_CONFIG"

in boehm-gc/configure.host

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.