Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6862534
Votes 0
Synopsis -XX:NewRatio completely ignored when combined with -XX:+UseConcMarkSweepGC
Category hotspot:garbage_collector
Reported Against
Release Fixed hs16(b08), 6u18(b01) (Bug ID:2181929) , 7(b71) (Bug ID:2182187)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs
Submit Date 21-JUL-2009
Description
FULL PRODUCT VERSION :
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode)

FULL OS VERSION :
Linux strongbad 2.6.28-13-generic #44-Ubuntu SMP Tue Jun 2 07:55:09 UTC 2009 x86_64 GNU/Linux

 customer  Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
-XX:NewRatio does not work at all in combination with -XX:+UseConcMarkSweepGC

The docs don't list any limitations on the use of NewRatio - in fact, they suggest that it be used in certain cases.

http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html

With default GC, and NewRatio set to 3, and MaxHeap set to 600 MB, I would expect my new generation space to be somewhere around 200 MB.

Working Example:

 =>/opt/java/jre_x32_1.6.0_14/bin/java -server -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:NewRatio=3 -Xms600M -Xmx600M -version

-XX:MaxHeapSize=629145600 -XX:NewRatio=3 -XX:ParallelGCThreads=2 -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseParallelGC
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)
Heap
 PSYoungGen      total 134400K, used 2304K [0xeaa40000, 0xf4040000, 0xf4040000)
  eden space 115200K, 2% used [0xeaa40000,0xeac80010,0xf1ac0000)
  from space 19200K, 0% used [0xf2d80000,0xf2d80000,0xf4040000)
  to   space 19200K, 0% used [0xf1ac0000,0xf1ac0000,0xf2d80000)
 PSOldGen        total 460800K, used 0K [0xce840000, 0xeaa40000, 0xeaa40000)
   customer  space 460800K, 0% used [0xce840000,0xce840000,0xeaa40000)
 PSPermGen       total 16384K, used 1431K [0xca840000, 0xcb840000, 0xce840000)
   customer  space 16384K, 8% used [0xca840000,0xca9a5c88,0xcb840000)

I end up with 134400K - perfectly reasonable.  The ratio is 134400 / 460800 = .29 - just shy of the 1:3 ratio I was asking for.

Failing example - same command as above, except now, adding CMS:

 =>/opt/java/jre_x32_1.6.0_14/bin/java -server -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:NewRatio=3 -Xms600M -Xmx600M -XX:+UseConcMarkSweepGC -version

-XX:MaxHeapSize=629145600 -XX:MaxNewSize=33554432 -XX:MaxTenuringThreshold=4 -XX:NewRatio=3 -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
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)
Heap
 par new generation   total 29504K, used 524K [0xca770000, 0xcc770000, 0xcc770000)
  eden space 26240K,   2% used [0xca770000, 0xca7f3340, 0xcc110000)
  from space 3264K,   0% used [0xcc110000, 0xcc110000, 0xcc440000)
  to   space 3264K,   0% used [0xcc440000, 0xcc440000, 0xcc770000)
 concurrent mark-sweep generation total 581632K, used 0K [0xcc770000, 0xeff70000, 0xeff70000)
 concurrent-mark-sweep perm gen total 16384K, used 1431K [0xeff70000, 0xf0f70000, 0xf3f70000)

And I get 29504K.  29504 / 581632 = .05 = or a ratio of 1:20.

You will also notice from the output of PrintCommandLineFlags that the VM has decided to set  -XX:MaxNewSize=33554432, even though I did not specify it on the command line.


Same broken behaviour on Linux and Windows.




THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See description.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Use the NewRatio flag as documented.


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
-XX:NewSize=xx works as expected.
Posted Date : 2009-07-21 07:17:15.0
Work Around
N/A
Evaluation
If NewRatio is set on the command line, skip the ergonomic setting of the
young gen maximum size and let the CollectorPolicy set the generation sizes.
Posted Date : 2009-07-27 21:47:18.0

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/061cd4d965fc
Posted Date : 2009-08-03 05:31:53.0

http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/061cd4d965fc
Posted Date : 2009-08-06 03:39:54.0
Comments
  
  Include a link with my name & email   

Submitted On 20-AUG-2009
Seeing this as well on JDK 1.6.0_14.  One workaround is to use XX:NewSize or XX:MaxNewSize.  These are not ignored.

However, this is not easily done in many environments, including ours.



PLEASE NOTE: JDK6 is formerly known as Project Mustang