How to reduce peaks in the use of the HZ processor

I have a server application Java 8with heavy memory, which is also sensitive to delays. The application works fine with a bunch 2.5G, but there are peaks in garbage collectorCPU usage once a day,

Now I am wondering how to reduce the spikes. I probably cannot reduce memory usage or add more memory. I'm fine with average CPU usage GC. I would just like to distribute the load on the processor in time evenly. Is it possible?

+4
source share
1 answer

First of all, you need to make sure that it is CPU usage that introduces latency rather than stopping the pause (for example, Full GC if you use CMS).

If full GCs are not a problem, you can check the effective VM flags of your application by running it with all existing flags (existing flags can affect the default values ​​of others), and then add -XX:+PrintFlagsFinal.

Find ConcGCThreadsand make sure that reducing this number has the desired effect. For parallel loops, it will use fewer cores (but more wall ones).

+1
source

Source: https://habr.com/ru/post/1614256/


All Articles