Community
Participate
Working Groups
Build Identifier: M20110909-1335 Even when giving Eclipse 3GB of memory, the JavaModelManager's jar type cache is undersized for most of our projects. Our project sizes are such that rather than mapping all of the source into Eclipse, we map in only a subset of the source and prebuild the non-mapped sources as jars and add them to the Eclipse classpath as library archives. As a result, typical projects here contain thousands of jars on the Eclipse classpath. Bumping up the jar type cache by a factor of 3-4 prevents active BinaryTypes from being evicted from the jar type LRU cache. The patch is modeled on the "org.eclipse.jdt.core.javamodelcache.ratio" property for adjusting the openable cache. I applied the patch at head and ran it against and ran test against it and see no new tests failing. This patch is a no-op if the system property is not defined. Do you have any suggestions for how to test it? I don't see a corresponding test for the "org.eclipse.jdt.core.javamodelcache.ratio" property. Reproducible: Always Steps to Reproduce: 1. Turn on tracing for org.eclipse.jdt.core's debug/javamodel/cache 2. Restart Eclipse several times, giving the VM differing sizes of -Xmx maximum memory 3. Observe that the jar type cache always increases one half the size of the package cache. There is no way to change this ratio.
Created attachment 207874 [details] Patch to add a preference controlling the JavaModelCache's jar type cache ratio
Jay, can you look at the patch and follow up? Thanks!
Has anyone had a chance to look at this yet? Thanks.
(In reply to comment #3) > Has anyone had a chance to look at this yet? Thanks. I am not sure if I can look at this for M5. We will consider this for the next milestone.
Having a separate ratio for the files is good and as we may not want to increase this by default, leaving it as a separate option is a good idea. I have one minor comment in the patch - getJarTypeRatio and getOpenableRatio can be clubbed into one method. Please also write your name in the copyright.
Created attachment 211160 [details] Updated patch Updated the patch for requests in comment 5.
(In reply to comment #6) > Created attachment 211160 [details] Looks good to me. Satyam, I will release this unless you have any more points to add.
Looks good to me. Jay, Please release.
Released it here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=7b395b3717036fc2a84c58be444dfad51be38b89
Verified using code inspection and since submitter has also tested, marking this as verified for 3.8M6.