RFR: 8252514: ZGC: Physical memory splitting is broken
stefan.karlsson at oracle.com
Mon Aug 31 11:51:22 UTC 2020
Please review this patch to fix physical memory splitting in ZGC.
JDK-8247759 changed the implementation to use a GrowableArray. One part
of that patch cached the value of _segments.at(index) inside
commit_segment and uncommit_segment. This is incorrect, since resizing
the array causes the backing memory to be deallocated, causing the the
local copy to point to garbage.
I've reverted that change, and now always call _segments.at(index) instead.
This was found while experimenting with physical memory allocations that
were likely to fail. I've verified that the failures stops reproducing
with this patch.
More information about the hotspot-gc-dev