]> source.dussan.org Git - jgit.git/commit
Fix memory leak in dfs.DeltaBaseCase 69/47569/2
authorShawn Pearce <spearce@spearce.org>
Sun, 10 May 2015 01:11:20 +0000 (18:11 -0700)
committerShawn Pearce <spearce@spearce.org>
Mon, 11 May 2015 18:39:28 +0000 (11:39 -0700)
commit8ff08455f62f5696b718ff558507cce3709d604b
tree476a6560fff0172f71aadeccfc97996c3361af0c
parent3852a085bd4c5fd6fc96480da2a08c34f57630bc
Fix memory leak in dfs.DeltaBaseCase

The LRU chain management code was broken leading to situations where
the chain was incomplete.  This prevented the cache from removing
items when it exceeded its memory target, causing a leak.

One case was repeated hit on the head of the chain. moveToHead(e)
was invoked linking the head back to itself in a cycle orphaning
the rest of the table.

Add some unit tests to cover this and a few other paths.

Change-Id: Ib27486eaa1b1d2bf1c745a56d0a5832bfb029322
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCacheTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DeltaBaseCache.java