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

Command line tool to control profiling

Command line tool is another way to control profiling, in addition to the profiler UI and API.

It has much in common with API and may also be used for automated profiling. You may prefer the command line tool to API in some cases as an easier solution not requiring any Java code to be written. However the command line tool provides less functionality than the API.

Also, the command line tool may be useful in remote profiling when you only have console access to the remote machine and no UI is available.

Also consider connecting to a remote application from a locally running profiler UI, which may be a better approach.

To get list of available commands, run:
java -jar <Profiler Installation Directory>/lib/yjp-controller-api-redist.jar

Usage:
java -jar <Profiler Installation Directory>/lib/yjp-controller-api-redist.jar <host> <port> <command>

Available commands

Command Description
status

Print profiled application's name, PID, agent's host and port and which profiling modes are running.

capture-memory-snapshot

Capture memory snapshot.

capture-hprof-snapshot

Capture HPROF snapshot.

capture-performance-snapshot

Capture performance snapshot.

start-sampling

Start CPU profiling in the sampling mode.

start-async-sampling-cpu

Start CPU profiling in the asynchronous sampling mode.

start-tracing

Start CPU profiling in the tracing mode.

start-call-counting

Start CPU profiling in the call counting mode.

stop-cpu-profiling

Stop CPU profiling.

clear-cpu-data

Clear CPU profiling results and continue profiling.

start-alloc-recording-all [alloc-sampled]

Start object allocation recording and record all objects.
Pass alloc-sampled to get estimated stacks instead of exact stacks.

start-alloc-recording-adaptive [alloc-sampled]

Start object allocation recording and record all objects with size >= 4 KB, and only each 10th smaller object.
Pass alloc-sampled to get estimated stacks instead of exact stacks.

start-alloc-recording= <N>,<B> [alloc-sampled]

Start object allocation recording and record all objects with size >= B bytes, and only each N-th smaller object.
Pass alloc-sampled to get estimated stacks instead of exact stacks.

stop-alloc-recording

Stop object allocation recording.

clear-alloc-data

Clear recorded object allocations.

print-alloc-object-count

Get total count of all objects created during object allocation recording. The returned value grows monotonically: the underlying counter is not zeroed when allocation recording is re-started or allocation results are cleared.

print-alloc-object-size

Get total size in bytes of all objects created during object allocation recording. The returned value grows monotonically: the underlying counter is not zeroed when allocation recording is re-started or allocation results are cleared. Note: the value is only updated in the full recording mode, it is not updated in the object counting mode.

start-monitor-profiling

Start monitor profiling.

stop-monitor-profiling

Stop monitor profiling.

clear-monitor-data

Clear monitor profiling data.

start-stack-telemetry

Start collecting thread stack and state telemetry.

stop-stack-telemetry

Stop collecting thread stack and state telemetry.

force-gc

Forces garbage collection in the profiled application.

clear-charts

Clear all charts.

Examples

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

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.