P.S. The traffic is serialised so that we have the certainty that threads are done with their jobs when the next operation starts.Â
The scenario is quite simple: just generate a constant traffic of continuous clones and JGit GC and, after a few hours, the JVM id completely dead.
By using a G1GC and tuning it, I managed to avoid almost all the STW GC cycles. However, the memory utilised increases continuously and at the end al the GC goes into an infinite loop trying to release something without being able to do so.
Sample of the GC log when the JVM is collapsed:
2019-06-11T08:15:27.340+0200: 28506.935: [Full GC (Allocation Failure) Â90G->89G(100G), 106.4610300 secs]
Â Â[Eden: 0.0B(35.0G)->0.0B(35.0G) Survivors: 0.0B->0.0B Heap: 90.5G(100.0G)->89.2G(100.0G)], [Metaspace: 61559K->61559K(65536K)]
And the JVM heap utilization:
With regards to the memory dump, see the following top offenders:
I have explicitly set low limits for caching packfiles in the gerrit.config:
Â ÂpackedGitLimit = 10m
Â ÂpackedGitOpenFiles = 16000
Â ÂpackedGitWindowSize = 64k
In theory, JGit shouldn't hold huge amount of memory for packfiles and instead continuously read them from the filesystem. However, as you can see from the above figures, we have over 2M byte arrays holding over 22GBytes of memory.
I also have a ~/.gitconfig with a specific [pack] configuration:
Â Â Â Â maxDeltaDepth=5
Â Â Â Â deltaSearchWindowSize=10
Â Â Â Â deltaSearchMemoryLimit=0
Â Â Â Â deltaCacheSize=52428800