I have spend days to figure out why the caches files were way larger than they should and found a setting to give more time to H2 to compact them on startup. T323754#8419742 We should adjust our config for Gerrit 3.10.
We have -Dh2.maxCompactTime=15000 (milliseconds) it is unclear whether that is still needed. Hopefully the auto pruning has a longer time hardcoded in.
Config: https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#cachePruning