What is the purpose of -XX: MinHeapFreeRatio and -XX: MaxHeapFreeRatio

Please tell me about the objectives of these options. After googling, I think: MinHeapFreeRatio reports that "the specified minimum percentage of space will be guaranteed to be free in heap memory after GC" and MaxHeapFreeRatio reports that "no more than the specified percentage of space will be free in heap memory after GC" [if excess free memory exceeds the specified percentage, this memory will be returned to the OS)

When I tried these parameters with 10 as a value for both, even where there is more than 80% free heap memory, it was not released back to the OS.

Read more: Java HotSpot (TM) 64-bit server VM (1.5.0_15-b04, mixed mode) ParallelGC (otherwise known as the bandwidth collector, which is the default collector in the class class VM) i indicated -Xms50M and -Xmx1000M as arguments jvm OS: Windows 7 Professional (8 GB of memory 64-bit OS)

Note. I just tried using SerialGC, these minimum and maximum heap parameters were ignored.

+8
java heap
source share
1 answer

Java very rarely releases memory back to the OS. Generally speaking, applications use more memory over time, not less. Are you sure that memory is so limited that you need it? Are you sure that you are checking resident memory, and not the size of virtual memory, which will be approximately 1.2 GB in your case.

+2
source share

All Articles