JVM Heap value

client mode

default heap maximum calculated: If the physical memory is less than 192M, then half of the maximum heap physical memory. If physical memory is greater than or equal 1G, then the maximum value of the physical memory heap 1/4, i.e. 256M .. For example: the physical memory of the computer 128M, then the maximum heap of 128/2 = 64M. If the physical memory of the computer 1G, then the maximum heap of 1G / 4 = 256M. It should be noted that, although we specifies the maximum heap memory, but that does not mean jvm real use so much memory, unless your application creates more than enough to reach such a target memory space.

The default minimum heap calculated: Minimum not less than 8M, if physical memory is greater than or equal 1G, then the default value of 1/64 physical memory, i.e., 1024/64 = 16M. The minimum heap memory will be initialized when jvm startup.

The default maximum value is the new generation heap size of 1/3 of the total .

 

Server JVM stack default minimum and maximum calculated

In addition to jvm larger, heap of work and client mode heap size can be set to run similar. For 32-bit virtual machine, if the physical memory is greater than or equal 4G, the heap memory can reach 1G. For 64-bit virtual machine, heap is not limited. If the physical memory is more than 128G, then the heap can be up to 32G.

 

How to set the size of the heap

-Xms: initial value setting heap

-Xmx: setting the maximum heap

If the application needs to clear large and small memory, you can put -Xms and -Xmx can be set to the same.

 

 

https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/parallel.html#default_heap_size

Guess you like

Origin www.cnblogs.com/lzmrex/p/12102454.html