Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365499 - Add a system property to control for JavaModelManager's jar type cache size
Summary: Add a system property to control for JavaModelManager's jar type cache size
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: 3.8 M6   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 341016
  Show dependency tree
 
Reported: 2011-12-02 19:35 EST by Terry Parker CLA
Modified: 2012-03-13 18:22 EDT (History)
4 users (show)

See Also:


Attachments
Patch to add a preference controlling the JavaModelCache's jar type cache ratio (2.52 KB, patch)
2011-12-02 19:36 EST, Terry Parker CLA
no flags Details | Diff
Updated patch (2.88 KB, patch)
2012-02-17 02:49 EST, Terry Parker CLA
jarthana: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Terry Parker CLA 2011-12-02 19:35:52 EST
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.
Comment 1 Terry Parker CLA 2011-12-02 19:36:55 EST
Created attachment 207874 [details]
Patch to add a preference controlling the JavaModelCache's jar type cache ratio
Comment 2 Ayushman Jain CLA 2011-12-03 02:07:38 EST
Jay, can you look at the patch and follow up? Thanks!
Comment 3 Terry Parker CLA 2012-01-04 11:40:54 EST
Has anyone had a chance to look at this yet?  Thanks.
Comment 4 Jay Arthanareeswaran CLA 2012-01-04 12:39:14 EST
(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.
Comment 5 Satyam Kandula CLA 2012-02-16 08:28:57 EST
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.
Comment 6 Terry Parker CLA 2012-02-17 02:49:23 EST
Created attachment 211160 [details]
Updated patch

Updated the patch for requests in comment 5.
Comment 7 Jay Arthanareeswaran CLA 2012-02-21 00:05:15 EST
(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.
Comment 8 Satyam Kandula CLA 2012-02-21 00:19:06 EST
Looks good to me. 
Jay, Please release.
Comment 10 Ayushman Jain CLA 2012-03-12 14:51:18 EDT
Verified using code inspection and since submitter has also tested, marking this as verified for 3.8M6.