11

I am trying to profile a simple algorithm: "Insertion Sort". The code takes the number of elements to sort and then randomly creates those many elements after which the sorting starts.

I am using Visual VM for profiling. However when I start profiling I see the below warning messages on the console:

objc[62944]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java (0x10004f4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1078054e0). One of the two will be used. Which one is undefined.
Profiler Agent: Waiting for connection on port 5140 (Protocol version: 15)
Profiler Agent: Established connection with the tool
Profiler Agent: Local accelerated session
Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Profiler engine warning: class 

sun.reflect.GeneratedSerializationConstructorAccessor29 that should be instrumented is not loaded by target VM
*** Requested classloader: sun.reflect.DelegatingClassLoader@21497e21, its class = class sun.reflect.DelegatingClassLoader, index = 39, hashcode = 558464545
*** Profiler engine warning: target VM cannot load class to instrument sun.reflect.GeneratedSerializationConstructorAccessor29
*** probably it has been unloaded recently
*** Profiler engine warning: class sun.reflect.GeneratedSerializationConstructorAccessor28 that should be instrumented is not loaded by target VM
*** Requested classloader: sun.reflect.DelegatingClassLoader@3b0cf023, its class = class sun.reflect.DelegatingClassLoader, index = 40, hashcode = 990703651
*** Profiler engine warning: target VM cannot load class to instrument sun.reflect.GeneratedSerializationConstructorAccessor28
*** probably it has been unloaded recently
*** Profiler engine warning: class sun.reflect.GeneratedSerializationConstructorAccessor27 that should be instrumented is not loaded by target VM
*** Requested classloader: sun.reflect.DelegatingClassLoader@23a0a147, its class = class sun.reflect.DelegatingClassLoader, index = 41, hashcode = 597729607
*** Profiler engine warning: target VM cannot load class to instrument sun.reflect.GeneratedSerializationConstructorAccessor27
*** probably it has been unloaded recently
*** Profiler engine warning: class sun.reflect.GeneratedSerializationConstructorAccessor26 that should be instrumented is not loaded by target VM
*** Requested classloader: sun.reflect.DelegatingClassLoader@61aaeaa4, its class = class sun.reflect.DelegatingClassLoader, index = 42, hashcode = 1638591140
*** Profiler engine warning: target VM cannot load class to instrument sun.reflect.GeneratedSerializationConstructorAccessor26
*** probably it has been unloaded recently

I am not sure if the profile data is correct or not.

RDM
  • 1,136
  • 3
  • 28
  • 50
  • 1
    I understand this question is very old, but even back when it was posted, this version of the JDK was about 15 months old. Consider updating to the latest OpenJDK and trying again. Incidentally, have you tried using a different profiler? Note that [Java Flight Recorder](https://docs.oracle.com/javacomponents/jmc-5-4/jfr-runtime-guide/run.htm) does not need an agent and has been built into OpenJDK 8 for a couple of years. (Ignore everything about "commercial license", that is out of date.) [JDK Mission Control](https://openjdk.java.net/projects/jmc/8/) may also work better than VisualVM. – AndrewF Feb 16 '22 at 06:36

0 Answers0