<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Interesting,</div><div><br></div><div>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).</div><div><br></div><div>paul</div><div><br></div><br><div><div>Le 28 janv. 2012 à 20:42, Rolf Lear a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">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.<br><br>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....<br><br>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.</span></blockquote></div><br></body></html>