-O flag is not taken into account when calculating how much memory to retain
Related to #19359 (closed)
The size of the old generation is the maximum of oldGenFactor (-F) * live_bytes
and -O
The calculation about how much memory to retain only takes into account the -F
factor rather than also -O
.