YourKit failed to start.
Fixing a JNI_CreateJavaVM -6 error.
I am using a Mac with 16g of memory, and I recently had an issue where YourKit fails to start with no visible feedback.
Debug this with the following steps:
cd ~/.yjp
cd log
ls -ldtr * Check for the most recent log file — and take it into vi.
Get Bob Plotts’s stories in your inbox
Join Medium for free to get updates from this writer.
I had this content:
[launcher]: Found JVM:
[launcher]: /Applications/YourKit-Java-Profiler-2022.9.app/Contents/jdk
[launcher]:
[launcher]: [0] -Dapple.laf.useScreenMenuBar=true
[launcher]: [1] -Duser.language=en
[launcher]: [2] -Djava.awt.smartInvalidate=true
[launcher]: [3] -Djna.nosys=true
[launcher]: [4] --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
[launcher]: [5] -XX:+HeapDumpOnOutOfMemoryError
[launcher]: [6] -Xmx8g -Xms8g
[launcher]: [+1]: -Djava.class.path=/Applications/YourKit-Java-Profiler-2022.9.app/Contents/Resources/lib/yourkit.jar
[launcher]: JNI_CreateJavaVM for /Applications/YourKit-Java-Profiler-2022.9.app/Contents/jdk failed: -6The last line is the clue — JNI_CreateJavaVM failed with -6. As far as I can tell so far, that indicates that the JVM cannot initialize with the requested amount of heap space. In this case 8g.
The configuration file for YourKit is in ~/.yjp/ui.ini — you can change the heap settings there. The default is 1g and I had previously updated it to 8g. I reduced the -Xmx and -Xms to 4g, restarted YourKit from the Dock and it worked.






