RFR: 8301106 allow cds interned strings to be moved by gc [v4]

David Holmes dholmes at openjdk.org
Mon Feb 27 00:37:04 UTC 2023


On Sat, 25 Feb 2023 13:06:13 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/hotspot/share/classfile/stringTable.cpp line 800:
>> 
>>> 798:       // but bail out for safety.
>>> 799:       log_error(cds)("Too many strings to be archived: " SIZE_FORMAT, _items_count);
>>> 800:       os::_exit(1);
>> 
>> Hmm I hadn't really noticed that the CDS code has introduced its own direct exit path using `os::_exit` in a number of places. Why does it do this instead of using the existing VM exit paths?
>
> The reason is explained in metaspaceShared.cpp, but perhaps we should consolidate all these direct exit calls (in a separate PR) to an utility function so it's easy to track (and explain) all the calls.
> 
> 
>   // There may be pending VM operations. We have changed some global states
>   // (such as vmClasses::_klasses) that may cause these VM operations
>   // to fail. For safety, forget these operations and exit the VM directly.
>   os::_exit(0);

`vm_direct_exit` would seem to be okay in that case.

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

PR: https://git.openjdk.org/jdk/pull/12607


More information about the hotspot-runtime-dev mailing list