Always use a single WindowCache for the entire JVM
commit3a6177ae98fea82dbba262103250ec0e6b2df5f2
authorShawn O. Pearce <spearce@spearce.org>
Sun, 18 May 2008 18:38:46 +0000 (18 14:38 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 18 May 2008 19:39:53 +0000 (18 15:39 -0400)
tree24850a1abf8f2f4dfda657ef4db9d3a6660c46cf
parent999f71b94a8c1ec7204f809f3e400b03f6f9d74b
Always use a single WindowCache for the entire JVM

It has become painfully obvious that when creating a Repository
object we do not want to be creating a unique WindowCache for it
at the same time.

Instead we always want to use the same cache for all repositories
so that concurrent access to multiple object stores can efficiently
share the same heap within the JVM.  If a repository is being heavily
accessed it should get a larger share of the scarce heap space than
other repositories that are inactive.

We almost support dynamic reconfiguration of our WindowCache limits.
The UnpackedObjectCache can be reconfigured on the fly, but the code
needed to support dynamic reconfiguration of the WindowCache is much
more complex due to the number of private cache control members we
expose out at package level to WindowedFile.  I'm glossing over that
until a future change

Since we just about support dynamic reconfiguration we no longer show
that note in the Eclipse preference page and we activate the user's
preferences when the core plugin starts.

By moving everything to be static the cache access machine code will
require less instructions, which should also boost our performance
by a tiny margin, especially in data access heavy operations like a
RevWalk coming from completely unparsed commits.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 files changed:
org.spearce.egit.core/src/org/spearce/egit/core/Activator.java
org.spearce.egit.core/src/org/spearce/egit/core/op/ConnectProviderOperation.java
org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java
org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/GitCloneWizard.java
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/WindowCachePreferencePage.java
org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties
org.spearce.jgit/src/org/spearce/jgit/lib/ByteWindow.java
org.spearce.jgit/src/org/spearce/jgit/lib/CoreConfig.java
org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java
org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
org.spearce.jgit/src/org/spearce/jgit/lib/UnpackedObjectCache.java
org.spearce.jgit/src/org/spearce/jgit/lib/WindowCache.java
org.spearce.jgit/src/org/spearce/jgit/lib/WindowCursor.java
org.spearce.jgit/src/org/spearce/jgit/lib/WindowedFile.java