On 11/10/2023 06:09, bilal qureshi wrote:
I'm using solr cloud 9.1.1 on solr cloud cluster start initial heap it
takes around 400 MB out of 12 GB. After some queries on solr heap increases
to 8 GB. And when I reload the collection it reduces to 7GB.
using G1GC in this case.
Running the same testcase with ZGC, it reduces heap to less than 1 GB.
In order to have this be a valid comparison, you would have to trigger a
full GC, not just reload the collection. Solr itself will never
manually trigger any kind of GC, you would have to add a custom plugin
or compile a custom version of Solr.
G1GC is going to concentrate on cleaning the new generation. In order
for garbage to be collected in the old gen, a full GC must occur. G1GC
tries to NOT do full GCs unless it absolutely has to. With 8GB out of
12GB in use, there is plenty of free memory without the full GC, which
is why it does not do anything to the old gen.
If allocated heap gets close enough to the max (12GB in your case), then
G1 will do a full GC. Which will be slow and will pause Solr until it's
done. On an 8GB heap, I have seen G1GC pause the application for up to
15 seconds when doing a full GC.
I know very little about how ZGC actually functions. I have done some
experiments with it ... gceasy.io analysis reveals that it does a lot
more total collections than G1, but each one is significantly faster
which means that an individual pause is very brief. From your results,
it appears that ZGC does clean both generations on its incremental runs.
Thanks,
Shawn