Bug 260257 - Reduce space taken by SourceRefElementInfos
Summary: Reduce space taken by SourceRefElementInfos
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2009-01-07 09:38 EST by Jerome Lanneluc CLA
Modified: 2009-01-27 13:45 EST (History)
1 user (show)

See Also:


Attachments
Proposed fix (48.42 KB, patch)
2009-01-07 09:40 EST, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2009-01-07 09:38:12 EST
I20090106-1323

SourceRefElementInfos have many unused fields. For example the 'children' field for methods is most of the time empty since most methods don't have children.

We should create special subclasses that define these fields only when needed.
Comment 1 Jerome Lanneluc CLA 2009-01-07 09:40:27 EST
Created attachment 121811 [details]
Proposed fix

With this fix, after filling the Java model cache, the size of this cache is reduced by 4%.
Comment 2 Jerome Lanneluc CLA 2009-01-07 11:40:53 EST
Fix released for 3.5M5.

To verify that the fix is in, one can:
1. Run a workspace with lots of compilation units on 3.5M4
2. Install the JDT Core Spy from http://www.eclipse.org/jdt/core/tools/jdtcoretools/update-site/
3. Run JDT Core Spy > Fill Java Model Cache
4. Take a memory snapshot with YourKit
5. Follow step 1-4 with 3.5M5
6. Compare the snapshots
Comment 3 Srikanth Sankaran CLA 2009-01-27 06:39:41 EST
Verified for 3.5M5 using I20090125-2000 build

As I don't have access to YourKit and since the link for JDT Core Spy appears broken right now, I eyeballed the changes to the layout of different classes to understand how fields have been "radiated out" to be away from the root of the hierarchy so as to minimize the memory requirement.