As #1428 refers to the support for -Xmx,-Xms in terms of percentages, It might be a good step to take in specifying the new area limits -Xmn/-Xmnx/-Xmns in terms of percentages.
The support can be of two ways like enhancing the current options to work with percentages or a respective -XX option for each of them which can be used to specify the limits in percentages.
Note: Currently -Xmnx/-Xmns are 25% of -Xmx/-Xms respectively (if not given statically by user), by adding this support the user can specify the values in terms of percentages which will be more helpful in container environments.
FYI - @dinogun @ashu-mehra @dmitripivkine @amicic
HotSpot has Options -XX:NewSize and -XX:MaxNewSize equivalents for -Xmn and -Xmnx.
Link : https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/sizing.html
Will it be a good idea to have those opts in OpenJ9 and make them to accept both static size and percentages as well to have HotSpot compatibility with an enhancement of support for expressing in percentages ?
@dmitripivkine @dinogun @DanHeidinga @ashu-mehra
Re adding -XX:NewSize and -XX:MaxNewSize note https://github.com/eclipse/openj9/issues/2834#issuecomment-424097324
The error is only if we specify -Xmn and -Xmnx / -Xmns. I'm thinking if we could map -XX:NewSize to -Xmns and -XX:MaxNewSize to -Xmnx.
In a view that the minimum new area size ( -XX:NewSize of hotspot ) is the initial new area size ( -XX:NewSize of OpenJ9 equivalent to -Xmns ).
Please correct me if the view i had was wrong.
The concept is correct. The reality is that I tried to do these mappings and something weird happened. It needs further investigation, and nobody has looked at it yet.
@bharathappali I think is the correct change (for NewSize and MaxNewSize) and was on my list of options to add. I think the mapping you suggested is correct and should work. Feel free to suggest a PR if you want to pursue this work.
@pshipton @charliegracie I would like to take it up. To start off with i'll try to make these options accept static sizes. Later on, will it be fine to implement the ability for these options to take percentages as well (along with static sizes) ?
Given the precedent of https://www.eclipse.org/openj9/docs/xxinitialrampercentage/, we probably want new options to set the values as percentages.
Here is the problem.
The change: https://github.com/pshipton/openj9/commit/15366359b6cbe73b5b0a06f99cc8bf0664efae63
This is what happens:
bin/java -XX:NewSize=20m
JVMJ9GC031E -Xmn and -Xmns cannot both be specified
Given the precedent of https://www.eclipse.org/openj9/docs/xxinitialrampercentage/, we probably want new options to set the values as percentages.
Yeah sure will add new options for percentages. Will -XX:NewSizePercentage and -XX:MaxNewSizePercentage be the apt names for the options for percentages values ?
Will -XX:NewSizePercentage and -XX:MaxNewSizePercentage be the apt names
Works for me.
Is this issue to add new percentage based options (-XX:NewSizePercentage and -XX:MaxNewSizePercentage) or to support Hotspot's (-XX:NewSize and -XX:MaxNewSize) options?
Or maybe do both?
@DanHeidinga this issue is primarily for adding percentage based options, Idea is that we can have these options along with hotspot compatible options.