BowerStudios.com

  • My Lab
  • Family
  • Friends
  • Professional
  • About
Home

Large Heaps for the JVM

daniel —Thu, 07/01/2010 - 9:27am

  • Java

Local copy of Big Heaps and Intimate Shared Memory (ISM)

Using a Large Heap

Heaps larger than 2GB are available starting with J2SE 1.3.1. These are options that can be useed to tune the use of memory by the JVM. The values given should not be taken as suggestions; best values for your application will vary and should be set by measurement.
-Xms3g -Xmx3g

This example sets the minimum and maximum total heap size to 3GB. The default maximum size is 64MB, but for many server applications it makes sense to be much larger. The g suffix may be replaced by m to measure in megabytes.
Ordinarily the JVM consumes as little memory as possible, starting with a heap of the minimum size specified by the -Xms flag, and adaptively growing as required up to the maximum specified by -Xmx. Setting these to the same value avoids being conservative, and will often improve startup time.

-XX:+AggressiveHeap
This option instructs the JVM to push memory use to the limit: the overall heap is more than 3850MB, the allocation area of each thread is 256K, the memory management policy defers collection as long as possible, and (beginning with J2SE 1.3.1_02) some GC activity is done in parallel.
Because this option sets heap size, do not use the -Xms or -Xmx options in conjunction with -XX:+AggressiveHeap. Doing so will cause the options to override each other's settings for heap size.

This option should be used with caution. Because it makes the JVM greedy with memory resources, it is not appropriate for many programs and makes it easier to run out of memory. For example, by using most of the 4GB address space for heap, some programs will run out of space for stack memory. In such cases -Xss may sometimes help by reducing stack requirements.

  • Log in to post comments

Navigation

  • Search
  • Recent content
  • Contact Me
  • Mail
  • Pass Hasher
  • Bower Studios Admin

Quotes

daniel —Mon, 02/26/2007 - 12:29pm

The chief function of the body is to carry the brain around.

—

Thomas A. Edison

  • Log in to post comments
  • daniel's quotes

Popular content

Last viewed:

  • List of music to check out
  • Sybase date function
  • The Six Stages of Debugging
  • Spring Security - Ant Path Style Syntax
  • Using Meld for viewing Git differences

Copyright 2022 Daniel Bower
  • My Lab
  • Family
  • Friends
  • Professional
  • About