Im curious why -XX:+DisableExplicitGC is used in our Elasticsearch install (via apt packages).
I often use an explicit GC to see how much memory is locked into the heap so that I can see how much memory we have free.
But of course with the current setup, there's now way to use this.
Was this done because some library was calling explicit GC in the background?
I'd love this have this enabled again, and realistically, ES shouldn't be setting this.
-XX:+DisableExplicitGC should not be set. It can disable heap cleanup on direct byte buffers outside of the heap on some JVM, with the effect that memory usage for the ES process continue to grow.
Yes. this is a good point. The GC activity of direct buffers doesn't work well without an explicit GC.
I imagine they added it due to some tools causing GC. But it should be removed unless there is a documented rationale.
It's also helpful to run GC if you want to determine a baseline of free memory