-
Enhancement
-
Resolution: Unresolved
-
P3
-
11, 17, 18, 19
The parameter -XX:MinRAMPercentage is used to set the maximum heap size for small heaps (<200M).
This is a bit confusing as it does not correspond to what Initial/MaxRAMPercentage does.
E.g. when the VM is run with -XX:MinRAMPercentage=X -XX:InitialRAMPercentage -XX:MaxRAMPercentage=X -XX:+AlwaysPreTouch -Xlog:pagesize shows
[0.030s][info][pagesize] Heap: min=8M max=3214M base=0x0000000737200000 page_size=4K size=3214M
(note the "min=" value!)
This means while the VM does start up with the correct initial and max RAM usage (can be verified with pmap), it does not set the minimum heap size.
So the functionality to set minimum heap size based on a percentage of the heap is missing; and that has been the case forever as MinRAMPercentage has always been defined and implemented that way.
However the existing functionality also has some merit; also changing the meaning of it at this point, after years of being documented this way is basically a no-go.
Internal discussion showed that even the original names are not super-obvious: does not indicate percentage of what (e.g. percentage of max heap size, percentage of ram) where both use cases are valid.
Some suggestions brought up during discussion are:
* allow a % sign for specifying Min/Initial/MaxHeapSize: using this character may be an issue with shell scripts, also it does not tell percentage of what either
* use "p" as percentage, but that conflicts with petabytes
Or a complete new set of options
* something like *HeapPercentageOfRAM could be done
* or -XX:MaxHeapSize=PercentOfRAM(25) which also describes the intent, which could be extended to something like -XX:MinHeapSize=PercentOfMaxHeapSize(25)
SoftMaxHeapSize should also be considered in these thoughts.
Cross-compatibility with the old options should be considered as well; an easy way out would be erroring out if both the new and old options are set.
This is a bit confusing as it does not correspond to what Initial/MaxRAMPercentage does.
E.g. when the VM is run with -XX:MinRAMPercentage=X -XX:InitialRAMPercentage -XX:MaxRAMPercentage=X -XX:+AlwaysPreTouch -Xlog:pagesize shows
[0.030s][info][pagesize] Heap: min=8M max=3214M base=0x0000000737200000 page_size=4K size=3214M
(note the "min=" value!)
This means while the VM does start up with the correct initial and max RAM usage (can be verified with pmap), it does not set the minimum heap size.
So the functionality to set minimum heap size based on a percentage of the heap is missing; and that has been the case forever as MinRAMPercentage has always been defined and implemented that way.
However the existing functionality also has some merit; also changing the meaning of it at this point, after years of being documented this way is basically a no-go.
Internal discussion showed that even the original names are not super-obvious: does not indicate percentage of what (e.g. percentage of max heap size, percentage of ram) where both use cases are valid.
Some suggestions brought up during discussion are:
* allow a % sign for specifying Min/Initial/MaxHeapSize: using this character may be an issue with shell scripts, also it does not tell percentage of what either
* use "p" as percentage, but that conflicts with petabytes
Or a complete new set of options
* something like *HeapPercentageOfRAM could be done
* or -XX:MaxHeapSize=PercentOfRAM(25) which also describes the intent, which could be extended to something like -XX:MinHeapSize=PercentOfMaxHeapSize(25)
SoftMaxHeapSize should also be considered in these thoughts.
Cross-compatibility with the old options should be considered as well; an easy way out would be erroring out if both the new and old options are set.
- links to
-
Review openjdk/jdk/7755