RFR: 8252514: ZGC: Physical memory splitting is broken

Stefan Karlsson stefan.karlsson at oracle.com
Wed Sep 2 06:52:04 UTC 2020


Thanks, Per.

StefanK

On 2020-09-01 17:54, Per Liden wrote:
> Looks good!
> 
> /Per
> 
> On 8/31/20 1:51 PM, Stefan Karlsson wrote:
>> Hi all,
>>
>> Please review this patch to fix physical memory splitting in ZGC.
>>
>> https://cr.openjdk.java.net/~stefank/8252514/webrev.01/
>> https://bugs.openjdk.java.net/browse/JDK-8252514
>>
>> 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.
>>
>> Thanks,
>> StefanK



More information about the hotspot-gc-dev mailing list