RFR: 8356693: AOT assembly phase fails with -javaagent
Ashutosh Mehra
asmehra at openjdk.org
Wed May 14 02:23:51 UTC 2025
On Tue, 13 May 2025 20:59:48 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> That's what I had in an earlier version, but then there's no code to free the allocated entries, and I am too lazy to write the deallocator.
>
> Either way the effect is the same. The trivial amount of memory used by the entries are not reclaimed, but the VM will exit after a finite amount of time anyway, after the cache creation is finish.
>
It looks like the memory for these entries is never freed even after unloading the agents during shutdown. So there memory is never reclaimed. And setting `JvmtiAgentList::_list` to nullptr is not really changing that behavior.
> I thought intercepting it here is a bit cleaner and avoids the awkward question of freeing the entries.
hmmm...not sure about that. Ideally we should ignore the jvmti options that add agents if the JVM is in assembly phase. But we detect the assembly phase after jvmti options have been processed.
IMO clearing the _list is the next best approach. If that doesn't work then more intrusive fix like intercepting the `JvmtiAgentList::Iterator`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25170#discussion_r2087914075
More information about the hotspot-dev
mailing list