Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

memoryshot failing

Moderators: Vladimir Kondratyev, Anton Katilin

memoryshot failing

Postby zeqingchen » Wed Dec 27, 2017 5:21 am

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
zeqingchen
 
Posts: 4
Joined: Sat Dec 23, 2017 10:11 pm

Re: memoryshot failing

Postby Anton Katilin » Wed Dec 27, 2017 6:01 am

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
Anton Katilin
 
Posts: 5590
Joined: Wed Aug 11, 2004 8:37 am

Re: memoryshot failing

Postby zeqingchen » Wed Dec 27, 2017 6:45 am

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();
zeqingchen
 
Posts: 4
Joined: Sat Dec 23, 2017 10:11 pm

Re: memoryshot failing

Postby Anton Katilin » Wed Dec 27, 2017 10:53 am

Yes, profiled applications should run with the agent:
https://www.yourkit.com/docs/java/help/agent.jsp
Anton Katilin
 
Posts: 5590
Joined: Wed Aug 11, 2004 8:37 am

Re: memoryshot failing

Postby zeqingchen » Thu Dec 28, 2017 7:42 pm

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.
zeqingchen
 
Posts: 4
Joined: Sat Dec 23, 2017 10:11 pm

Re: memoryshot failing

Postby Anton Katilin » Fri Dec 29, 2017 9:19 am

Please read the mentioned docs. It describe what the agent purpose is and how to configure it in Java command line.
Anton Katilin
 
Posts: 5590
Joined: Wed Aug 11, 2004 8:37 am


Return to Java Profiler

Who is online

Users browsing this forum: No registered users and 10 guests

cron