[jdom-interest] large number of objects in heap

Joseph Bowbeer jozart at csi.com
Sat Aug 25 23:58:41 PDT 2001


Carey Boldenow writes:

> We have been experiencing out of memory exceptions
> in our application...

Are you reusing the same SAXBuilder?

If so, try creating a new SAXBuilder for each request and see if that helps.

Many months ago, a coworker's examination of the heap revealed many
occurrences of the string
"org/apache/xerces/utils/StringPool$StringProducer".

Why wasn't Xerces' string pool getting cleaned up?  Isn't the reset method
supposed to do that?

I may never know.  Creating a new SAXBuilder for each request fixed the
problem.

Build 7 includes the following patch, right?

SAXBuilder 1.51 on 6/1/2001

        finally {
            // Explicitly nullify the handler to encourage GC
            // It's a stack var so this shouldn't be necessary, but it
            // seems to help on some JVMs
            contentHandler = null;
        }


--- original message ---

From: "Carey Boldenow" <c.boldenow at cytera.com>
Date: Sat, 25 Aug 2001 09:48:15 -0500
Subject: [jdom-interest] large number of objects in heap

We have been experiencing out of memory exceptions in our application and
while running Optimizeit on our application we noticed that there is a huge
number of objects in the heap (char[], Strings, and ArrayLists). While
following back the tracing, we found that the majority of these objects are
originating from JDOM and specifically
xmlDocumentScanner$ContentDispatcher.dispatch() and other SAXParser methods.
Worse yet, it appears as though these objects never get garbage collected.
We are using Build 7 with the default parser (crimson). Is this to be
expected or are we missing something possible in our code?






More information about the jdom-interest mailing list