The problem is like this.
We are using CMS and experiencing concurrent mode failure (takes about 15 seconds). Using JRE 8.
Already using UseCMSInitiatingOccupancyOnly and CMSInitiatingOccupancyFraction (80%). Not using CMSScavengeBeforeRemark.
The allocation pattern is like this:
Lots of short-lived objects are allocated. So we are using a large young generation, 2GB. Survivor space not tuned. MaxTenuringThreshold set to 15. Every a few hours CMS kicks in.
Old generation is 4GB. Memory usage is high. After each collection, the old generation has about 30% free space. Unfortunately no more memory available. We are planning to modify the program to make it use less memory, but this takes time.
Usually the program doesn't have much work to do, but every a few hours (we can't predict when) we get really busy. And a 15-second STW is just too long.
So my question is:
How can we tune CMS for our program?
Should I increase old generation (and decrease young)?
Should I adjust Survivor?
Should I change CMSInitiatingOccupancyFraction?
Will G1GC help?