Bug 106226 - JavaModelCache should have configurable LRU cache limits
Summary: JavaModelCache should have configurable LRU cache limits
Status: RESOLVED DUPLICATE of bug 106202
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-05 15:16 EDT by Ernest Pasour CLA
Modified: 2005-08-07 22:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ernest Pasour CLA 2005-08-05 15:16:11 EDT
We are working with the classpath container extension point and found that if we
add a lot of jars to our container, the JDT starts thrashing the garbage
collector.  Upon further investigation, we found that there is a limit of 2000
packages in the package cache in the JavaModelCache.  Every time I delete and
readd a semicolon and resave the file, the model cache appears to go rebuild the
cache data for all of those jars (even though I'm not actually referencing all
of them from my code) and this makes the garbage collector thrash.  Looking at
the code, it appears that 2000 is a hardcoded limit.  There is a setSpaceLimit()
method on LRUCache, but the class is internal, and I don't see a public way to
get the cache pointer anyway.  

So even though I'm running with -Xmx512m, I'm thrashing memory at a much lower
level than that, and I don't see a workaround other than to not add so many jars
to my classpath.
Comment 1 Olivier Thomann CLA 2005-08-07 22:10:20 EDT

*** This bug has been marked as a duplicate of 106202 ***