This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
xdm model uses ExtSyntaxSupport to create tokens. When hl7 schemas (fields.xsd) are loaded as a result of creating xdm model, it creates ~8mb of org.netbeans.editor.ext.ExtSyntaxSupport$TokenItemTP$Item. See attached heap dump image. hl7 (fields.xsd) schema can be found in xml/xdm unit tests.
Created attachment 44126 [details] heap dump image
Well, ExtSyntaxSupport is deprecated (or will be for 6.0), can you use Lexer? It should be more efficient, because it's incremental. Of course if you iterate through the whole hierarchy and create all tokens they will be in memory.
For 6.0, we will not be able to migrate to lexer. It is too late. OTOH, if I use SyntaxSupport to parse the entire document, I dont understand why the tokens should float around if they are not being used. IMO, the memory usage could still be minimized by using flyweight pattern or by whatever means.
Any updates on this one?
Created attachment 46575 [details] Memory histogram with the file opened
Attached is a jmap memory histogram from the ide with. I opened the file, edited it and invoked a GC. After that I did the jmap -histo. Apparently there is nothing like 8 megs of the TokenItemTP$Item. I did a binary dump too and it gives the same result. Tested on both JDK5 and JDK6