ZGC: RFR: 8207843: HSDB cannot show Object Histogram when ZGC is working

Per Liden per.liden at oracle.com
Tue Aug 14 17:36:43 UTC 2018


Hi,

On 2018-08-11 14:06, Yasumasa Suenaga wrote:
> Hi Per,
> 
> SA needs memory regions to generate class histogram. So it is difficult 
> to use visitor model for it.
> I want to back to this issue when class unloading is implemented.

If you want to pursue the path of walking the live set, then you can do 
that today, you don't need to wait for class unloading support to appear.

cheers,
Per

> 
> 
> Thanks,
> 
> Yasumasa
> 
> 
> On 2018/08/08 20:45, Per Liden wrote:
>> Hi,
>>
>> On 08/08/2018 10:34 AM, Yasumasa Suenaga wrote:
>>> On 2018/08/08 17:07, Per Liden wrote:
>>>> On 08/08/2018 10:02 AM, Per Liden wrote:
>>>>> Hi,
>>>>>
>>>>> On 08/08/2018 10:00 AM, Yasumasa Suenaga wrote:
>>>>>> Hi Per,
>>>>>>
>>>>>> Will class unloading be occurred after relocation?
>>>>>
>>>>> No, before relocation.
>>>>
>>>> But it doesn't really matter when it happens, since there can still 
>>>> be unreachable objects with dead class pointers in ZPages that were 
>>>> not relocated.
>>>
>>> I think we can include all unreachable objects in the histogram.
>>> For example, ParallelScavengeHeap in SA collects all objects between 
>>> bottom() and top() in all spaces like `jcmd GC.class_histogram` with 
>>> -all option.
>>>
>>> So I think we can fix Object Histogram for ZGC if we resolve dead 
>>> class pointer.
>>> If SA can know ZGC phase, we might resolve it as following:
>>>
>>>
>>>    * GC is working:
>>>        Check colored pointer to collect oops.
>>>
>>>    * GC is NOT working:
>>>        Collect all oops in ZPage.
>>
>> Unfortunately that's not good enough. It doesn't matter if the GC is 
>> "working" or not, there might be unreachable objects from several GC 
>> cycles back which you can't touch. The only safe way to do this is to 
>> walk the live graph, which means starting from the roots. As you might 
>> have noticed, ZCollectedHeap::object_iterate() is implemented like 
>> this, for this exact reason.
>>
>> cheers,
>> Per
>>
>>>
>>>
>>> Thanks,
>>>
>>> Yasumasa
>>>
>>>
>>>> /Per



More information about the hotspot-gc-dev mailing list