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

David Holmes dholmes at openjdk.org
Tue Feb 21 08:17:27 UTC 2023


On Tue, 21 Feb 2023 04:00:43 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/hotspot/share/cds/heapShared.cpp line 426:
>> 
>>> 424:   oop shared_strings_array = StringTable::init_shared_table(_dumped_interned_strings);
>>> 425:   bool success = archive_reachable_objects_from(1, _default_subgraph_info, shared_strings_array, /*is_closed_archive=*/ false);
>>> 426:   guarantee(success, "shared strings array must point to only archivable objects");
>> 
>> What could cause this to fail? Do we need a more graceful bailout in release builds?
>
> It should never fail. I could've used an assert but made it a guarantee since this is rather new code and I am paranoid.

So what stops us from hitting this:

        // Don't archive a subgraph root that's too big. For archives static fields, that's OK
        // as the Java code will take care of initializing this field dynamically.
        return false;

in `HeapShared::archive_reachable_objects_from`?

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

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


More information about the hotspot-runtime-dev mailing list