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.

Bug 107555 - 8mb of org.netbeans.editor.ext.ExtSyntaxSupport$TokenItemTP$Item
Summary: 8mb of org.netbeans.editor.ext.ExtSyntaxSupport$TokenItemTP$Item
Status: RESOLVED WORKSFORME
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@editor
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 98405
  Show dependency tree
 
Reported: 2007-06-21 01:59 UTC by Samaresh Panda
Modified: 2007-11-05 13:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
heap dump image (51.08 KB, application/octet-stream)
2007-06-21 01:59 UTC, Samaresh Panda
Details
Memory histogram with the file opened (366.06 KB, text/plain)
2007-08-14 14:38 UTC, Petr Hrebejk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samaresh Panda 2007-06-21 01:59:00 UTC
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.
Comment 1 Samaresh Panda 2007-06-21 01:59:35 UTC
Created attachment 44126 [details]
heap dump image
Comment 2 Vitezslav Stejskal 2007-06-21 04:56:01 UTC
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.
Comment 3 Samaresh Panda 2007-06-25 20:18:38 UTC
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.
Comment 4 Samaresh Panda 2007-07-12 18:45:53 UTC
Any updates on this one?
Comment 5 Petr Hrebejk 2007-08-14 14:38:13 UTC
Created attachment 46575 [details]
Memory histogram with the file opened
Comment 6 Petr Hrebejk 2007-08-14 14:42:45 UTC
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