RFR(S) 8189688: NMT: Report per-class load metadata information

David Holmes david.holmes at oracle.com
Thu Nov 2 02:23:12 UTC 2017


On 1/11/2017 10:37 PM, Zhengyu Gu wrote:
> Hi David,
>>
>> Yes there is. See the comments in Threads::destroy_vm and 
>> VMThread::wait_for_vm_thread_exit.
>>
>> JNI_DestroyJavaVM ->
>>    Threads::destroy_vm() ->
>>      VMThread::wait_for_vm_thread_exit();
>>        _should_terminate = true;
>>
>> VMThread::run()
>>    this->loop(); // returns when _should_terminate is true
>>    ...
>>    // 4526887 let VM thread exit at Safepoint
>>    _no_op_reason = "Halt";
>>    SafepointSynchronize::begin();
>>
>> The VMThread always takes the VM to a safepoint on a non-aborting exit.
> 
> 
> I see.
> 
> These safepoints are bit too late, cause print_statistics() calls 
> usually come before them.

Ok. It was just a thought.

> There are two solutions I can think of:
> 
> 1) Printing NMT final report after VMThread takes the VM to the safepoint.
> 
> 2) Leave NMT final reporting at where it is now, but execute a safepoint 
> to report metadata stats. I don't see any issue for requesting a 
> safepoint, do I miss anything?

Sorry I haven't followed this too closely. You'd need to be careful 
about requesting a synchronous safepoint during termination.

David

> 
> Thanks,
> 
> -Zhengyu
> 
> 


More information about the hotspot-runtime-dev mailing list