You can set the maximum heap size as a percentage of total memory in a small memory amount environments with:
-XX:MinRAMPercentage=x, where x is the desired percentage of heap memory between 0 and 100 of type double.
Will set the max heap size to 15.2654 and 30%:
This Oracle HotSpot option, unlike it’s name, can be used to specify the maximum size of the Java heap for JVM running on a small amount of memory as a percentage of the total memory available to the JVM. It sets the maximum amount of memory that the JVM may use for the Java heap before applying ergonomics heuristics as a percentage of the maximum amount determined as described in the -XX:MaxRAM option for small heaps. A small heap is a heap of approximately 125 MB. The default value is 50 percent.
Default value is 50%.
Accepts only numeric double values from 0 to 100
TODO link Xmx, Xms, UseContainerSupport, InitialRAMPercentage, MaxRAM
If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.
Edit your Comment