Re: JDOM and memory

Rolf Lear <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>

On 28/01/2012 5:31 PM, Michael Kay wrote:
>
>> In many places 1,000,000 strings is not a lot....
>>
> The Saxon NamePool is optimized for much lower numbers than this: it's
> rare to have more than a couple of thousand element and attribute names.
> The only time I've seen large numbers reached is with pathological
> applications that generate random namespace prefixes.
>
> Michael Kay
> Saxonica
>

I addressed this in mail I inadvertently did not send to the list, but 
to Paul only. I corrected that now.

The issue is not so much the content of one document, but the content of 
all data in a JVM. Tomcat is a prime example. Because it uses a separate 
Classloader for each installed application, it has many multiples of 
copies of classes in the perm-gen. The permgen space is limited to start 
with.... then, if these applications are doing JDOM processing then you 
are in trouble if JDOM uses the PermGen space for 'scratch' data.

PermGen is a non-obvious component of Java. Novices do not know of it, 
do not understand it's purpose, and do not know how to debug it. By way 
of example, I ran in to it using intern() and it took me days to figure 
out where the memory was going.... (years ago). Perhaps that is why I am 
so sensitive to it. Similarly, do a search for 'Tomcat PermGen' and you 
quickly understand how precious PermGen space is, it is not to be 
squandered on something that is easy to replace on the heap.

Rolf
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.