Why is default Young Space so small?

Jon Masamitsu Jon.Masamitsu at Sun.COM
Fri Oct 16 18:26:52 UTC 2009


Please run the following command on both your systems
and send us the output.  This will show us more information
about the shape of the heap.

java -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails  <other-vm-flags> -version

It should show something like this.

java -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -Xmx512m -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)
Heap
 par new generation   total 14784K, used 263K [0xd8000000, 0xd9000000,
0xda000000)
  eden space 13184K,   2% used [0xd8000000, 0xd8041ec8, 0xd8ce0000)
  from space 1600K,   0% used [0xd8ce0000, 0xd8ce0000, 0xd8e70000)
  to   space 1600K,   0% used [0xd8e70000, 0xd8e70000, 0xd9000000)
 concurrent mark-sweep generation total 49152K, used 0K [0xda000000,
0xdd000000, 0xf8000000)
 concurrent-mark-sweep perm gen total 16384K, used 1465K [0xf8000000,
0xf9000000, 0xfc000000)



Shane Cox wrote On 10/16/09 10:58,:

> We recently moved one of our apps onto a new box running i7 processors
> (Nehalem).  After doing so, we noticed that the default Young Space
> allocation decreased substantially even though the new box has more
> processors and RAM ... and the JVM allocated more Parallel GC threads.
>
> Old machine:
> # mpstat
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys 
> wt idl
>   0    3   0   49  2355 1251  274    3   15    2    0   345    1   1  
> 0  99
>   1    3   0   48   188    0  284    4   17    2    0   359    1   0  
> 0  99
>   2    7   0   58   238  104  214    3   12    4    0   294    0   0  
> 0  99
>   3    2   0   29   127    3  144    2    8    1    0   257    0   0  
> 0  99
>
> # prtconf
> System Configuration:  Sun Microsystems  i86pc
> Memory size: 8192 Megabytes
>
> Start of GC log shows 59MB Young Space:
> 3.242: [GC 3.242: [ParNew: 52480K->6528K(*59008K*), 0.0221415 secs]
> 52480K->7228K(761472K), 0.0222595 secs]
>
>
>
> New machine:
> # mpstat
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys 
> wt idl
>   0  229   0  686   448  142  221    0    3   10    0   662    0   1  
> 0  99
>   1  181   0  593   114    0  188    0    1   10    0   574    0   0  
> 0  99
>   2   16   0   88   148    0  230    0    1    7    0   478    1   0  
> 0  99
>   3   16   0  199   161   21  215    0    0    9    0   532    0   0  
> 0  99
>   4    5   0   50   150    0  181    0    1    5    0   378    0   0  
> 0  99
>   5   21   0  125   147    2  184    0    0   10    0   523    0   0  
> 0  99
>   6    2   0  185   145    4  157    0    1    3    0   317    0   0  
> 0  99
>   7   16   0  114   152    7  128    0    0    5    0   367    0   0  
> 0 100
>   8    1   0   73   456  307   45    0    1    2    0    50    0   0  
> 0 100
>   9   15   0   86   148    0   12    0    0    1    0    89    0   0  
> 0 100
>  10    0   0   15   158    6   26    0    1    1    0    28    0   0  
> 0 100
>  11    2   0   31   151    0    9    0    0    1    0    36    0   0  
> 0 100
>  12    0   0    7   153    0   12    0    0    1    0    19    0   0  
> 0 100
>  13    1   0    8   153    0    4    0    0    0    0    55    0   0  
> 0 100
>  14    0   0   15   152    0    5    0    0    1    0    14    0   0  
> 0 100
>  15    1   0    6   153    0    7    0    0    1    0    21    0   0  
> 0 100
>
> # prtconf
> System Configuration:  Sun Microsystems  i86pc
> Memory size: 24566 Megabytes
>
> Start of GC log shows approx 15MB Young Space:
> 0.543: [GC 0.543: [ParNew: 13184K->1483K(*14784K*), 0.0029503 secs]
> 13184K->1483K(766400K), 0.0030164 secs] [Times: user=0.02 sys=0.00,
> real=0.00 secs]
>
>
> Java version is the same on both machines:
> java version "1.6.0_14"
> Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
> Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)
>
>
>
> I did a thread dump on the new machine to determine how many Parallel
> GC Threads (Gang Workers) are running.  Looks like 13:
> "Gang worker#0 (Parallel GC Threads)" prio=3 tid=0x08075400 nid=0x3
> runnable
> "Gang worker#1 (Parallel GC Threads)" prio=3 tid=0x08076400 nid=0x4
> runnable
> "Gang worker#2 (Parallel GC Threads)" prio=3 tid=0x08077800 nid=0x5
> runnable
> "Gang worker#3 (Parallel GC Threads)" prio=3 tid=0x08078c00 nid=0x6
> runnable
> "Gang worker#4 (Parallel GC Threads)" prio=3 tid=0x0807a000 nid=0x7
> runnable
> "Gang worker#5 (Parallel GC Threads)" prio=3 tid=0x0807b800 nid=0x8
> runnable
> "Gang worker#6 (Parallel GC Threads)" prio=3 tid=0x0807cc00 nid=0x9
> runnable
> "Gang worker#7 (Parallel GC Threads)" prio=3 tid=0x0807e000 nid=0xa
> runnable
> "Gang worker#8 (Parallel GC Threads)" prio=3 tid=0x0807f400 nid=0xb
> runnable
> "Gang worker#9 (Parallel GC Threads)" prio=3 tid=0x08080800 nid=0xc
> runnable
> "Gang worker#10 (Parallel GC Threads)" prio=3 tid=0x08081c00 nid=0xd
> runnable
> "Gang worker#11 (Parallel GC Threads)" prio=3 tid=0x08083000 nid=0xe
> runnable
> "Gang worker#12 (Parallel GC Threads)" prio=3 tid=0x08084400 nid=0xf
> runnable
>
>
>
> We use the CMS collector.  We don't specify a NewSize.  We like to run
> with defaults if possible.
>
>
> Any ideas why the JVM decreased the Young Space allocation by 3/4th
> even though the number of processors increased by 4x?
>
> Thanks





More information about the hotspot-gc-dev mailing list