Community
Participate
Working Groups
While investigating a performance issue on a Gerrit production server we found out that the window cache never reaches its full capacity which we configured as: core.packedGitLimit=96G. We set Xmx (and Xms) to 256G. We found out that the window cache grows in average to about 10G and then gets wiped off by the Java GC. The attached graph shows the jgit/block_cache/cache_used metric over time. The drops in the window cache size correlate with the heap consumption peaks. Given that JGit uses SoftReference for WindowCache entries [1], it is no surprise that Java GC is allowed to collect such entries if necessary. We tried increasing the XX:SoftRefLRUPolicyMSPerMB by the factor of 10 (set it to 10,000 as the default value is 1000) but this seems to only bring small improvements. However, we think that we should have more control over the eviction of the window cache and not just hope that Java GC will not wipe it off. We asked admins of large Gerrit servers if they can also share their time series for the metric jgit/block_cache/cache_used and the core.packedGitLimit value and the max heap size. [1] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/refs/heads/stable-5.1/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java#571
Created attachment 280808 [details] window cache size and used heap timeseries
New Gerrit change created: https://git.eclipse.org/r/153601
Gerrit change https://git.eclipse.org/r/153601 was merged to [stable-5.1]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=42f0c7c9cb1c516603da6f89ae7072989bf4b984
New Gerrit change created: https://git.eclipse.org/r/155149
Gerrit change https://git.eclipse.org/r/155149 was merged to [stable-5.1]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=709f83d489b777c21ad5bbeeb3e8b1232b3f0ee5