Skip to content

-Xmn / -Xmns / -Xmnx

Sets the initial and maximum size of the nursery area when using the gencon garbage collection (GC) policy (-Xgcpolicy:gencon), and sets the size of eden when using the balanced garbage collection (GC) policy (-Xgcpolicy:balanced). These options are ignored if they are used with any other GC policy.

You can use the -verbose:sizes option to find out the value that is being used by the VM.

Syntax

Setting Effect Default
-Xmn<size> Equivalent to setting both -Xmns and -Xmnx Not set
-Xmns<size> Set initial size 25% of -Xms when using gencon and balanced policies
-Xmnx<size> Set maximum size 25% of -Xmx when using gencon, and 75% of -Xmx when using balanced

See Using -X command-line options for more information about the <size> parameter.

Restriction: If you try to set -Xmn with either -Xmns or -Xmnx, the VM does not start, returning an error.

Notes:

  • When using the balanced GC policy without specifying -Xmn or -Xmns, the GC may decide to shrink eden size below its initial size (25% of -Xms) if it determines that doing so will improve GC performance.
  • When using the balanced GC policy, specifying -Xmn/-Xmns/-Xmnx may affect balanced GC's ability to satisfy -Xgc:targetPausetime
  • Specifying -Xmn/-Xmns/-Xmnx may affect both gencon and balanced GC's ability to satisfy -Xgc:dnssexpectedtimeratiomaximum and -Xgc:dnssexpectedtimeratiominimum

To set the size of the tenure area of the heap when using gencon GC policy, see -Xmo/-Xmos/-Xmox.

See also