Memory Pools Information

Hi,

I am reading the Garbage Collection with 5.0 JVM in the following link

http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html

I am looking at graph in section 3. Is it correct of me to say that?

PS Eden Space + PS Survivor Space = Young Generation (From graph)

PS Old Gen = Tenured (From graph)

PS Perm Gen = Perm (From graph)

Thanks in advance,

Mustafa

[413 byte] By [ACaycia] at [2007-11-27 3:41:26]
# 1
That's correct!Note: PS Eden Space + PS Survivor Spaces = Young Generation (From graph) (there are 2 Survivor Spaces)Nick.
nicolasmichaela at 2007-7-12 8:44:56 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Thanks Nick.

I am trying to understand the correlation between -XX:NewRatio and PS Eden Space. It is my understanding that for example if I set -XX:NewRatio = 3, then the total size of young generation is 1/4 of total heap usage. Similarly if I set -XX:NewRatio =2, then affectively I can increase the young generation size. The total size of young generation would be 1/3 of total heap usage.

Also how should the -Xms and -Xmx be set? Some materials suggest that they should be set to equal. If so, why?

Thanks,

Mustafa

ACaycia at 2007-7-12 8:44:56 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

Your understanding regarding the NewRatio is correct.

NewRatio specifies the relation between new and old generation. A NewRatio of 4 would mean that New : Old = 1 : 4. With a total heap size of 500MB, this would lead to a 100 MB new generation.

Eden ist just a part of the new generation. You have to subtract the sizes of the survivor spaces, which can be specified with -XX:SurvivorRatio=n where n is the relation between one survivor space and the eden. Setting SurvivorRatio to 8 at a 100 MB new generation would mean two 10 MB survivor spaces and one 80 MB eden space.

Setting Xms equal to Xmx avoids resizing of the heap. It is often recommended by Java users (however, in our environment prefer not to set them equal...). Reasons for setting it equal may be that you need the virtual address space of Xmx anyway, no matter how large your actual heap size is. Resizing of generation can be quite a performance issue in some scenarios. Otherwise, once your application heap grows from Xmx to Xmx, it will not shrink anyway, so if you know how much heap you need, to can avoid increasing your heap in steps up to Xmx by giving the application Xmx=Xmx at startup.

Also interesting is setting the young generation explicitly (independent of the old generation) by -XX:NewSize=n and -XX:MaxNewSize=n. This helps if you set Xms != Xmx and still want a fix new generation.

Nick

nicolasmichaela at 2007-7-12 8:44:56 > top of Java-index,Java HotSpot Virtual Machine,Specifications...