capture snapshot and stop-cpu-profiling

Questions about YourKit Java Profiler
Post Reply
tpraneeth
Posts: 3
Joined: Mon Jun 11, 2018 8:07 am

capture snapshot and stop-cpu-profiling

Post by tpraneeth »

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

Re: capture snapshot and stop-cpu-profiling

Post by Anton Katilin »

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 [email protected]
GeraldClinton
Posts: 2
Joined: Tue Sep 25, 2018 6:14 am

Re: capture snapshot and stop-cpu-profiling

Post by GeraldClinton »

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

Re: capture snapshot and stop-cpu-profiling

Post by Anton Katilin »

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.
Post Reply