Summary: | JavaModelCache's size grows when displaying type hierarchy | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Eric Jodet <eric_jodet> | ||||||||||||||
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> | ||||||||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||||||||
Severity: | normal | ||||||||||||||||
Priority: | P3 | Keywords: | performance | ||||||||||||||
Version: | 3.3 | ||||||||||||||||
Target Milestone: | 3.3 M7 | ||||||||||||||||
Hardware: | PC | ||||||||||||||||
OS: | Windows XP | ||||||||||||||||
Whiteboard: | |||||||||||||||||
Attachments: |
|
Description
Eric Jodet
2007-04-18 07:34:42 EDT
Created attachment 64162 [details]
screen shot
delta observed between 2 yourkit snapshots
had another test run with yourkit. once hierarchy displayed, forced a gc: used memory decreased from 240 to 190 Mo. Still, according to the snapshot taken right after the gc, the JavaModel retained size is still 68 Mo. please read: (...) the JavaModelCache retained size is (...) This feels a lot. Are hierarchy binary types still being used ? Created attachment 64576 [details]
Proposed fix
This fix consists in removing the 'isPackage' set from the ProjectCache as it takes a huge space in a workspace with lots of roots.
Patch released for 3.3M7 in HEAD. Note that with this patch the retained size of the ProjectCache goes from 45MB to 27MB on my monster workspace (after computing the hierarchy on org.eclipse.core.runtime.Plugin). Keep investigating if more memory can be gained. Created attachment 64656 [details]
Other improvement
This improvement consists in having on package fragment cache per root and iterating through these caches.
This reduces the memmory used by the ProjectCache in the monster workspace to 6MB. However this slows reconciling down.
Created attachment 64691 [details]
Other improvement v2
This improvement still shares the package fragment caches, but brings back the flattened package fragment cache per project. This brings performances back to normal and memory of the ProjectCache for the monster workspace is now 23MB.
Created attachment 64707 [details]
Other improvement v2
Uses a HashSetOfArray to store package names instead of a HashtableOfArrayToObject.
Other improvement v2 released for 3.3M7 in HEAD. To conclude: 1. the JavaModelCache's size will still grow the first time the type hierarchy is computed (as the ProjectCaches are initialized). But it will remain stable the same that. 2. we gained 22MB on the monster workspace scenario Running the exact same scenario with a recent build, allocated mem never exceeded 184 Mo (compared to the 332 Mo without the fix)! Also took a Yourkit snapshot, where JavaModelManager is now 38 Mo compared to the 68 Mo with previous version. Verified for 3.3 M7 using build I20070427-0010 Created attachment 65764 [details] Patch against R3_2_maintenance This patch: - merges both "Proposed fix" patch and "Other improvement v2" patch - includes the fix for bug 183833 (which was a regression of "Other improvement v2" patch) Also note that this patch also fixes bug 161175 (since children of package fragment roots are computed only once). Patch released in R3_2_maintenance |