Bug 129624

Summary: AccessRuleSet#messageTemplates takes a lot of memory
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2006-02-27 13:55:38 EST
I20060223-1656

After running for about a day, I made a memory snapshot of my development Eclipse (ZRH plugins in source, dependencies imported as binary).

I saw that the strings in AccessRuleSet#messageTemplates take about 3.4 MB together. I found e.g. 59 distinct instances of the same string
"The type {0} is not accessible due to restriction on required library org.eclipse.jface/org.eclipse.jface_3.2.0_I20060216-1600.jar", which together use 17KB.

Since these strings seem to occur in patterns, they should probably be interned or otherwise reused.
Comment 1 Philipe Mulet CLA 2006-02-27 16:46:35 EST
Indeed, these should be interned.
Comment 2 Jerome Lanneluc CLA 2006-03-01 09:10:06 EST
Changed ClasspathEntry#getMessageTemplates() and State#readRestriction(DataInputStream) to use JavaModelManager#intern(String)
Comment 3 Maxime Daniel CLA 2006-03-28 03:22:07 EST
Verified for 3.2M6 using build I20060327-0010.