Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of the -XX:NewRatio and -XX:OldSize JVM flags?

Tags:

I am starting my java app with the following command line :

java -XX:+PrintCommandLineFlags -verbose:gc -XX:+PrintGCDetails \      -XX:+UseConcMarkSweepGC -jar start.jar 

The JVM enables the following options:

-XX:MaxNewSize=87244800 -XX:MaxTenuringThreshold=4 -XX:NewRatio=7 -XX:NewSize=21811200 -XX:OldPLABSize=16 -XX:OldSize=65433600 -XX:+PrintCommandLineFlags -XX:+PrintGC -XX:+PrintGCDetails -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC 

Can anyone explains me the meaning of NewRatio and OldSize ? In particular OldSize is the initial size of the tenured generation ?

like image 270
dacanalr Avatar asked Jul 28 '11 13:07

dacanalr


People also ask

What does JVM arguments mean?

JVM arguments are flags that are passed to the Java Virtual Machine at the time the application is launched. On Linux or Mac machines, they can be provided through the JAVA_OPTS setting in the whd.conf file.

What are the JVM options?

There are three types of options that you can add to your JVM, standard, non-standard and advanced options. If you apply an advanced option, you always precede the option with -XX: . Similarly if you're using a non-standard option, you'll use -X . Standard options don't prepend anything to the option.

What is the meaning of JVM?

What is Java Virtual Machine (JVM)? Java Virtual Machine, or JVM, loads, verifies and executes Java bytecode. It is known as the interpreter or the core of Java programming language because it executes Java programming.


2 Answers

The NewRatio is the ratio of old generation to young generation (e.g. value 2 means max size of old will be twice the max size of young, i.e. young can get up to 1/3 of the heap).

The OldSize is not one of the documented options, but I assume it's the size of the tenured space http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

like image 93
Peter Lawrey Avatar answered Sep 28 '22 13:09

Peter Lawrey


Since NewRatio is already well explained, the following should help with OldSize.

Here, OldSize => default size of the tenured generation. This is the default size of tenured till the time ergonomics comes into play.

like image 35
Khanna111 Avatar answered Sep 28 '22 12:09

Khanna111