RFR (XS): 8232951: TestG1ParallelPhases.java fails with phase NonYoungFreeCSet not found
Thomas Schatzl
thomas.schatzl at oracle.com
Thu Oct 24 11:50:27 UTC 2019
Hi all,
can I have reviews for this small fix to the
TestG1ParallelPhases.java test so that it is more robust?
As far as I can tell from the failure and program execution the test
tries to force mixed gcs expecting particular JFR events.
In particular the failure is about the failure to get the
"NonYoungFreeCSet" parallel phase.
This event is sent when freeing the remembered sets of an old region
(during mixed gc).
However due to how the test is set up, while it successfully forces
mixed gcs, it does not make sure that there ever is waste in old regions
(even if the test sets the threshold to 0.0). In my unsuccessful
reproduction tries I noticed that the actual waste at the start of mixed
gc is very close to 0.0 (or even 0.0) in all mixed gcs (often something
like 8 bytes to reclaim only in total), and that while the threshold
forces a mixed gc, sometimes during region selection no old gen regions
are selected, and so no freeing of an old gen region and the JFR event
occurs.
This seems to be correct to me, so I changed the test a little to be
sure to actually generate waste.
The alternative would be to send a fake "NonYoungFreeCSet" parallel
phase jfr event in the collector, but I do not like sending fake events
for the sake of a test.
I also added some useful logging options in case this occurs again in
CI, and curbed the amount of (young only) GCs performed.
Note that I did not manage to reproduce the issue myselves - the only
occurrence has been a month ago that has been linked to a wrong bug.
Obviously the failure (that we do not get any reclaimable old gen
region) depends on a lot of other factors.
CR:
https://bugs.openjdk.java.net/browse/JDK-8232951
Webrev:
http://cr.openjdk.java.net/~tschatzl/8232951/webrev/
Testing:
400 runs of the changed test without issues
Thanks,
Thomas
More information about the hotspot-gc-dev
mailing list