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.
Created attachment 98540 [details] test project Test case: - open attached project - open newfile.cpp - go to by hyper link on "IAdvancedSelectionCriteria" - sldworks.h is opened - see OOM after some moving in the file
first obvious memory improvement is: - finish optimization of AttributesUtilities$BigComposite by creating Composite4 It reduces objects size from 38Mb to 22Mb (saves 16Mb) See patch
Created attachment 98546 [details] introduce Compose4
Next obvious memory improvement is: - keep in memory only 1 buffer with file text. Actually editor has 3 buffers that consume 72Mb. So it can reduce memory consumption on 48Mb. This is list of fields with different instances of file text: - org.netbeans.modules.parsing.api.Snapshot.text - org.netbeans.editor.BaseKit$DefaultSyntax.buffer - org.netbeans.editor.DocumentContent.charArray By the way, why exists Snapshot in C/C++ project? CND does not use parsing API.
Created attachment 98554 [details] fixed patch
org.netbeans.editor.BaseKit$DefaultSyntax.buffer should certainly be eliminated. It could possibly be because of syntax instances caching - I'll remove the caching ASAP. I have an idea for AttributeSets memory reduction but I have to do some experiments first (not for 6.9). In the meantime I'm ok with Compose4. Vito, what do you think?
Removed Syntax caching in BaseDocument: http://hg.netbeans.org/jet-main/rev/27855e054de7
Added AttributesUtilities.Composite4 http://hg.netbeans.org/jet-main/rev/af40fde644ad
Integrated into 'main-golden', will be available in build *201005112200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/ User: Log:
Mila, there is one more unneded text. It is Snapshot for file. Open any C++ file org.netbeans.modules.parsing.api.Snapshot object is created due to CursorSensitiveScheduler which creates org.netbeans.modules.parsing.api.Source uncoditionally for each opened editor
(In reply to comment #9) > Mila, there is one more unneded text. > It is Snapshot for file. Open any C++ file > org.netbeans.modules.parsing.api.Snapshot object is created > due to CursorSensitiveScheduler which creates > org.netbeans.modules.parsing.api.Source uncoditionally for each opened editor I'll have a look.
http://hg.netbeans.org/jet-main/rev/71c08e172c8c - no Snapshot is created for C/C++ files. Even with this patch I still was not able to successfully open sldworks.h with -Xmx512m. There was OOME from o.n.m.cnd.editor.folding.CppFile, which makes a copy of the document as well.
(In reply to comment #11) > http://hg.netbeans.org/jet-main/rev/71c08e172c8c - no Snapshot is created for > C/C++ files. Vita, thanks. > Even with this patch I still was not able to successfully open > sldworks.h with -Xmx512m. There was OOME from o.n.m.cnd.editor.folding.CppFile, > which makes a copy of the document as well. this is because you don't have yet changes made in our repository, i.e.: http://hg.netbeans.org/cnd-main?cmd=changeset;node=04f15771c029 http://hg.netbeans.org/cnd-main?cmd=changeset;node=bb3cc5456927 http://hg.netbeans.org/cnd-main?cmd=changeset;node=2fa63b52bec7
Integrated into 'main-golden', will be available in build *201005132200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/ User: Log:
Integrated into 'main-golden', will be available in build *201005182201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/ User: Log: