VersionedMetaData: Release RevWalk after loading is done

Change I2e0b13feb added a class variable for the RevWalk to
VersionedMetaData to make it available to sub-classes during load. After
loading is done this class variable should be unset so that the RevWalk
can be released. Change I2e0b13feb intended to do this, but set the
wrong variable to null ('rw' should be set to null, not 'walk').

Since the class variable for the RevWalk in VersionedMetaData ('rw') was
not nulled, the RevWalk was kept in memory and as result of this the
memory consumption for the project cache increased very much (because
every ProjectState in the project cache has a ProjectConfig). This led
to GC thrashing in our system.

Change-Id: Ia905626923f1fd8878437b43f70fb5ca62cd41b2
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-07-06 13:46:02 +02:00
parent 2bbe7d738f
commit 7c2d987c40

View File

@@ -160,8 +160,8 @@ public abstract class VersionedMetaData {
revision = id != null ? walk.parseCommit(id) : null;
onLoad();
} finally {
walk = null;
reader = null;
this.rw = null;
this.reader = null;
}
}