Are good colors more common than bad colors?
raell at web.de
raell at web.de
Thu Mar 19 00:11:03 UTC 2020
Dear all,
on slide 35 of the presentation about ZGC by Per Lidén and Stefan Karlsson [1] it
is stated that most object references will have the good color. I tried to analyze
the probability of a non-root reference that is loaded for the first time for
having a good color:
A complete cycle has the three phases
1. remapping/marking
2. relocation
3. no gc action (till the next marking/remapping starts)
In phase 1 'good' means that the right marked bit is set. At the beginning of the phase
all non-root references are bad, at the end of the phase all are good. So, if a non-root
reference is selected randomly, it is good with a probability of about 50%.
In phases 2, 3 'good' means that the remapped bit is set. Since in these phases no remapping
is done (except by the load barrier), all non-root references are bad. So, if a non-root
reference is selected randomly, it is good with a probability of 0%.
Altogether, it seems to me, that in most parts of a cycle a non-root reference will have
the bad color.
Of course, I my be missing something. Therefore, I would be interested in an argument, why
most object references are expected to have a good color.
Thank you very much!
Ralph
[1] http://cr.openjdk.java.net/~pliden/slides/ZGC-Jfokus-2018.pdf
More information about the zgc-dev
mailing list