]> source.dussan.org Git - jgit.git/commit
Use core.streamFileThreshold to set our streaming limit 41/1041/1
authorShawn O. Pearce <spearce@spearce.org>
Fri, 2 Jul 2010 19:41:39 +0000 (12:41 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 2 Jul 2010 19:41:39 +0000 (12:41 -0700)
commit113577617bc4b2b31f2a44290cc607431c8357a7
tree870f1bfcf97561be8e71220266996a21e9a3de01
parentad68553be4417ec7ac636c3d823fdddced46ecfb
Use core.streamFileThreshold to set our streaming limit

We default this to 1 MiB for now, but we allow users to modify
it through the Repository's configuration file to be a different
value.  A new repository listener is used to identify when the
setting has been updated and trigger a reconfiguration of any
active ObjectReaders.

To prevent a horrible explosion we cap core.streamFileThreshold
at no more than 1/4 of the maximum JVM heap size.  We do this
because we need at least 2 byte arrays equal in size to the
stream threshold for the worst case delta inflation scenario,
and our host application probably also needs some amount of the
heap for their working set size.

Change-Id: I103b3a541dc970bbf1a6d92917a12c5a1ee34d6c
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 files changed:
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackFileTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/UnpackedObjectTest.java
org.eclipse.jgit/src/org/eclipse/jgit/events/ConfigChangedEvent.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/events/ConfigChangedListener.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerList.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/CoreConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/CachedObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileObjectDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/LargePackedDeltaObject.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/UnpackedObject.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCursor.java