RFR (S) 8197844: JVMTI GetLoadedClasses should use the Access API

Roman Kennke rkennke at redhat.com
Thu Mar 15 13:46:50 UTC 2018

Am 14.03.2018 um 18:37 schrieb coleen.phillimore at oracle.com:
> Summary: Make sure the holder of a class loader is accessed during
> iteration of CLDG
> This is where we should have put the GC barrier.  This can be cleaned
> somewhat when we have a WeakHandle holder in the ClassLoaderData, then
> the code in ensure_loader_alive() becomes _holder.resolve();
> Tested with tier1-5.
> open webrev at http://cr.openjdk.java.net/~coleenp/8197844.01/webrev
> bug link https://bugs.openjdk.java.net/browse/JDK-8197844
> Thanks,
> Coleen

I am not sure at all that this wouldn't have adverse effects. Suppose a
GC is iterating all CLDs and marks all of them alive, we'd probably
never unload it? I probably wouldn't do the keep-alive stuff wholesale
in the iterator methods.

I've made (and later withdraw) a (IMO) more straightforward patch to
address the same:


It has the advantage that it doesn't to a bogus load, just to keep
something alive. It loads the mirror and at the same time communicates
the GC to keep it alive. Maybe better?


More information about the hotspot-runtime-dev mailing list