On Thu, 28 Apr 2022 00:49:03 GMT, Leonid Mesnik <[email protected]> wrote:
>> test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderStatsTest.java line 178:
>>
>>> 176: static {
>>> 177: try {
>>> 178: // Create a hidden class, keep reference in the case if GC
>>> happens
>>
>> "Create a hidden class. Keep a reference in case a GC happens."
>>
>> I hadn't noticed the original comment when first suggesting making the Class
>> reference static. I wonder what was meant by "non-strong class".
>
> This line added by 8238358: Implementation of JEP 371: Hidden Classes which
> has many co-authors. Hope someone could provide an explanation during this
> review.
>
> It might be possible that the goal was to verify that VM.classloader_stats
> provide might provide info for non-reachable clasees. However it makes test
> to fragile, since can't block class unloading now.
Yes, that seems to be the case, and you are right that it is not something that
is safe to assume.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8438