Community
Participate
Working Groups
20021127 in a large file (SWT.java) i cut something from within a comment and undid the action it allocated a lot of objects - including 3Mb of char[] attached is allocation backtrace seems like calling codeselect allocates a lot of stuff - maybe unnecessarily or maybe we could avoid calling it on every keystroke
Created attachment 2562 [details] cut, undo
The memory is allocated by ICompilationUnit.codeSelect(). There is a bug report for this (bug 27321). But from looking at the code it seems that the result of the method getCurrentTextRegion isn't used in keyPressed. So may be the call can be removed?
cannot reproduce this problem anuymore the code in JavaEditor.MouseClickListener.keyPressed is still problematic however (looks like the last follwoing lines can simply be removed - nothing seems to be done with the their result) ISourceViewer viewer= getSourceViewer(); if (viewer == null) return; IRegion region= getCurrentTextRegion(viewer); if (region == null) return;
Code changed as proposed in build > 20021210.