RFR: 8267281: Investigate calling MetaspaceShared::link_and_cleanup_shared_classes for jcmd dynamic_dump [v2]

Calvin Cheung ccheung at openjdk.java.net
Mon Jul 12 18:28:58 UTC 2021


On Fri, 9 Jul 2021 19:58:17 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> Hi, Please review
>> 
>>   When using 'jcmd VM.cds dynamic_dump' to dump dynamic archive, we did not call MetaspaceShared::link_and_cleanup_shared_classes, which is linking linkable shared classes before dump. The classes should be those loaded but not yet linked or loaded during verification. It also will regenerate the lambda form invoker holder classes (those recorded in static archive plus loaded during app run time). For static dump, a separate process spawned to dump the static archive, and for dynamic dump without using jcmd, after dump the process will exit, so this function only called once.  
>>   With jcmd, we can do multiple dumps to same live process (See bug 8264735) so we need to check if calling this function is safe (do not change runtime data consistency). The lambda form invoker holder classes will be generated every time this function is called either.
>>   The function name is renamed to link_shared_classes, since the cleanup work is no longer done by this function.
>> 
>>   Tests: tier1,tier3,tier4 (going on to finish, without failure found). 
>>    
>> Thanks
>> Yumin
>
> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Modified log message and test case for checking this message

Looks good. Just one comment.

src/hotspot/share/cds/metaspaceShared.cpp line 597:

> 595: void MetaspaceShared::link_shared_classes(TRAPS) {
> 596:   // Collect all loaded ClassLoaderData.
> 597:   ResourceMark rm;

(This is pre-existing) I think the ResourceMark can be removed.

-------------

Marked as reviewed by ccheung (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/4736


More information about the hotspot-runtime-dev mailing list