-XX:DefaultMaxRAMFraction=VALUE

Sun's 1.5 JVM has some heap size configuration parameters that are not

available in their 1.4 and earlier JVMs.

For Sun's 1.5 JVM (not 1.4), there is the following documentation on

sun's website:

http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html#0.0.0.0.%20Heap%20Size%7Coutline

If not otherwise set on the command line, the sizes of the initial

heap and maximum heap are calculated based on the size of the physical

memory. If phys_mem is the size of the physical memory on the

platform, the initial heap size will be set to phys_mem /

DefaultInitialRAMFraction. DefaultInitialRAMFraction is a command line

option with a default value of 64.

Similarly the maximum heap size will be set to phys_mem /

DefaultMaxRAM.

DefaultMaxRAMFraction has a default value of 4.

<end of fragment>

Does the second to the last line, in the above fragment, have a typo?

Shouldn't it read:

"Similarly the maximum heap size will be set to phys_mem /

DefaultMaxRAMFraction"

I am thinking it's a typo because I just looked at:

http://java.sun.com/developer/JDCTechTips/2005/tt0216.html

You can further control the heap size through the following new

options:

-XX:DefaultInitialRAMFraction=VALUE

-XX:DefaultMaxRAM=VALUE

-XX:DefaultMaxRAMFraction=VALUE

DefaultInitialRAMFraction has a default value of 64.

DefaultMaxRAMFraction has a default value of 4. The default initial

size of the heap is the size of physical RAM divided by

DefaultInitialRAMFraction. You can either set the maximum size

explicitly with DefaultMaxRAM

or use DefaultMaxRAMFraction to set the value proportionally.

Also, why did they create the "-XX:DefaultMaxRAM" option, when there is

already the

"-Xmx" option that is available in 1.5 (and was also available in

earlier JVMs) ? I can see the reason for the

"-XX:DefaultInitialRAMFraction" and the "-XX:DefaultMaxRAMFraction"

options, but the "XX:DefaultMaxRAM" option seems redundant with the

"-Xmx" option.

You would think there would be better documentation of these options.

[2272 byte] By [sbflynn376@yahoo.coma] at [2007-11-26 15:54:58]
# 1

Thanks for the careful proofreading. That's a typo, as you suspected. We'll get it fixed.

For the intensely curious, the code that does this is at http://12.101.252.19/hotspot/xref/src/share/vm/runtime/arguments.cpp#1249. (It takes some getting used to that variables that begin with capital letters are command line parameters.)

The reason for -XX:DefaultMaxRAMFraction= is that some people wanted to specify the heap as a fraction of the physical memory on the machine, not as an absolute -Xmx value. That way the same command will run with larger heaps on larger machines.

PeterKesslera at 2007-7-8 22:15:36 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Hello,

Can you clarify which of the following takes precedence if all 3 are set when an app is called?

(1) -Xmx

(2) -XX:DefaultMaxRAM=VALUE

(3) -XX:DefaultMaxRAMFraction=VALUE

Also, what is the default garbage collector for the Sun Java Plugin? Is it serial or throughput?

Are there any specific guidelines for JVM parameters for applets? When to use the "serial" garbage collector versus the "Throughput" garbage collector versus the "concurrent low pause" garbage collector? (

Also, the whitepaper is confusing in that the -XX:DefaultMaxRAM and -XX:DefaultMaxRAMFraction parameters are only discussed within section 5.2, which is devoted to the "Throughput" garbage collector. Does this mean that those parameters are not operative, when one is running with the "serial" garbage collector or the "concurrent low pause" garbage collector?

thanks in advance!

hjsa983qurfa at 2007-7-8 22:15:36 > top of Java-index,Java HotSpot Virtual Machine,Specifications...