Open 1a2s3d4f1 opened 3 years ago
Yes, I see behaviour you are talking about and it is confusing obviously. Current implementation overwrites Eden initial size by Eden max size if fully expanded heap is detected. @amicic @cedrichansen Is it intentional or some kind of side effect? Can it be improved?
That is expected behaviour. Whenever the heap size is equal to -Xmx value, eden will be set to -Xmnx value.
Whether this is desirable or not, is another question.
See below for basic idea behind eden sizing logic: https://github.com/eclipse/openj9/blob/339a3a6c0c2bfeab644ab8db8c67b6f91c3aa947/runtime/gc_vlhgc/SchedulingDelegate.cpp#L1078
We are aware of this as being a potential area of improvement, and are working on refining this logic.
Java -version output
Summary of problem
Use Balanced gc: When set -Xmx1024M -Xms1023M. The eden initial committed size is Xmns value. If set Xmx=Xms, the eden initial committed size is Xmnx value。
Use the app to test gc
java -Xmx1024M -Xms1024M -Xmns2M -Xmnx1000M -verbose:gc -Xverbosegclog -Xgcpolicy:balanced -jar app.jar 1
Diagnostic files
MC server gc log: Xmx=Xms:verbosegc.20210203.095225.2492.zip Xmx≠Xms:verbosegc.20210203.100915.2992.zip
Test gclog(Use this app): Xmx=Xms:verbosegc.20210203.102236.3028.zip Xmx≠Xms:verbosegc.20210203.102409.1604.zip