This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Debugging "Leaks" With Boehm-GC


Craig A. Vanderborgh writes:

 > We are currently experiencing some dire difficulties with one of
 > GCJ's most opaque aspects - garbage collection.
 > 
 > The application exhibiting "leaks" is an XML browser of our own
 > creation.  The use case that "leaks" is one where our browser
 > software works its way through interpreting some page elements, and
 > then throws an "event", which is implemented by throwing a Java
 > exception, which something up the stack elements then catches.  The
 > software works beautifully, except it "leaks".
 > 
 > I am using quotes around "leaks" because I do not think this
 > problem is a garbage collection fault.  I believe it's a problem
 > caused by our application.  The test case that shows the "leaking"
 > is a VXML browser test which repeatedly preprocesses then
 > interprets the same cached page.  What we can see with
 > GC_STDOUT/GC_PRINT_STATS enabled is that Boehm GC is unable to
 > garbage-collect classes from our own browser implementation that it
 > SHOULD BE ABLE to collect.

That's always a possibility, because we use a conservative scan of
both static data and the stack.  

 > Is there some way to do this?  I need to know everything there is to 
 > know about  "GCJ leak detection", and I need to know it yesterday.  
 > Someone - anyone - please give me some clues about what to learn and how 
 > to approach this.  This problem is truly killing us, and I am going to 
 > have to move aggresively to fix it.  Documentation, Boehm GC debugging 
 > tips, slaps in the face, anything at all would be appreciated.

If I were in your situation, I would rebuild the gc and gcj with
--enable-gc-debug then fire up gdb and use GC_print_backtrace() on
some of the objects that aren't being collected.  This function will
show you immediately why an object isn't being collected.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]