RFR: 8252514: ZGC: Physical memory splitting is broken
erik.osterlund at oracle.com
Mon Aug 31 20:13:40 UTC 2020
> On 31 Aug 2020, at 13:51, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
> Hi all,
> 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