RFR: 8229451: ZGC: Make some roots invisible to the heap iterator

Per Liden per.liden at oracle.com
Wed Aug 21 13:43:25 UTC 2019


Returned to this patch and did some more testing, and realized that the 
UnhandledOops checker will complain about the raw oop. Adjusted the code 
to avoid that.

Diff: http://cr.openjdk.java.net/~pliden/8229451/webrev.1-diff
Full: http://cr.openjdk.java.net/~pliden/8229451/webrev.1

Testing: Passed tier1-3

cheers,
Per

On 8/14/19 10:27 AM, Per Liden wrote:
> Thanks Erik!
> 
> I agree that another path in ZRootIterator is unfortunate, but the 
> alternatives I've managed to come up with tend to be worse.
> 
> /Per
> 
> On 8/14/19 9:57 AM, Erik Osterlund wrote:
>> Hi Per,
>>
>> Unfortunate with another special path in the root iterator. But 
>> alternatives also look bad. Looks good.
>>
>> Thanks,
>> /Erik
>>
>>> On 13 Aug 2019, at 10:42, Per Liden <per.liden at oracle.com> wrote:
>>>
>>> JDK-8227226 can temporarily create long[] objects on the heap, which 
>>> later become oop arrays, when the array initialization has been 
>>> completed. This is fine from a sampling/reporting point of view (the 
>>> things done in the MemAllocator::Allocation destructor), since that 
>>> only happens after the final klass pointer has been installed. 
>>> However, if a heap iteration (via ZHeapIterator) happens before the 
>>> final klass pointer has been installed, it will then see the long[]. 
>>> As far as I can tell, this isn't a big deal, unless that heap 
>>> iteration is out to JVMTI-tag all long[] instances. In that case, we 
>>> tag a long[] which will later become an oop array, which seems wrong 
>>> and potentially problematic. To avoid this, we want to be able to 
>>> hide these roots from the heap iterator until the final klass pointer 
>>> has been installed.
>>>
>>> The approach here is that these temporary long[] objects are not kept 
>>> alive in a Handle, but instead treated as a special root in 
>>> ZThreadLocalData, that can optionally be made invisible to the 
>>> ZRootsIterator.
>>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8229451
>>> Webrev: http://cr.openjdk.java.net/~pliden/8229451/webrev.0
>>>
>>> /Per
>>



More information about the hotspot-gc-dev mailing list