Community
Participate
Working Groups
Build: 3.1 M6 Test case: 1) Open new workspace, switch to Java perspective 2) Leave all settings as out of box default, except turn autobuild off 3) Import org.eclipse.swt plugin 4) Open Java editor on StyledText.java 5) Close editor, run garbage collector several times 6) Snapshot heap 7) Open Java editor on StyledText.java 8) Snapshot heap More than 100MB of objects are allocated. Here are the main culprits: Class Instances Size --------------------------------- char[] 161,742 30,657 KB Object[] 364,524 28,370 KB StyleRange 435,825 20,429 KB Region 313,712 9,803 KB String 112,708 4,402 KB text.Line 48,277 1,577 KB Note 1: this source file is 262 KB, so more StyleRange instances are created than bytes in the file. Although 48,000 instances of jface.text.Line are created, the file has less than 8,000 lines. After several garbage collections, the memory overhead is much better: Class Instances Size --------------------------------- char[] 33,566 2,514 KB Object[] 31,112 2,265 KB StyleRange 55,781 2,614 KB Region 1 32 bytes String 15,315 598 KB text.Line 14,284 557 KB Why does it matter how much garbage is created? The amount of memory allocated from the OS by the VM largely depends on "peak" memory usage. Opening editors is one such peak period. If we can reduce the amount of memory allocated during peak memory usage periods, we decrease (or avoid increasing) the total memory allocated to Eclipse by the operating system. This in turn decreases OS memory swapping, etc.
I missed a step in the creation of my test case: 1a) Close *all* views, leaving only the editor area taking the entire perspective. I wanted to capture only the memory allocated by the editor, not by other views. Also, I opened the Java editor in step 7) using the history list in the File menu, to avoid any possible memory interference by the types cache and indexer.
*** Bug 127111 has been marked as a duplicate of this bug. ***
Has to be shifted to 3.3. This is something which reaches deep into the text APIs.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.