]> source.dussan.org Git - jgit.git/commit
Remove SoftReference from dfs.DeltaBaseCache 70/47570/2
authorShawn Pearce <spearce@spearce.org>
Sun, 10 May 2015 02:53:53 +0000 (19:53 -0700)
committerShawn Pearce <spearce@spearce.org>
Mon, 11 May 2015 18:39:28 +0000 (11:39 -0700)
commit2eb16aa6ca5415ae4e741c4d1056890e07fa27e5
tree5831a5c312470b9f125c9999cb0a0e0546fef2aa
parent8ff08455f62f5696b718ff558507cce3709d604b
Remove SoftReference from dfs.DeltaBaseCache

The Java GC doesn't always clear these before running out of memory
and failing allocations. In practice OpenJDK 7 is leaving these live,
removing any advantage of the SoftReference to attempt to shed memory
when the GC is unable to continue allocating.

Instead follow the pattern of the DfsBlockCache and use hard refs
to the object data. Require applications to configure the cache
size more accurately given expected memory usage.

Change-Id: I87586b3e71b1cba0308a6a278d42e971be4bccd3
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCache.java