I've observed "Full GC (System)" messages being written to my logs every 60 minutes. When I do this:
jstat -gccause {pid} 5s
I see that this is coming from explicit calls to System.gc(). I'm trying to track down what code is calling System.gc(), as I suspect that this is happening in one of my dependencies, not my own code.
I do realize I can disable explicit GC calls with -XX:-DisableExplicitGC, but I need to figure out where the calls are coming from. I have read here and here that this guy was able to change the Runtime class to log the stack trace when gc() is called. But I'm not clear on how to do this. Can someone point me in the right direction?
Get the source code for Runtime.java, and add code to the gc() method:
try {
throw new Exception("Who is the GC culprit?");
} catch (Exception e) {
e.printStackTrace();
}
After you compile the class, update rt.jar with the new class file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With