Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 26232 Details for
Bug 106202
JavaModelCache should have configurable LRU cache limits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to set the size of the caches relatively to the max heap size
patch106202_org.eclipse.jdt.core.txt (text/plain), 2.73 KB, created by
Jerome Lanneluc
on 2005-08-18 11:03:32 EDT
(
hide
)
Description:
Patch to set the size of the caches relatively to the max heap size
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2005-08-18 11:03:32 EDT
Size:
2.73 KB
patch
obsolete
>Index: model/org/eclipse/jdt/internal/core/JavaModelCache.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java,v >retrieving revision 1.20 >diff -u -r1.20 JavaModelCache.java >--- model/org/eclipse/jdt/internal/core/JavaModelCache.java 29 Mar 2005 13:36:10 -0000 1.20 >+++ model/org/eclipse/jdt/internal/core/JavaModelCache.java 18 Aug 2005 14:57:44 -0000 >@@ -19,12 +19,11 @@ > * The cache of java elements to their respective info. > */ > public class JavaModelCache { >- public static final int BASE_VALUE = 20; > public static final int DEFAULT_PROJECT_SIZE = 5; // average 25552 bytes per project. >- public static final int DEFAULT_ROOT_SIZE = BASE_VALUE*10; // average 2590 bytes per root -> maximum size : 25900*BASE_VALUE bytes >- public static final int DEFAULT_PKG_SIZE = BASE_VALUE*100; // average 1782 bytes per pkg -> maximum size : 178200*BASE_VALUE bytes >- public static final int DEFAULT_OPENABLE_SIZE = BASE_VALUE*100; // average 6629 bytes per openable (includes children) -> maximum size : 662900*BASE_VALUE bytes >- public static final int DEFAULT_CHILDREN_SIZE = BASE_VALUE*100*20; // average 20 children per openable >+ public static final int DEFAULT_ROOT_SIZE = 50; // average 2590 bytes per root -> maximum size : 25900*BASE_VALUE bytes >+ public static final int DEFAULT_PKG_SIZE = 500; // average 1782 bytes per pkg -> maximum size : 178200*BASE_VALUE bytes >+ public static final int DEFAULT_OPENABLE_SIZE = 500; // average 6629 bytes per openable (includes children) -> maximum size : 662900*BASE_VALUE bytes >+ public static final int DEFAULT_CHILDREN_SIZE = 500*20; // average 20 children per openable > > /** > * Active Java Model Info >@@ -57,11 +56,13 @@ > protected Map childrenCache; > > public JavaModelCache() { >+ // set the size of the caches in function of the maximum amount of memory available >+ double ratio = Runtime.getRuntime().maxMemory() / 64000000; // 64000000 is the base memory for most JVM > this.projectCache = new HashMap(DEFAULT_PROJECT_SIZE); // NB: Don't use a LRUCache for projects as they are constantly reopened (e.g. during delta processing) >- this.rootCache = new ElementCache(DEFAULT_ROOT_SIZE); >- this.pkgCache = new ElementCache(DEFAULT_PKG_SIZE); >- this.openableCache = new ElementCache(DEFAULT_OPENABLE_SIZE); >- this.childrenCache = new HashMap(DEFAULT_CHILDREN_SIZE); >+ this.rootCache = new ElementCache((int) (DEFAULT_ROOT_SIZE * ratio)); >+ this.pkgCache = new ElementCache((int) (DEFAULT_PKG_SIZE * ratio)); >+ this.openableCache = new ElementCache((int) (DEFAULT_OPENABLE_SIZE * ratio)); >+ this.childrenCache = new HashMap((int) (DEFAULT_CHILDREN_SIZE * ratio)); > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 106202
: 26232