Bug 65272

Summary: Should use LRUCache for package fragments
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jerome Lanneluc CLA 2004-06-02 07:23:30 EDT
I20040529

In the following scenario:
1. New workspace on top of JDK 1.4.2_04
2. Check out v_436 of 
- org.eclipse.jdt.core, 
- org.eclipse.jdt.core.tests, 
- org.eclipse.jdt.core.tests.builder, 
- org.eclipse.jdt.core.tests.compiler, 
- org.eclipse.jdt.core.tests.model, 
and v20040527_1600 of 
- org.eclipse.jdt.ui.tests
- org.eclipse.jdt.ui.tests.refactoring
3. Search->Search->Java Search
4. Search string: add
5. Method, References
6. Press Search
7. Capture memory.

With I20040529, retained memory is 29MB. The package cache containes 1400 
entries.
Changing JavaModelCache#pkgCache to be an OverflowingLRUCache with 500 
entries, the retained memory is 25.6MB.
Comment 1 Jerome Lanneluc CLA 2004-06-02 07:29:34 EDT
Comparing the 2 memory snapshots, I see 20,000 ClassFile handles more using 
the HashMap than using the LRUCache.
Comment 2 Philipe Mulet CLA 2004-06-02 08:05:22 EDT
Post 3.0, as quite risky at this stage.

In particular, we may instead consider closing entire package fragment roots 
instead of losing some of their packages gradually. Thus when space is claimed, 
an entire jar is closed instead of portions of multiple ones.

Comment 3 Jerome Lanneluc CLA 2004-08-19 09:03:09 EDT

*** This bug has been marked as a duplicate of 57585 ***
Comment 4 Frederic Fusier CLA 2004-09-24 05:39:56 EDT
Verified for 3.1 M2 with build I200409231635.