RFR: 8264735: Make dynamic dump repeatable [v2]
Ioi Lam
iklam at openjdk.java.net
Tue Jul 6 22:01:56 UTC 2021
On Fri, 2 Jul 2021 20:12:23 GMT, Yumin Qi <minqi at openjdk.org> wrote:
>> Hi, Please review
>>
>> Currently after dynamic dump, dump time tables (`_dumptime_talbles, _dumptime_lambda_proxy_class_dictionary and _saved_shared_path_table`) are corrupted and could not be used for next dump. The patch clones the three tables, and after dump restore them so the next dump is possible. With the fix, jcmd VM.cds dynamic_dump can do multiple dump to the same live process.
>>
>> Tests: tier1,tier2,tier3,tier4
>>
>> Thanks
>> Yumin
>
> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix comments, added check holding for DumpTimeTable_lock
Changes requested by iklam (Reviewer).
src/hotspot/share/cds/dynamicArchive.cpp line 168:
> 166:
> 167: // Restore dumptime tables
> 168: SystemDictionaryShared::restore_dumptime_tables();
Maybe this should be put inside post_dump as well?
src/hotspot/share/cds/filemap.cpp line 497:
> 495: // if (_saved_shared_path_table.size() > 0) {
> 496: // MetadataFactory::free_array<u8>(loader_data, _saved_shared_path_table->_table);
> 497: // }
In `FileMapInfo::copy_shared_path_table()`:
Array<u8>* array = MetadataFactory::new_array<u8>(loader_data, (int)bytes, CHECK);
_saved_shared_path_table = SharedPathTable(array, _shared_path_table.size());
You can remember the `array` pointer, e.g.
_saved_shared_path_table_array = array;
and then call `MetadataFactory::free_array<u8>(_saved_shared_path_table_array)` in this function.
src/hotspot/share/cds/lambdaProxyClassDictionary.hpp line 167:
> 165: // We could not use default ctor, it will destroy allocation_type in debug version and fail to delete.
> 166: // see bug 8269537
> 167: DumpTimeLambdaProxyClassDictionary() : _count(0) {}
Since you changed the construction call from
(ResourceObj::C_HEAP, mtClass)DumpTimeLambdaProxyClassDictionary();
to
(ResourceObj::C_HEAP, mtClass)DumpTimeLambdaProxyClassDictionary;
I think it's no longer necessary to add the `RunTimeLambdaProxyClassInfo()` and `DumpTimeSharedClassTable()` constructors in this PR. In 8269537, we should find a generic way to prevent this bug from happening.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4646
More information about the hotspot-runtime-dev
mailing list