JDK-8216998 : [nestmates] dcmd support for hidden classes
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2019-01-14
  • Updated: 2019-11-01
  • Resolved: 2019-11-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
repo-valhallaResolved
Related Reports
Duplicate :  
Description
Test serviceability/dcmd/vm/ClassLoaderStatsTest.java fails, with non-findable classes, when testing the dcmd VM.classloader_stats.  It fails because the dcmd implementation in classLoaderStats.cpp does not find any short-lived classes.  (A class is short-lived if it is either a JVM unsafe anonymous class or a weak non-findable class.)

The dcmd implementation looks for short-lived classes by checking if the classLoaderData is short-lived.  If so, then it adds to its _anon_classes_count, _anon_chunk_sz, and _anon_block_sz statistics.

Unfortunately, the test tries to use a lambda form to create an anonymous class.  But this now creates a strong non-findable class, which does not have a short-lived classLoaderData.  So, the _anon_classes_count is 0, instead of the expected 1, and the test fails.  (The test passes if weak non-findable classes are created instead of strong ones.)

Some issues for dcmd:

1. Should dcmd VM.classloader_stats only collect stats on weak non-findable classes?  Collecting stats on strong non-findable classes would require searching all the classes in the classLoaders to see which classes ones are non-findable.

2. If dcmd does collect stats on strong non-findable classes then what does it do about fields such as _anon_chunk_sz and _anon_block_sz for the strong non-findable classes?

3. Should dcmd now keep classloader_stats on three different classes: regular, strong non-findable, and non-findable?

4. Does the test need to be changed to create a weak non-findable class?

5. Why are lambda forms now creating strong non-findable classes instead of weak ones?




Comments
The classloader_stats seems to be designed for performance of class loading. VM unsafe anonymous classes are special that it has its own classLoaderData and providing some insight of the statistics about them makes sense. When the use of VM anonymous class is migrated to the new hidden/non-findable class, it would be useful to provide breakdown of strong vs weak hidden classes and how to present the classLoaderData related data. So I change the summary to reflect this RFE.
31-05-2019

I missed that this is defined as a subtask of one of the issues that would be used to push this to mainline. This kind of bug report arrangement does not work as we would not fix this subtask as an independent step. I think this should be a stand-alone issue filed against repo-valhalla.
14-01-2019