openjdk java 内存参数

    -Xmaxjitcodesize=size
           Specifies the maximum code cache size (in bytes) for JIT-compiled code. Append the letter k or K to indicate kilobytes, m or M to indicate
           megabytes, g or G to indicate gigabytes. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
           -XX:-TieredCompilation, then the default size is 48 MB:

               -Xmaxjitcodesize=240m

           This option is equivalent to -XX:ReservedCodeCacheSize.


    -Xmnsize
       Sets the initial and maximum size (in bytes) of the heap for the young generation (nursery). Append the letter k or K to indicate kilobytes, m
       or M to indicate megabytes, g or G to indicate gigabytes.

       The young generation region of the heap is used for new objects. GC is performed in this region more often than in other regions. If the size
       for the young generation is too small, then a lot of minor garbage collections will be performed. If the size is too large, then only full
       garbage collections will be performed, which can take a long time to complete. Oracle recommends that you keep the size for the young
       generation between a half and a quarter of the overall heap size.

       The following examples show how to set the initial and maximum size of young generation to 256 MB using various units:

           -Xmn256m
           -Xmn262144k
           -Xmn268435456

       Instead of the -Xmn option to set both the initial and maximum size of the heap for the young generation, you can use -XX:NewSize to set the
       initial size and -XX:MaxNewSize to set the maximum size.

    -Xmssize
       Sets the initial size (in bytes) of the heap. This value must be a multiple of 1024 and greater than 1 MB. Append the letter k or K to indicate
       kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes.

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

           -Xms6291456
           -Xms6144k
           -Xms6m

       If you do not set this option, then the initial size will be set as the sum of the sizes allocated for the old generation and the young
       generation. The initial size of the heap for the young generation can be set using the -Xmn option or the -XX:NewSize option.

    -Xmxsize
       Specifies the maximum size (in bytes) of the memory allocation pool in bytes. This value must be a multiple of 1024 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 at
       runtime based on system configuration. For server deployments, -Xms and -Xmx are often set to the same value. See the section "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 size of allocated memory to 80 MB using various units:

           -Xmx83886080
           -Xmx81920k
           -Xmx80m

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


    -XX:MaxDirectMemorySize=size
           Sets the maximum total size (in bytes) of the New I/O (the java.nio package) direct-buffer allocations. Append the letter k or K to indicate
           kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes. By default, the size is set to 0, meaning that the JVM chooses the size
           for NIO direct-buffer allocations automatically.

           The following examples illustrate how to set the NIO size to 1024 KB in different units:

               -XX:MaxDirectMemorySize=1m
               -XX:MaxDirectMemorySize=1024k
               -XX:MaxDirectMemorySize=1048576


    -XX:ObjectAlignmentInBytes=alignment
           Sets the memory alignment of Java objects (in bytes). By default, the value is set to 8 bytes. The specified value should be a power of two,
           and must be within the range of 8 and 256 (inclusive). This option makes it possible to use compressed pointers with large Java heap sizes.

           The heap size limit in bytes is calculated as:

           4GB * ObjectAlignmentInBytes

           Note: As the alignment value increases, the unused space between objects will also increase. As a result, you may not realize any benefits from
           using compressed pointers with large Java heap sizes.


    -XX:InitialHeapSize=size
           Sets the initial size (in bytes) of the memory allocation pool. This value must be either 0, or a multiple of 1024 and greater than 1 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 at
           runtime based on system configuration. See the section "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 size of allocated memory to 6 MB using various units:

               -XX:InitialHeapSize=6291456
               -XX:InitialHeapSize=6144k
               -XX:InitialHeapSize=6m

           If you set this option to 0, then the initial size will be set as the sum of the sizes allocated for the old generation and the young
           generation. The size of the heap for the young generation can be set using the -XX:NewSize option.


    -XX:MaxHeapSize=size
           Sets the maximum size (in byes) of the memory allocation pool. This value must be a multiple of 1024 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 at runtime based on system
           configuration. For server deployments, -XX:InitialHeapSize and -XX:MaxHeapSize are often set to the same value. See the section "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 size of allocated memory to 80 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 overhead 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.

    -XX:MaxMetaspaceSize=size
           Sets the maximum amount of native memory that can be allocated for class metadata. By default, the size is not limited. The amount of metadata
           for an application depends on the application itself, other running applications, and the amount of memory available on the system.

           The following example shows how to set the maximum class metadata size to 256 MB:

               -XX:MaxMetaspaceSize=256m
 

猜你喜欢

转载自blog.csdn.net/hknaruto/article/details/107511566