JDK-8203343 : VM.{metaspace|classloaders|classhierarchy...} jcmd should show invocation targets for Generated{Method|Constructor}AccessorImpl classes
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-05-17
  • Updated: 2021-08-06
  • Resolved: 2018-06-14
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.
JDK 11
11 b19Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
To better analyze VMs doing a lot of reflection it would be helpful to see for which method/ctor invocations Generated{Method|Constructor}Accessor classes are actually generated. Right now we only see the generated class names, which is not really helpful.

I have a local patch which causes "VM.metaspace", "VM.classloaders", "VM.class_hierarchy" to print out the reflection target of generated core reflection accessor classes. Adding the output to other commands is quite easy.

Example output:

jcmd my_spring_app  VM.class_hierarchy

<snip>
|  |--jdk.internal.reflect.ConstructorAccessorImpl/null
|  |  |--jdk.internal.reflect.GeneratedConstructorAccessor18/0x00007f9ee8350c10 (invokes: org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorRegistrar::<init> ()V)
|  |  |--jdk.internal.reflect.GeneratedConstructorAccessor17/0x00007f9ee8349c00 (invokes: org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector$ConfigurationPropertiesBeanRegistrar::<init> ()V)
|  |  |--jdk.internal.reflect.GeneratedConstructorAccessor16/0x00007f9ee83508e0 (invokes: org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector::<init> ()V)
|  |  |--jdk.internal.reflect.GeneratedConstructorAccessor15/0x00007f9ee8347d30 (invokes: org/springframework/boot/autoconfigure/condition/OnBeanCondition::<init> ()V)
|  |  |--jdk.internal.reflect.DelegatingConstructorAccessorImpl/null
|  |  |--jdk.internal.reflect.NativeConstructorAccessorImpl/null
|  |  |--jdk.internal.reflect.GeneratedConstructorAccessor22/0x00007f9ee847b3f0 (invokes: com/sun/proxy/$Proxy36::<init> (Ljava/lang/reflect/InvocationHandler;)V)
|  |  |--jdk.internal.reflect.GeneratedConstructorAccessor1/0x00007f9f7881d9d0 (invokes: java/lang/management/ManagementPermission::<init> (Ljava/lang/String;)V)
<snip>
|  |--jdk.internal.reflect.MethodAccessorImpl/null
|  |  |--jdk.internal.reflect.GeneratedMethodAccessor23/0x00007f9ec8329b60 (invokes: org/apache/tomcat/util/modeler/AttributeInfo::setIs (Z)V)
|  |  |--jdk.internal.reflect.GeneratedMethodAccessor22/0x00007f9ee831bc70 (invokes: org/springframework/boot/autoconfigure/SpringBootApplication::exclude ()[Ljava/lang/Class;)