Cannot launch Yourkit with GraalVM

Questions about YourKit Java Profiler
Post Reply
kryptek
Posts: 3
Joined: Mon Jul 12, 2021 8:46 pm

Cannot launch Yourkit with GraalVM

Post by kryptek »

Hello,

I'm trying to profile my application but unless I add the startup option "disableall", my java application does not start up. I am trying to root cause a lot of GC going on, so I really do need to be able to check object allocations. I would appreciate any help!

Code: Select all

21.3-231 0.000: Log file: /odosvc/.yjp/log/my-service-0.0.1-SNAPSHOT-shaded-25123.log
21.3-231 0.000: Command line:
  java
  -agentpath:/tmp/YourKit-JavaProfiler-2021.3/bin/linux-x86-64/libyjpagent.so=port=12345,listen=all
  -Djavax.net.ssl.trustStore=/etc/pki/java/cacerts
  -Djava.security.egd=file:///dev/urandom
  -Xms6000M
  -Xmx6000M
  -XX:+PrintGCDetails
  -XX:+PrintGCTimeStamps
  -XX:+PrintGCDateStamps
  -Xloggc:/logs/my-service/gc.log
  -jar
  target/my-service-0.0.1-SNAPSHOT-shaded.jar
  server
  target/config/my-service.conf
21.3-231 0.000: Executable: /usr/lib64/graalvm/graalvm19-ee-java8/jre/bin/java
21.3-231 0.000: uname:
  sysname: Linux
  release: 4.1.12-124.51.2.el7uek.x86_64
  version: #2 SMP Tue May 11 15:12:13 PDT 2021
  machine: x86_64
21.3-231 0.000: Linux; linux-x86-64; 64-bit process
21.3-231 0.000: hid: 3602619Z9999XX545483217W8Z7VW31W8U 64-bit machine
21.3-231 0.000: RAM: 60136 MB
21.3-231 0.000: Today is 20210712
21.3-231 0.000: full_build_stamp: 2021.3.231 202106031002
21.3-231 0.000: Agent library path: /tmp/YourKit-JavaProfiler-2021.3/bin/linux-x86-64/libyjpagent.so
21.3-231 0.000: getTimeNsInfo: "monotonic"
21.3-231 0.001: Agent_OnLoad: orig_options=port=12345,listen=all
  full_options=port=12345,listen=all
21.3-231 0.001: jvmtiVersion: 30010203
21.3-231 0.001: phase: 1
21.3-231 0.001: vendor: Oracle Corporation
21.3-231 0.001: version: 25.291-b10-jvmci-19.3-b26
21.3-231 0.001: specVersion: 1.8
21.3-231 0.001: info: mixed mode, sharing
21.3-231 0.001: heap_sampling: capability is not available
21.3-231 0.001: asynchronous sampling: available
21.3-231 0.001: skip advanced port check: 0; inside Kubernetes: 0
21.3-231 0.001: session_id: 107904089500815 (1626123407,25123)
21.3-231 0.003: line_method: 1
21.3-231 0.003: can_generate_early_class_hook_events: optional capability is not available
21.3-231 0.016: Reusing existing jar file: /tmp/yjp202106031002.jar
21.3-231 0.017: JVMTI 30010203; 25.291-b10-jvmci-19.3-b26; Oracle Corporation; mixed mode, sharing; Java version: 8
21.3-231 0.066: Successfully registered probes: 29
  Registered: .AgentLoadingSupport
  Registered: .AsyncChannels
  Registered: .AsyncSamplingSupport
  Registered: .AwtEvents
  Registered: .Cassandra
  Registered: .CassandraLW
  Registered: .Databases
  Registered: .DatabasesLW
  Registered: .DirectoryStreams
  Registered: .Files
  Registered: .FilesLW
  Registered: .HBase
  Registered: .HBaseLW
  Registered: .JNDI
  Registered: .JPA_DataNucleus
  Registered: .JPA_EclipseLink
  Registered: .JPA_Hibernate
  Registered: .JPA_OpenJPA
  Registered: .JUnitTests
  Registered: .MongoDB
  Registered: .MongoDBLW
  Registered: .Processes
  Registered: .Servlets
  Registered: .ServletsLW
  Registered: .Sockets
  Registered: .SocketsLW
  Registered: .Sync
  Registered: .TestNG
  Registered: .Threads
21.3-231 0.148: agentStart: 1
21.3-231 0.148: agentStart: 2
21.3-231 0.150: agentStart: OK
21.3-231 0.181: tracing=off: large method: 3945 sun.nio.cs.StandardCharsets$Aliases init(java.lang.Object[])
21.3-231 0.303: vmInit: 1
21.3-231 0.304: vmInit: load all method IDs
21.3-231 0.306: vmInit: 2
21.3-231 0.306: agentInit: 1
21.3-231 0.310: agentInit: Core loaded
21.3-231 0.385: tracing=off: large method: 2252 jdk.internal.org.objectweb.asm.Frame execute(int, int, jdk.internal.org.objectweb.asm.ClassWriter, jdk.internal.org.objectweb.asm.Item)
21.3-231 0.564: setTriggers:

