Peak memory usage is within limits

I see that with -Xmx2g the peak memory reaches 1G and makes large collections (marksweep collector). With -Xmx3g it reaches 1.5G and makes basic collections. With -Xmg4g it reaches 2G and makes basic collections. But from here I tried to increase the maximum memory to 6G, 8G, 12G and all the time when the peak memory reaches 2G, it makes large collections.

How to use it outside of 2G? For this, I did not come across. Here is xms? Fo those -Xmx, I did -Xms half -Xmx.

I am using Jetty, Java 1.6.024.

UPDATE: Yes, I am using a 64 bit JVM. The JVM options I use are: -Xmx6g -Xms3g -XX: MaxPermSize = 256m The way I determine peak memory is to look at the memory graph in JConsole. It reaches 2G and falls (main collection). The old general reaches 1.5G max, and then a drop occurs.

Thanks, Prams.

+6
source share
1 answer

You have three areas of memory, eden, survivor and space occupied.

What I suspect is that either the enlarged or expanded spaces do not grow as the maximum size increases.

The reason these two regions matter is because when the filled space fills the Full GC, it fires (I suspect that this size is growing) When the eden space is full and there is no space for copying all the remaining objects in the space left, Full GC also starts.

If this is the cause of your problem, you are creating a very large number of medium-term objects, which can be a performance problem, unless you can reduce the number of objects created. An alternative is a larger specification that increases eden size.

Try -mx12g -XX:NewSize=10g - verbosegc

The last option will give you the dimensions of the individual spaces when they are cleaned.

+1
source

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


All Articles