RFR: 8354897: Support Soft/Weak Reference in AOT cache

Chen Liang liach at openjdk.org
Thu Apr 24 21:13:49 UTC 2025


On Thu, 24 Apr 2025 21:09:10 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> I'm not sure what you are proposing. But enqueue is used to ensure that inactive references are pruned from the data structure so that dumping only includes active references. This way, the JVM that loads these objects create these references as active and hence follow the usual life cycle that every other reference does. I want to avoid having a new "special" life cycles for dumped references.
>
> The map is still being used (and will be stored into the AOT cache). The key no longer has a referent, so we need to remove the key from the map. Adding the key to the stale queue and calling `removeStaleReferences()` will accomplish this. `key.unused()` does not remove the key from the map.

Thanks. I am fine with the rest of the core library changes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24757#discussion_r2059237363


More information about the hotspot-dev mailing list