Heap memory configuration for Java virtual machines

Source: Internet
Author: User
Tags java se oracle solaris

Official Document Address: https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

The following records are received:

-xx:maxheapsize=Size

Sets the maximum size (in byes) of the memory allocation pool. This value must is a multiple of 1024x768 and greater than 2 MB. Append the Letter k  or k  to indicate kilobytes,  m  or m  to indicate megabytes,  g  or g  to indicate gigabytes. The default value is chosen in runtime based on system configuration. For server Deployments, -xx:initialheapsize  and -XX: Maxheapsize  are often set to the same value. See the sections "Ergonomics" IN  Java SE HotSpot Virtual machine Garbage Collection Tuning guide  at  ; http://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/index.html .

The following examples show how to set the maximum allowed a size of allocated memory to a MB using various units:

-xx:maxheapsize=83886080-xx:maxheapsize=81920k-xx:maxheapsize=80m

On Oracle Solaris 7 and Oracle Solaris 8 SPARC platforms, the upper limit for this value is approximately 4,000 MB minus O Verhead amounts. On Oracle Solaris 2.6 and x86 platforms, the upper limit is approximately 2,000 MB minus overhead amounts. On Linux platforms, the upper limit is approximately 2,000 MB minus overhead amounts.

The -XX:MaxHeapSize option is equivalent to -Xmx .

This is roughly the following:

    1. The maximum heap memory setting on a Linux operating system is 2 G.
    2. -XX:MaxHeapSizeequivalent to-Xmx
    3. This value must be a multiple of 1024 and greater than 2 MB

Heap memory configuration for Java virtual machines

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.