memoryshot failing
-
- Posts: 4
- Joined: Sat Dec 23, 2017 10:11 pm
memoryshot failing
I tried to profile my java code programmatically and automatically. So, I use Controller and MemorySnapshot these 2 classes' api. But I always got null Controller and got exceptions to create Controller. I feel like it is about license. I have license and could profile my applicaiton using the Yourkit application. However, I do not know how to use code to tell Yourkit that I have license. Could you help me? so I can write a program using Yourkit to save snapshot automatically
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: memoryshot failing
Please provide the exception stack trace.
Please ensure you properly add profiler JARs to the classpath, as the help suggests:
https://www.yourkit.com/docs/java/help/api.jsp
Please ensure you properly add profiler JARs to the classpath, as the help suggests:
https://www.yourkit.com/docs/java/help/api.jsp
-
- Posts: 4
- Joined: Sat Dec 23, 2017 10:11 pm
Re: memoryshot failing
cause={Exception@5126}"java.lang.Exception:To profile application, you should run it with the profiler agent"
stackTrace = {StackTraceElement[0]@5129}
I try to create a controller = new Controller();
stackTrace = {StackTraceElement[0]@5129}
I try to create a controller = new Controller();
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: memoryshot failing
Yes, profiled applications should run with the agent:
https://www.yourkit.com/docs/java/help/agent.jsp
https://www.yourkit.com/docs/java/help/agent.jsp
-
- Posts: 4
- Joined: Sat Dec 23, 2017 10:11 pm
Re: memoryshot failing
Sorry, I am newbie. I don't know if I get you. So, what do you mean by profiler agent? So, I assume that you want me to open Yourkit while I run Yourkir progrmatically? Also, I try to do -agentpath... in my application directory. However, it fails saying no BASH command are matched.
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: memoryshot failing
Please read the mentioned docs. It describe what the agent purpose is and how to configure it in Java command line.