Description
From Tony:
Talking about array chunking in G1, we noticed a small difference in that code compared to what the other GCs (ParNew / PS) do. G1 uses the to-space length field to encode how much of the array has been scanned (i.e., the from-space length field is always correct). ParNew and PS use the from-space length field (and the to-space length field is always correct). I came across that issue when I was working on a change to periodically scan PLABs (for some profiling stuff I was working on) and in G1 some PLABs were unparseable because the length field of arrays could be incorrect (even if the PLAB is retired, it's possible that the length field is still incorrect given that other threads might still be working on that array).
The patch to change G1 to do what ParNew / PS also do is very small (and we've had it for a few months in our repo without any issues). Any chance of convincing you to also take it? I should be clear that the patch doesn't fix a correctness issue in G1; the code is correct as is. But it will bring G1 in line with the other two GCs and allow PLAB scanning during GC, if you want to do that...
Talking about array chunking in G1, we noticed a small difference in that code compared to what the other GCs (ParNew / PS) do. G1 uses the to-space length field to encode how much of the array has been scanned (i.e., the from-space length field is always correct). ParNew and PS use the from-space length field (and the to-space length field is always correct). I came across that issue when I was working on a change to periodically scan PLABs (for some profiling stuff I was working on) and in G1 some PLABs were unparseable because the length field of arrays could be incorrect (even if the PLAB is retired, it's possible that the length field is still incorrect given that other threads might still be working on that array).
The patch to change G1 to do what ParNew / PS also do is very small (and we've had it for a few months in our repo without any issues). Any chance of convincing you to also take it? I should be clear that the patch doesn't fix a correctness issue in G1; the code is correct as is. But it will bring G1 in line with the other two GCs and allow PLAB scanning during GC, if you want to do that...
Attachments
Issue Links
- relates to
-
JDK-8033922 G1: Back out 8033601 and go back to use the to-obj for chunked arrays.
-
- Resolved
-