Question 1) Can I change the directory the snapshots are saved in?
mine go in /usr/share/tomcat/Snapshots but might be nice to aim the in the script
Question 2) Can you mark which snapshots appropriate to do after each start/stop
I see 3 snapshot commands
capture-memory-snapshot
capture-hprof-snapshot
capture-performance-snapshot
I want to make sure I am matching the correct with the correct
clear-cpu-data
start-cpu-sampling
start-cpu-tracing
stop-cpu-profiling
# question, then capture-performance-snapshot ?
clear-alloc-data
start-alloc-recording-all
start-alloc-recording-adaptive [alloc-sampled]
// record each 10th allocation, and all objects with size > 1M
stop-alloc-recording
# capture-memory-snapshot? or which?
clear-monitor-data
start-monitor-profiling
stop-monitor-profiling
# question, then capture-hprof-snapshot?
If that right?
Question 3) Is there one of these that has exceptions caught
misc command line questions....
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: misc command line questions....
Hi Michael,
https://www.yourkit.com/docs/java/help/snapshot_dir.jsp
Memory snapshot contains heap + everything a performance snapshot would contain. In other words, memory snapshot includes performance snapshot. If you don't need the heap, use a performance snapshot.
HPROF is a special, JVM supported format. It contains heap only:
https://www.yourkit.com/docs/java/help/ ... pshots.jsp
Best regards,
Anton
Snapshot directory is configurable, but this should be made when you run the profiled application:Question 1) Can I change the directory the snapshots are saved in?
https://www.yourkit.com/docs/java/help/snapshot_dir.jsp
Question 2) Can you mark which snapshots appropriate to do after each start/stop
Please note that start implies clear, so explicit "clear-" before "start-" is not needed.clear-cpu-data
Yes.start-cpu-sampling
start-cpu-tracing
stop-cpu-profiling
# question, then capture-performance-snapshot ?
Yes.clear-alloc-data
start-alloc-recording-all
start-alloc-recording-adaptive [alloc-sampled]
stop-alloc-recording
# capture-memory-snapshot?
No, this is again a performance snapshot.clear-monitor-data
start-monitor-profiling
stop-monitor-profiling
# question, then capture-hprof-snapshot?
Memory snapshot contains heap + everything a performance snapshot would contain. In other words, memory snapshot includes performance snapshot. If you don't need the heap, use a performance snapshot.
HPROF is a special, JVM supported format. It contains heap only:
https://www.yourkit.com/docs/java/help/ ... pshots.jsp
Any except for HPROF. Again, if you don't need the heap, performance snapshot is sufficient.Question 3) Is there one of these that has exceptions caught
Best regards,
Anton
-
- Posts: 34
- Joined: Mon Feb 02, 2015 3:14 pm
Re: misc command line questions....
and another basic question.
so I can start the combination of things I want (at once)
let it run for some time
stop them (at once )
and then snap performance and memory?
or is there an advantage doing them one feature at a time?
so I can start the combination of things I want (at once)
let it run for some time
stop them (at once )
and then snap performance and memory?
or is there an advantage doing them one feature at a time?
-
- Posts: 34
- Joined: Mon Feb 02, 2015 3:14 pm
Re: misc command line questions....
And... what's the different between cpu tracing and cpu monitoring?
thanks
thanks
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: misc command line questions....
You can run different modes (CPU profiling, allocation recording, monitors, etc.) simultaneously by starting them one by one. If you capture a snapshot it will include all results available at the moment. Later you can stop them one by one too.
I wouldn't recommend combining CPU profiling, be it sampling or tracing, with other modes such as allocation recording, because their additional overhead may affect the CPU profiling result accuracy.or is there an advantage doing them one feature at a time?
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: misc command line questions....
We don't use the term "cpu monitoring".cpu tracing and cpu monitoring
Instead, CPU sampling and CPU tracing are two available CPU profiling modes. You can use only one of them at a time (or none, meaning that CPU profiling is not running).
Please find description and comparison here:
https://www.yourkit.com/docs/java/help/cpu_intro.jsp
-
- Posts: 34
- Joined: Mon Feb 02, 2015 3:14 pm
Re: misc command line questions....
ok....
started cpu ran 15 min stopped... seems like a reasonable size
snapshotted perf
-rw-r--r-- 1 tomcat tomcat 13270358 Mar 13 16:23 Tomcat-2015-03-13.snapshot
started allocation adaptive
started monitor profiling
ran 15 min
stopped both
snapshotted memory then perf
-rw-r--r-- 1 tomcat tomcat 706920270 Mar 13 16:45 Tomcat-2015-03-13-1.snapshot
-rw-r--r-- 1 tomcat tomcat 43102673 Mar 13 16:45 Tomcat-2015-03-13-2.snapshot
Is there something I need to clear for the memory snapshot... or is watching it for 15 min asking for trouble seeing that it's 700Meg
thanks and sorry for all the questions
should I have cleared the cpu part before starting??
started cpu ran 15 min stopped... seems like a reasonable size
snapshotted perf
-rw-r--r-- 1 tomcat tomcat 13270358 Mar 13 16:23 Tomcat-2015-03-13.snapshot
started allocation adaptive
started monitor profiling
ran 15 min
stopped both
snapshotted memory then perf
-rw-r--r-- 1 tomcat tomcat 706920270 Mar 13 16:45 Tomcat-2015-03-13-1.snapshot
-rw-r--r-- 1 tomcat tomcat 43102673 Mar 13 16:45 Tomcat-2015-03-13-2.snapshot
Is there something I need to clear for the memory snapshot... or is watching it for 15 min asking for trouble seeing that it's 700Meg
thanks and sorry for all the questions
should I have cleared the cpu part before starting??
-
- Posts: 34
- Joined: Mon Feb 02, 2015 3:14 pm
Re: misc command line questions....
I stopped cpu profiling and cleared it
then started alloc adaptive and monitoring and still for a huge result.
memory snapshot is first and relatively small
performance snapshot is next and relatively large
-rw-r--r-- 1 tomcat tomcat 42939595 Mar 13 18:09 Tomcat-2015-03-13-1.snapshot
-rw-r--r-- 1 tomcat tomcat 726000631 Mar 13 18:09 Tomcat-2015-03-13.snapshot
just seeing if I'm doing something wrong causing it to conflate
both collected for 15 min
then started alloc adaptive and monitoring and still for a huge result.
memory snapshot is first and relatively small
performance snapshot is next and relatively large
-rw-r--r-- 1 tomcat tomcat 42939595 Mar 13 18:09 Tomcat-2015-03-13-1.snapshot
-rw-r--r-- 1 tomcat tomcat 726000631 Mar 13 18:09 Tomcat-2015-03-13.snapshot
just seeing if I'm doing something wrong causing it to conflate
both collected for 15 min
-
- Posts: 34
- Joined: Mon Feb 02, 2015 3:14 pm
Re: misc command line questions....
sorry for the confusion... the memory is first and always fairly large.... is that just the way it is?
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: misc command line questions....
Memory snapshot contains information about all objects in the heap. It may be comparable in size (but no equal, due to different formats and data layouts) to the size of the heap of the profiled application.
Performance snapshots are usually way smaller.
And, again, the memory snapshot "contains" the performance snapshot too. In other words, memory snapshot = heap + performance snapshot.
If you care about the snapshot sizes on disk please don't capture a memory snapshot unless you really need it.
Performance snapshots are usually way smaller.
And, again, the memory snapshot "contains" the performance snapshot too. In other words, memory snapshot = heap + performance snapshot.
If you care about the snapshot sizes on disk please don't capture a memory snapshot unless you really need it.