Re: JDOM and memory
Paul Libbrecht <[email protected]>
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Message-ID | <[email protected]> |
Interesting, the very first thing I did when writing OmdocJdom, a library with subclasses for each element type, is to use string-interning. I do not believe you can reach Out-Of-Memory by having such a diversity in element names, prefixes, etc... unless you are building a kind of super generic editor or modifier. 100Mb of strings is quite a lot (far more than all DTDs I've been touching thus far in my life I believe). We never ran into OOM for this (but with Lucene we did). paul Le 28 janv. 2012 à 20:42, Rolf Lear a écrit : > no, I have not compared against string-interning property. I was not aware of that. But, reading the documentation, it says: All element names, prefixes, attribute names, Namespace URIs, and local names are internalized using java.lang.String.intern. > > This is *not* a good thing. String.intern() uses PermGen space to intern the value (as if the value is a String constant in the code). PermGen space is typically limited to a hundred or so megabytes. I have, in the past, run in to significant issues where you get OutOfMemory issues when String.intern is used liberally.... and changing -Xmx makes no difference... very confusing the first time you run in to that.... > > So, I have not compared, to string-intern of the SAX parser. And I would not recommend that people use that unless they know what they are doing, and what sort of data they have. _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]