Browse Source
Now that RepositoryCache have a time based eviction strategy, get rid of the strategy to evict cache entries if heap memory is running low, i.e. soft references. Main reason why time based eviction was implemented was to offer an alternative to the unpredictable soft references. Relying on soft references is not working, especially in large heap. The JVM GC will consider collecting soft references as last resort before throwing an out of memory error. For example, an application like Gerrit configured with a 128GB heap, GC will wait until all 128GB is filled before collecting the soft references so the application will be suffering long pauses caused by GC for a long time already. In other words, you will have to restart application because it's unusable before JVM eviction kicks in. Keeping the SoftReference in RepositoryCache is causing more harm than good. If you use the time based eviction (which is the default strategy) and want to tune JVM to release soft references more aggressively, it will release repositories from the cache even though they are not expired which defeats the purpose of the repository cache. Gerrit uses Lucene library which uses soft references and this is causing a "memory leak" except if you configure JVM to release soft references more aggressively which have the nasty side effect of evicting non expired repositories from the cache. Change-Id: I9940bd800464c7f007696d0ccde52ea617b2ebce Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>stable-4.6
Hugo Arès
8 years ago
2 changed files with 12 additions and 23 deletions
Loading…
Reference in new issue