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

capture snapshot and stop-cpu-profiling

Moderators: Vladimir Kondratyev, Anton Katilin

capture snapshot and stop-cpu-profiling

Postby tpraneeth » Fri Sep 21, 2018 8:56 am

Hi,

When I try to capture a tracing snapshot for my test it produces about 2.5G snapshot.

I have observed that when I issue a stop-cpu-profiling command from the command line, my application server shuts down .

So, I have decided to issue capture-performance-snapshot before doing stop-cpu-profiling.

Two Questions:
1. Would I be losing any data if capture-performance-snapshot is invoked before stop-cpu-profiling?
2. What configuration changes should I be doing to make sure, server doesn't shut down when stop-cpu-profiling? Should I increase the heap?

Thanks
tpraneeth
 
Posts: 3
Joined: Mon Jun 11, 2018 8:07 am

Re: capture snapshot and stop-cpu-profiling

Postby Anton Katilin » Sun Sep 23, 2018 2:33 pm

When I try to capture a tracing snapshot for my test it produces about 2.5G snapshot.

Do you capture a performance snapshot, not a memory snapshot? If former, the size is incredibly high. Perhaps too much information has been recorded. Anyway, without having the snapshot file at hands I can't say more; if you could share the file (a download link) we'd try to analyze it.

1. Would I be losing any data if capture-performance-snapshot is invoked before stop-cpu-profiling?
No, nothing will be lost.
2. What configuration changes should I be doing to make sure, server doesn't shut down when stop-cpu-profiling? Should I increase the heap?
The crash you observe is abnormal. To understand its cause we need the profiler agent log file and the crash log, error messages etc. Please send them to support@yourkit.com
Anton Katilin
 
Posts: 5719
Joined: Wed Aug 11, 2004 8:37 am

Re: capture snapshot and stop-cpu-profiling

Postby GeraldClinton » Tue Sep 25, 2018 6:19 am

With VisualVM, You can attach to a local java process, start/stop CPU profiling, and generate a snapshot. I don't even need to instrument the process with any special agents etc.

Is it possible to do the same thing on a headless production server? I know I can configure the process to attach the debugger remotely, but I want to minimize the amount and impact of changing the customer environment. I just want to run a command to profile for a while and generate a snapshot file, which I can scp to my workstation for analysis with VisualVM or equivalent.

Preferably, the whatever program I run to do this should be freely redistributable, so that I can bundle it with my Java app and have it be available in the customer environment.

Ideally, just like with Visual VM, I'd like to be able to attach to a running system without a restart.
GeraldClinton
 
Posts: 2
Joined: Tue Sep 25, 2018 6:14 am

Re: capture snapshot and stop-cpu-profiling

Postby Anton Katilin » Tue Sep 25, 2018 9:25 am

YourKit Java Profiler supports attaching the agent to a running JVM:
https://www.yourkit.com/docs/java/help/attach_agent.jsp

Please note that a remote attach is also possible.
Anton Katilin
 
Posts: 5719
Joined: Wed Aug 11, 2004 8:37 am


Return to Java Profiler

Who is online

Users browsing this forum: Majestic-12 [Bot] and 17 guests