Currently, we are using the incremental garbage collector by adding -Xincgc
to the java command. In JDK 8 this switch is deprecated. So what's the equivalent replacement for it? -XX:+UseG1GC
?
Background: The application has a heap of 8GB and creates a lot of short living objects. I noticed that it often paused for some seconds to do garbage collection. Out of curiosity I added the -Xincgc
and found that the pauses were gone and overall performance improved ~4 times.
Unfortunately, I did not find any information about what type of garbage collector the -Xincgc
triggers. There's the CMS (Concurrent mark and sweep) and the new G1 (Garbage first). But what do I get with -Xincgc
?
-XX:+UseConcMarkSweepGC
and-XX:+UseG1GC
and see what I get. – Unhand