Why is the total JVM reserved memory larger than -Xmx?

JVM options:

-Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8

As expected, the JVM will allocate almost 20 MB of memory to the JVM heap.

But please see the following GC detail:

PSYoungGen total 9216K , used 4612K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
eden space 8192K , 56% used [0x00000000ff600000.0x00000000ffa812d8,0x00000000ffe00000)
from 1024K space , 0% is used [0x00000000fff00000,0x00000000fff00000,0x0000000100000000)
in 1024K space , 0% is used [0x00000000ffe00000,0x00000000ffe00000,0x00000000fff00000)
PSOldGen total 10240K , used 8192K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)
object space 10240K, 80% used [0x00000000fec00000,0x00000000ff400020,0x00000000ff600000) PSPermGen total 21248K , used 3033K [0x00000000f9a00000, 0x00000000faec0000, 0x00000000fec00000)
object space 21248K, 14% used [0x00000000f9a00000,0x00000000f9cf6708,0x00000000faec0000)

The size of the younger generation meets the expectations of -Xmn . The ratio of the sizes of space for space and space for surviving in the young generation, as expected, for the option -XX:SurvivorRatio=8 . But it seems that in total the JVM allocates almost 40 MB of memory, so this is strange. Why is the total distributed JVM memory larger than -Xmx ?

Env:

OS: win7 64 bit

JDK: build 1.6.0_43-b01 64bit

+6
source share
1 answer

-Xmx sets the maximum size of the HotSpot Object-Heap, which is the sum of YoungGen (Eden + Survivor-spaces) and OldGen, and this is about 20 MB. The permanent generation is located outside this heap in a separate memory area, which is controlled using the -XX:MaxPermSize .

+11
source

All Articles