$ bin/yjp.sh
Exception in thread "YJP Startup" java.lang.ExceptionInInitializerError
at com.yourkit.h.ae.a(a:170)
at com.yourkit.h.ae.findClass(a:34)
at com.yourkit.h.ae.loadClass(a:164)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.yourkit.e.run(a:6)
Caused by: java.lang.RuntimeException: Cannot load /home/knuckles/Apps/yjp-2016.06/bin/linux-x86-64/libyjpagent.so
If you use the profiler API, please make sure you add to the CLASSPATH the yjp.jar from entire YourKit Java Profiler distribution (YJP_HOME/lib/yjp.jar), but not a copy of yjp.jar placed to arbitrary directory.
at com.yourkit.Natives.a(a:58)
at com.yourkit.Natives.<clinit>(a:29)
... 7 more
Caused by: java.lang.UnsatisfiedLinkError: /home/knuckles/Apps/yjp-2016.06/bin/linux-x86-64/libyjpagent.so: /home/knuckles/Apps/yjp-2016.06/bin/linux-x86-64/libyjpagent.so: failed to map segment from shared object
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at com.yourkit.Natives.a(a:6)
... 8 more
$ samples/sample1/run.sh
Using Java: samples/sample1/../../jre64/bin/java
Using agent: samples/sample1/../../bin/linux-x86-64/libyjpagent.so
[YourKit Java Profiler 2016.06-b32 EAP] Log file: /home/knuckles/.yjp/log/APIDemo1-9739.log
The application has captured its own memory snapshot.
It is saved to the file /home/knuckles/Snapshots/APIDemo1-2016-12-01.snapshot
$ samples/sample2/run.sh
Using Java: samples/sample2/../../jre64/bin/java
Using agent: samples/sample2/../../bin/linux-x86-64/libyjpagent.so
[YourKit Java Profiler 2016.06-b32 EAP] Log file: /home/knuckles/.yjp/log/APIDemo2-9855.log
The application has captured its own memory snapshot.
It is saved to the file /home/knuckles/Snapshots/APIDemo2-2016-12-01.snapshot
Loading captured snapshot...
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.yourkit.api.MemorySnapshot.getImplementationClass(a:23)
at com.yourkit.api.MemorySnapshot.<init>(a:26)
at com.yourkit.api.MemorySnapshot.<init>(a:68)
at APIDemo2.main(APIDemo2.java:24)
Caused by: java.lang.RuntimeException: No valid license key available
at com.yourkit.api.SnapshotImpl.<clinit>(a:10)
... 6 more
It would seem that in this case the crash happens before any logging starts. All I have on my "~/.yjp/log/" folder are the APIDemo1 and APIDemo2 log files.
Update: I was doing some experiments and finally managed to get YourKit to run!
It seems the issue was that my user had a 6GB address space / virtual memory limit on /etc/security/limits.conf .
By removing it, yourkit now launches successfully. So this seems like the JVM was trying to load the native library and not having enough address space size to do it.