Reputation: 42050
I've got a memory-intensive Java 8
server application, which is also latency-sensitive. The application runs fine with 2.5G
heap but there are spikes of garbage collector
CPU usage once a day,
Now I wonder how to reduce the spikes. I probably can't reduce the memory usage or add more memory. I am Ok with the average CPU usage of GC
. I would like just to distribute the CPU load over time evenly. Is it possible ?
Upvotes: 4
Views: 1986
Reputation: 43052
First of all you should make sure that it's the CPU utilization that introduces latency and not stop-the-world pauses (e.g. Full GC if you're using CMS).
If Full GCs are not the issue then you can inspect the effective VM flags of your application by starting it with all present flags (present flags may affect the defaults of others) and then appending -XX:+PrintFlagsFinal
.
Look for ConcGCThreads
and see if reducing that number has the desired effect. It'll use less cores (but more walltime) for the concurrent cycles.
Upvotes: 1