RFR: 8358580: Rethink how classes are kept alive in training data

Igor Veresov iveresov at openjdk.org
Thu Jul 10 17:05:40 UTC 2025


On Thu, 10 Jul 2025 16:48:17 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> @coleenp I kind of like the fact that I can get rid of a field in KTD that previously stored a handle. Perhaps that benefit justifies a direct allocation?
>> 
>> @shipilev I don't understand your comment about loading the mirror. I'm not merely loading it, I'm registering it as a root. It is also all happening in a safepoint-free context.
>
> Then just have OopHandle handle = OopHandle(Universe::vm_global(), klass->klass_holder());
> 
> or similar.  You don't have to store it unless you're going to release it.  But footprint seems unimportant in this case.  Also, maybe OopStorage::allocate() should just be friends with OopHandle.
> 
> Edit: looks like it's also used by string deduplication but this shouldn't call OopStorage::allocate directly.

Ah, sorry, I was somehow under the impression that OopHandle would have a destructor that release the handle.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26233#discussion_r2198257057


More information about the hotspot-dev mailing list