what is wrong with this start alloc statement

Questions about YourKit Java Profiler
Post Reply
Michael.Scaman
Posts: 34
Joined: Mon Feb 02, 2015 3:14 pm

what is wrong with this start alloc statement

Post by Michael.Scaman »

java -jar /var/lib/yjp-2015-build-15058/lib/yjp-controller-api-redist.jar localhost 10005 start-alloc-recording-adaptive

( in the script iyjp complains ... saying.. )
YourKit Java Profiler 2015 build 15058 command line tools

Usage: java -jar yjp-controller-api-redist.jar <host> <port> <command>

where <command> is one of:

print-current-status
capture-memory-snapshot
capture-hprof-snapshot
capture-performance-snapshot
start-cpu-sampling
start-cpu-tracing
stop-cpu-profiling
clear-cpu-data
start-alloc-recording-all
// record all objects
start-alloc-recording-adaptive [alloc-sampled]
// record all objects with size >= 4 KB, and only each 10th smaller object
stop-alloc-recording
clear-alloc-data
start-monitor-profiling
stop-monitor-profiling
clear-monitor-data


but... outside the script

java -jar /var/lib/yjp-2015-build-15058/lib/yjp-controller-api-redist.jar localhost 10005 start-alloc-recording-adaptive
Allocation recording started

why?
Michael.Scaman
Posts: 34
Joined: Mon Feb 02, 2015 3:14 pm

Re: what is wrong with this start alloc statement

Post by Michael.Scaman »

seems I tell it to stop recording alloc ... but it still thinks it's recording

Allocation data cleared
Allocation recording stopped
java -jar /var/lib/yjp-2015-build-15058/lib/yjp-controller-api-redist.jar localhost 10005 start-alloc-recording-all
YourKit Java Profiler 2015 build 15058 command line tools

Usage: java -jar yjp-controller-api-redist.jar <host> <port> <command>

where <command> is one of:

print-current-status
capture-memory-snapshot
capture-hprof-snapshot
capture-performance-snapshot
start-cpu-sampling
start-cpu-tracing
stop-cpu-profiling
clear-cpu-data
start-alloc-recording-all
// record all objects
start-alloc-recording-adaptive [alloc-sampled]
// record all objects with size >= 4 KB, and only each 10th smaller object
stop-alloc-recording
clear-alloc-data
start-monitor-profiling
stop-monitor-profiling
clear-monitor-data

Examples:
java -jar yjp-controller-api-redist.jar localhost 10001 capture-memory-snapshot
java -jar yjp-controller-api-redist.jar localhost 10001 start-cpu-sampling

java -jar /var/lib/yjp-2015-build-15058/lib/yjp-controller-api-redist.jar localhost 10005 start-monitor-profiling
Exception in thread "main" com.yourkit.runtime.PresentableException: Cannot start monitor profiling: Already started
at com.yourkit.runtime.Packet.readHeader(Packet.java:64)
at com.yourkit.runtime.Packet.readHeader(Packet.java:83)
at com.yourkit.runtime.Packet.readHeaderWithStandardResponse(Packet.java:73)
at com.yourkit.api.ControllerImpl$8.perform(ControllerImpl.java:417)
at com.yourkit.api.ControllerImpl.makeRequest(ControllerImpl.java:217)
at com.yourkit.api.ControllerImpl.startMonitorProfiling(ControllerImpl.java:411)
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: what is wrong with this start alloc statement

Post by Anton Katilin »

As the message says, the exception is thrown because the requested profiling mode is already on.

The same issue is discussed here: http://forums.yourkit.com/viewtopic.php?f=3&t=9912
Post Reply