Community
Participate
Working Groups
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.
*** This bug has been marked as a duplicate of 106202 ***