- System requirements
- Profiler architecture
- Profiler installation
- Uninstall profiler
- Running the profiler
- Profiler activation
- Welcome screen
- Start profiling
- Profiling overhead
- Snapshots
- Solving performance problems
- CPU profiling
- Thread profiling
- Virtual threads support
- Object allocation profiling
- Memory profiling
- Monitor profiling
- Exception profiling
- JFR (Java Flight Recorder)
- Telemetry
- Probes: monitor events of various kinds
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Automatic deobfuscation
- Summary
- Filters
- Profiler command line
- Export of profiling results to external formats
- Profiler Java API
- Profiler HTTP API
- Settings
- Troubleshooting and FAQ
Agent startup options
Agent startup options are passed to the profiler agent and take effect as soon as the Java application starts. The options are a comma-separated list. You can specify multiple options by separating them with comma.
Where can I specify the startup options?
- IDE plugin if you start the profiled application from IDE.
- Java server integration wizard if you profile a Java server.
- Agent command line options.
Environment variable substitution
It is possible to use environment variables in the startup options
with the ${VARIABLE} syntax.
Substitutions are helpful for options which are not known until execution time.
If an environment variable is not set, it will be replaced with an empty string.
For example, if environment variable SNAPSHOT_DIR is set to /tmp/snapshots,
then startup option dir=${SNAPSHOT_DIR} evaluates to
dir=/tmp/snapshots.
Options file
If you need to specify a lot of agent options, or use same options for multiple projects
you may find useful options_file option.
In options file you can specify agent options as usual, but also separate them line by line without commas.
Comment lines are denoted by the # as the first non-blank character,
in which all remaining text on that line is ignored.
And of course you can use environment variables in options file too.
Options file must be in UTF-8 encoding.
Options file example:
# Start with CPU profiling:
cpu=sampling
# Start with object allocation profiling:
alloc=bci,alloc_interval=4096
# Snapshot directory is specified via environment variable:
dir=${SNAPSHOT_DIR}
Options
Connectivity |
|
|
or
|
Specify the port that the profiler agent listens on for communication with the profiler UI. By default, the port is chosen automatically: if port 10001 is free, it is used; otherwise, if port 10002 is free, it is used etc. If no port in the range 10001..10010 is free, an arbitrary free port is used. If port range is specified, profiler will choose first free port in the range. |
listen=<option>
|
Specify the profiler agent connectivity option.
|
ssl_certificate=<path to SSL certificate>
|
File with the SSL certificate in the PEM format. If intermediate certificates should be specified in addition to a primary certificate, they should be specified in the same file in the following order: the primary certificate comes first, then the intermediate certificates.
If the |
ssl_certificate_key=<path to secret key>
|
File with the secret key in the PEM format. |
ssl_password_file=<path to password file>
|
If the secret key |
YourKit Connection Broker options |
|
broker_url=<url>
|
Connection broker URL. |
broker_token=<token>
|
Connection broker access token. |
CPU profiling |
|
cpu=off |
Don not immediately start CPU profiling that can instead be started later in runtime. This is the default. |
cpu=sampling |
Immediately start CPU profiling in the sampling mode. |
cpu=async_sampling_cpu |
Immediately start CPU profiling in the asynchronous CPU sampling mode. |
cpu=async_sampling_periodic |
Immediately start CPU profiling in the asynchronous periodic sampling mode. |
cpu=tracing |
Immediately start CPU profiling in the tracing mode. |
cpu=counting |
Immediately start CPU profiling in the call counting mode. |
sampling_settings_path=<file path> |
Specify a custom location of the CPU sampling settings configuration file.
If this option is not specified,
the settings are read from
|
tracing_settings_path=<file path> |
Specify a custom location of the CPU tracing settings configuration file.
If this option is not specified,
the settings are read from
|
Allocation profiling |
|
alloc=off |
Do not immediately start object allocation profiling that can instead be started later in runtime. This is the default. |
alloc=bci |
Immediately start object allocation profiling in the bytecode instrumentation mode. |
alloc=heap_sampling |
Immediately start object allocation profiling in the heap sampling mode. |
alloc=counting |
Immediately start object allocation profiling in the object counting mode. |
alloc_interval=<size in bytes> |
A default interval for
|
Telemetry |
|
telemetry=on |
Immediately start telemetry collection. This is the default mode. |
telemetry=off |
Do not immediately start telemetry collection that can instead be started later in runtime. |
telemetry_limit=<hours> |
The telemetry and thread profiling results are remembered in a circular buffer in the profiler agent memory. This allows you to connect to a profiled application on demand and discover how the application behaved in the past. By default, the telemetry buffer is limited to store approximately 1 hour of recent telemetry data.
With the help of the |
telemetry_period=<milliseconds> |
Specify how often telemetry and thread profiling information is obtained. By default, the period is 1 second (1000 milliseconds). Note that setting smaller period can add overhead. |
Thread profiling |
|
threads=full|states|off
|
The
|
deadlocks=on |
Enable periodic JVM deadlock checks. This is the default mode. |
deadlocks=off |
Disable periodic JVM deadlock checks. |
deadlocks_check_period=<seconds> |
Specify how often deadlock checks are performed. By default, the period is 300 seconds (5 minutes). |
Exception profiling |
|
exceptions=on |
Enable exception events in the JVM and immediately start the exception profiling. This is the default mode. |
exceptions=off |
Enable exception events in the JVM but do not immediately start the exception profiling that can instead be started later in runtime. |
exceptions=disable |
Fully disable exception profiling and totally eliminate related overhead. The exception profiling will not be available. |
Monitor profiling |
|
monitors=on |
Immediately start monitor profiling. |
monitors=off |
Do not immediately start monitor profiling that can instead be started later in runtime. This is the default. |
Flight recording |
|
jfr=on |
Immediately start flight recording
at application startup,
using the |
jfr=off |
Do not start flight recording at application startup. The recording can be started later during application runtime. This is the default. |
jfr_config_name=<name> |
Optional name of the flight recording configuration
to start at application startup.
If not specified, the |
jfr_max_size=<size in megabytes> |
Optional maximum size of the flight recording
started at application startup.
Use |
Snapshots |
|
dir=<directory for snapshots>
|
Specify custom snapshot directory for the particular profiled application |
snapshot_name_format=<format> |
Specify alternate rule to compose snapshot file names. Available macros:
The default format is Characters not allowed in file names, if specified, will be replaced with '-'. |
on_exit=jfr |
Capture JFR snapshot on profiled application exit. If this option is not specified, the JFR snapshot will be captured on exit if flight recording is running at that moment. |
on_exit=hprof |
Capture HPROF memory snapshot on profiled application exit. |
on_exit=memory |
Capture a memory snapshot on profiled application exit. |
on_exit=snapshot |
Capture a performance snapshot on profiled application exit. If this option is not specified, the performance snapshot will be captured on exit if CPU profiling, monitor profiling or object allocation profiling is running at that moment. This option is automatically added when the profiled application is started from the IDE. |
Triggers |
|
triggers=<file path> |
Specify the file with description of the triggers to be applied from startup.
If this option is not specified, the trigger description is read from
By default, that file does not exist, thus no triggers are applied. |
used_mem=<percent> |
Adds a trigger to automatically capture a memory snapshot when used heap memory reaches the threshold. |
used_mem_hprof=<percent> |
Adds a trigger to automatically capture HPROF snapshot when used heap memory reaches the threshold. |
periodic_perf=<period in seconds> |
Adds a trigger to periodically capture performance snapshots. |
periodic_mem=<period in seconds> |
Adds a trigger to periodically capture memory snapshots in the profiler's format (*.snapshot). |
periodic_hprof=<period in seconds> |
Adds a trigger to periodically capture HPROF snapshots. |
triggers_out_dir=<directory> |
Specifies the top-level directory where a trigger action is allowed to create or modify files. All file paths used in a trigger action are interpreted as relative to this directory.
By default, the directory is set to
The purpose of |
Events and probes |
|
|
|
Specify which probes should be registered on startup. Read more... |
probe_classpath=<classpath> |
Specify where to find probe class(es) which are registered by class name. Read more... |
probe_bootclasspath=<classpath> |
Specify where to find probe class(es) which are registered by class name. Read more... |
Miscellaneous |
|
|
or
|
Specify a path to the options file with agent startup options. Options from the options file will be used as if they were directly specified in its place, in order they are written in the file.
Example:
|
app_name=<name> |
Specify alternate presentable name of the profiled application used in:
If this option is not specified, the application name is automatically chosen based on its main jar file name, or its main class name, or the custom executable name, or on the run configuration name when profiling from within the IDE.
The default automatically generated application name can be specified via
For example, to append the host name to the default application name, use
|
log_dir=<directory> |
Specifies the directory where profiler agent creates a log file.
By default, the profiler agent log file is
Use the
This can be particularly useful when profiling applications that run
as Windows services.
Such services typically run under a special system account,
so their logs are placed in that account's home directory
(for example:
With |
tmp_dir=<directory> |
Specify alternate directory for temporary files created by the profiler agent:
By default, the profiler agent creates the temporary files in the default temporary directory. |
united_log |
Store logs from several runs of the same application
as a series of log files named This mode may simplify log maintenance and cleanup when profiling applications such as servers.
Application name is the presentable name of the application;
see the startup option
Running number starts with 1.
If the first log file <application name> Note: the oldest log files are not automatically removed. If you need to clean them up, do it manually or write a script. |
probe_table_length_limit=<rows>
|
Limit the number of rows to be stored by the profiler agent per table. The default value is 100,000. Read more... |
dead_thread_limit=<threads> |
Specify the number of recently finished threads for which
profiling results are kept. The default value is 50.
Profiling results for the finished threads beyond this limit are merged to
|
Optimization and troubleshooting optionsReduce profiling overhead or troubleshoot stability issues by disabling some profiling capabilities. |
|
delay=<milliseconds>
|
Postpone start of telemetry collection and deadlock checks. This option is mostly intended to prevent startup issues of some Java servers. By default, telemetry is collected right from the start of the profiled application. These features use so-called platform MBeans ("managed beans") - the components for monitoring and managing the JVM. Some Java servers install their own implementations of standard MBeans. In earliest stages of the server startup the MBeans can not be functional because they depend on other components of the server (such as custom logging) which have not initialized so far. Accessing such MBeans in the earliest stages can cause the server startup failure (e.g. with ClassNotFoundException).
The
The Java EE integration wizard by default uses If the 10-second delay is not enough in your particular case, try a bigger value. |
disable_oome_dumper |
Disable on OutOfMemoryError snapshots. Note that enabling on OutOfMemoryError snapshots adds absolutely no overhead. If OutOfMemoryError happens, memory snapshot is written to disk for further analysis. You may want to disable the snapshots in some very special situations, e.g. if you profile an application with a huge heap, for which capturing the snapshot may take significant resources (time and/or disk space), but do not plan to perform its memory analysis. |
disable_alloc |
Do not instrument bytecode with instructions needed for object allocation profiling. Bytecode instrumentation and object counting mode won't be available. |
disable_heap_sampling |
Disable object allocation profiling in heap sampling mode. |
disable_tracing |
Do not instrument bytecode with instructions needed for CPU tracing. Both CPU tracing and call counting will not be available. |
disable_async_sampling |
Disables asynchronous sampling capabilities. |
disable_natives |
Do not wrap native methods for bytecode instrumentation. When this option is specified, native methods will not be shown in CPU tracing results and in events recorded with probes if they depend on native method invocations. |
disable_all |
Disable several capabilities at once:
|
quiet=true|false |
The
|
snapshot_download_compression=<option> |
The compression algorithm used when transferring the snapshot:
The default option is |
verbose |
Increase the level of detail in the agent's log file. When this option is specified, the profiler agent will produce more detailed diagnostic information. |