Profiling Java running by JNI calls
-
03-10-2019 - |
Question
I have a C++ code that upon execution:
Loads JVM (I have full control on how to load the JVM), and call Java methods (from loaded classes) using C JNI code. The Java code has no Main() and it is actually not a standard Java application. it is mainly a static code that compiled and compacted into Jar file, the code is being called by the C++ module.
Is it possible to profile this Java code being executed by YourKit (have license for it)? If so I'll be glad to know how.
Solution 2
Answer for the mass demands,
I have managed to profile using YourKit. I just added the yourkit.com/docs/80/help/agent.jsp agnent VM flag and attach the profiler to the VM.
OTHER TIPS
I'll throw this out there for C++ folks looking to profile Java: Java has a great visual profiler that automatically hooks up to the JVM called VisualVM. It is included with the jdk. Check it out here: http://visualvm.java.net/
To run visual vm look for the executable in your jdk bin folder.