Tuning JVM (GC) for high responsive server application

前端 未结 7 2008
小蘑菇
小蘑菇 2020-12-13 03:08

I am running an application server on Linux 64bit with 8 core CPUs and 6 GB memory.

The server must be highly responsive.

After some inspection I found that

相关标签:
7条回答
  • 2020-12-13 03:52

    I think previous posters have missed something very obvious- the Perm Generation size is too low. If the system uses 200 to 400 MB as permanent generation- then it may be best to set Max Perm Gen to 400 MB. the PerGen size should also be set to the same value. You will then never run out of Permanent Generation Space.

    Currently- it looks like the JVM has to spend a lot of time moving objects in and out of Permanent Generation. This can take time. JVM tries to allocate contiguous memory areas to Java Objects- this speeds memory access due to hardware level features. In order to do that, it is very helpful to have plenty of buffer in memory. If Permanent Generation is almost full, newly discovered permanent objects must be split or existing objects must be shuffled. This is what triggers a full GC, as well as causes long full GC pauses.

    The question states that the Permanent Generation size has already been measured- if this has not been done, it should be measured using a tool. These tools process logs generated by the JVM with the verboseGC option turned on.

    All the mark and sweep options listed above- may not be needed with this basic improvement.

    People throw GC options as solutions without evaluating how mature they have proven to be in actual use.

    0 讨论(0)
提交回复
热议问题