Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312964

Summary: Allow PackIndex to GC under memory pressure
Product: [Technology] JGit Reporter: Shawn Pearce <sop>
Component: JGitAssignee: Project Inbox <jgit.core-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: matthias.sohn
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Shawn Pearce CLA 2010-05-14 15:10:22 EDT
When PackFile opens a PackIndex to scan it, the PackIndex sticks around forever.  This mirrors C Git behavior which does the same thing.  But in a server environment JGit may need to juggle thousands of pack indexes within a single JVM.  If a repository isn't accessed frequently, or even if its ancient history is infrequently accessed, some (or all) of its PackIndexes should be able to be discarded from memory and reloaded later on demand.

We might also want to tie these into a limited size cache, similar to what we already do with ByteWindow.