21.3-231 0.564: setTriggers: to unregister: 0
21.3-231 0.564: setTriggers: method listeners to register: 0
21.3-231 0.564: setTriggers: OK
21.3-231 0.564: ourUnsafe: true
21.3-231 0.564: shmem 42341490: OK
21.3-231 0.603: Socket timeout: 30000
21.3-231 0.615: YourKit Java Profiler agent is listening on port 12345, "listen=all"
21.3-231 0.622: *** HINT ***: To get profiling results, connect to the application from the profiler UI
21.3-231 0.652: agentInit: Core.init() called
21.3-231 0.653: agentInit: OK
21.3-231 0.653: vmInit: 3
21.3-231 0.653: onStartProfiling: entering...
21.3-231 0.653: onStartProfiling: done
21.3-231 0.653: vmInit: OK
21.3-231 0.781: SP: pin java.lang.ClassNotFoundException
21.3-231 0.899: [m: 41879 104] total classes: processed=1000 instrumented=884 358ms
21.3-231 0.905: SP: pin java.lang.NoSuchFieldException
21.3-231 0.945: SP: pin java.io.FileNotFoundException
21.3-231 0.945: SP: pin java.security.PrivilegedActionException
21.3-231 1.002: SP: pin java.lang..
21.3-231 1.075: tracing=off: large method: 4206 jdk.vm.ci.hotspot.HotSpotVMConfig <init>(jdk.vm.ci.hotspot.HotSpotVMConfigStore)
21.3-231 1.108: SP: pin java.lang.IllegalArgumentException
21.3-231 1.137: SP: pin java.security.AccessControlException
21.3-231 1.256: SP: pin java.lang.UnsatisfiedLinkError
21.3-231 1.259: SP: pin java.lang.NoClassDefFoundError
21.3-231 1.260: vmDeath: 1
21.3-231 1.260: vmDeath: 2
21.3-231 1.262: error at JniUtils.cpp:48: assertJni failed at JvmtiAgent.cpp:365
java.lang.NoClassDefFoundError: Could not initialize class org.graalvm.libgraal.LibGraal
  /tmp/YourKit-JavaProfiler-2021.3/bin/linux-x86-64/libyjpagent.so(_Z16appendStackTraceP11YStringImplIcE+0x54) [0x7f844197e234]
  /tmp/YourKit-JavaProfiler-2021.3/bin/linux-x86-64/libyjpagent.so(_ZN6Logger5errorERK11YStringImplIcEPKci+0xfab) [0x7f844197f5ab]
  /tmp/YourKit-JavaProfiler-2021.3/bin/linux-x86-64/libyjpagent.so(_Z13assertJniImplP7JNIEnv_PKci+0x11b2) [0x7f844190ca12]
  /tmp/YourKit-JavaProfiler-2021.3/bin/linux-x86-64/libyjpagent.so(_Z7vmDeathP9_jvmtiEnvP7JNIEnv_+0x269) [0x7f84419907c9]
  /usr/lib64/graalvm/graalvm19-ee-java8/jre/lib/amd64/server/libjvm.so(+0x8209f1) [0x7f844305d9f1]
  /usr/lib64/graalvm/graalvm19-ee-java8/jre/lib/amd64/server/libjvm.so(+0x6abedb) [0x7f8442ee8edb]
  /usr/lib64/graalvm/graalvm19-ee-java8/jre/lib/amd64/server/libjvm.so(+0x7b29d1) [0x7f8442fef9d1]
  /usr/lib64/graalvm/graalvm19-ee-java8/jre/lib/amd64/server/libjvm.so(+0x4abe90) [0x7f8442ce8e90]
  /usr/lib64/graalvm/graalvm19-ee-java8/jre/lib/amd64/server/libjvm.so(+0x4acb78) [0x7f8442ce9b78]
  /usr/lib64/graalvm/graalvm19-ee-java8/jre/lib/amd64/server/libjvm.so(+0xb33a54) [0x7f8443370a54]
  /usr/lib64/graalvm/graalvm19-ee-java8/jre/lib/amd64/server/libjvm.so(+0xb33d51) [0x7f8443370d51]
  /usr/lib64/graalvm/graalvm19-ee-java8/jre/lib/amd64/server/libjvm.so(+0x9c1672) [0x7f84431fe672]
  /lib64/libpthread.so.0(+0x7ea5) [0x7f8444110ea5]
  /lib64/libc.so.6(clone+0x6d) [0x7f8443a1d9fd]
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Cannot launch Yourkit with GraalVM

Post by Anton Katilin »

Hello,

The profiler does not officially support GraalVM.

As a possible workaround, please try the option disablenatives instead of disableall.

If that does not work, please use a regular HotSpot JVM to perform profiling.
Post Reply