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

Zhengyu Gu zgu at redhat.com
Wed Nov 1 12:37:44 UTC 2017


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.

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?


Thanks,

-Zhengyu




More information about the hotspot-runtime-dev mailing list