Fully featured low overhead profiler for Java EE and Java SE platforms.
Easy-to-use performance and memory .NET profiler for Windows, Linux and macOS.
Secure and easy profiling in cloud, containers and clustered environments.
Performance monitoring and profiling of Jenkins, Bamboo, TeamCity, Gradle, Maven, Ant and JUnit.

Startup options

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 commas.

In most cases, you don't need to specify startup options, as the default settings work well. Adjust the options only when you need to change defaults or control profiler features.

Where can I specify the startup 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:
sampling

# Start with object allocation profiling:
alloc_each=100,alloc_size_limit=4096

# Snapshot directory is specified via environment variable:
dir=${SNAPSHOT_DIR}

Description of the startup options

Networking options

port=<port>

or

port=<min port>-<max port>

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.

  • Most security, the default option: listen=localhost opens the profiler agent socket on the IPv4 loopback network interface. The most commonly used IP address on the loopback network is 127.0.0.1. This will disable a direct remote connection to the agent via <host>:<port>. Connection to the profiler agent will be possible via port forwarding e.g. an SSH tunnel.
  • Easy access: listen=all opens the profiler agent socket on all network interfaces. A remote connection to the agent will be possible directly via <host>:<port>. Note that access to the port can be additionally restricted with a firewall.
  • Advanced: listen=<IP> opens the profiler agent socket on the specified IP address.
  • Block all incoming connections: listen=none blocks all incoming agent connections. Option is automatically applied when broker_url is specified.
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 option is absent, the agent will create self-signed certificate.

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 ssl_certificate_key is encrypted, then the first line of the specified password file will be used as a password (passphrase).

YourKit Connection Broker options

broker_url=<url>

Connection broker URL.

broker_token=<token>

Connection broker access token.

Main options

These options can be switched on startup only, i.e. corresponding behavior cannot be altered during runtime.

options_file=<path to options file>

or

@<path to options file>

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: options_file=profiler-options.txt or @profiler-options.txt.

delay=<milliseconds>

Postpone start of telemetry collection. This option is mostly intended to prevent startup issues of some Java servers.

By default, lightweight telemetry is collected right from the start of the profiled application.

The telemetry is collected via 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 delay option ensures that all MBeans are completely initialized before they are first accessed, by postponing the start of collecting the telemetry.

The Java EE integration wizard by default uses delay=10000 to postpone the telemetry for 10 seconds. Although not all servers (and not all versions of particular server) suffer from the problem with MBeans, it is recommended to always use the delay when profiling a Java server to ensure that any Java server can successfully start. Furthermore, the telemetry of first few seconds of the server startup is unlikely of any interest for you, because the server's internals are being initialized during that time rather than your own application code.

If the 10-second delay is not enough in your particular case, try a bigger value.

telemetry_limit=<hours>

The telemetry information is 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_limit option you can customize the time period within which the telemetry data is being stored.

Do not use unnecessarily long buffers

Extending the telemetry buffer will allocate additional amount of memory in the profiled application's address space. That is especially important for 32-bit processes because their address space is limited.

Also, the longer the buffer, the more time it takes to retrieve the telemetry information from the profiler agent when you connect to a long running profiled application.

telemetry_period=<milliseconds>

Specify how often telemetry information is obtained.

By default, the period is 1 second (1000 milliseconds).

Note that setting smaller period can add overhead.

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 <Oldest finished threads> pseudo-thread node. The intention is to limit collected data size when profiling applications constantly creating new short living threads.

on_exit=memory

Always capture a memory snapshot on profiled application exit.

If this option is not specified, the memory snapshot will be captured on exit if object allocation profiling in classic or heap sampling modes is running at that moment.

on_exit=snapshot

Always 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 in object counting mode is running at that moment.

This option is automatically added when the profiled application is started from the IDE.

on_exit=hprof

Capture a HPROF memory snapshot on profiled application exit.

dir=<directory for snapshots>

Specify custom snapshot directory for the particular profiled application

log_dir=<directory>

By default, the profiler agent log file is <user home>/.yjp/log/<application name>-<PID>.log

Use this option to create logs in different directory.

For example, it can be useful when profiling applications running as a Windows service. They usually run under special user, thus the logs are located in that special user's home directory. For example, it can be C:\WINDOWS\system32\config\systemprofile. It can be difficult to find that directory and to open it in explorer.

Instead, make the logs created in an arbitrary easily accessible directory, e.g. log_dir=c:\log

tmp_dir=<directory>

Specify alternate directory for temporary files created by the profiler agent:

  • JAR file with built-in probe classes;
  • agent-client communication buffer.

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 <application name>.<running number>.log instead of creating an individual log file <application name>-<PID>.log for each profiled process.

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 app_name=<name> for detail.

Running number starts with 1. If the first log file <application name>.1.log exceeds the size limit, a new log file <application name>.2.log will be created and used, then <application name>.3.log etc. The size limit is 1 MB by default, and can be changed with the startup option log_file_size_limit=<bytes>

Note: the oldest log files are not automatically removed. If you need to clean them up, do it manually or write a script.

app_name=<name>

Specify alternate presentable name of the profiled application used in:

  • the profiler UI;
  • snapshot names;
  • log file name.

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 {default} macro.

For example, to append the host name to the default application name, use app_name={default}-${HOSTNAME} on UNIX and app_name={default}-${COMPUTERNAME} on Windows.

snapshot_name_format=<format>

Specify alternate rule to compose snapshot file names.

Available macros:

  • {app_name} - application name
  • {date} - snapshot capture date in format 'yyyy-MM-dd'
  • {datetime} - snapshot capture date and time in format 'yyyy-MM-dd-HH-mm'
  • {pid} - profiled process ID

The default format is {app_name}-{date}.

Characters not allowed in file names, if specified, will be replaced with '-'.

snapshot_download_compression=<option>

The compression algorithm used when transferring the snapshot:

  • none - no compression.
  • deflate - deflate algorithm.
  • zstd - zstd algorithm.

The default option is zstd.

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 <user home>/.yjp/sampling_2022.txt, where user home corresponds to the account under which a profiled application is launched.

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 <user home>/.yjp/tracing_2022.txt, where user home corresponds to the account under which a profiled application is launched.

Control which profiling modes are turned on right from the start

Note that you do not have to perform measuring right from the start. Instead, in many cases it's better to start or stop measuring at a later moment - from the UI or by using the Profiler API.

sampling

Immediately start CPU profiling in the sampling mode. Note that you do not have to profile CPU right from the start; instead, in many cases it's better to start or stop measuring at a later moment - from the UI or by using the Profiler API.

async_sampling_cpu

Immediately start CPU profiling in the asynchronous CPU sampling mode. Note that you do not have to profile CPU right from the start; instead, in many cases it's better to start or stop measuring at a later moment - from the UI or by using the Profiler API. This option cannot be used in combination with disable_async_sampling.

async_sampling_periodic

Immediately start CPU profiling in the asynchronous periodic sampling mode. Note that you do not have to profile CPU right from the start; instead, in many cases it's better to start or stop measuring at a later moment - from the UI or by using the Profiler API. This option cannot be used in combination with disable_async_sampling.

tracing

Immediately start CPU profiling in the tracing mode. Note that you do not have to profile CPU right from the start; instead, in many cases it's better to start or stop measuring at a later moment - from the UI or by using the Profiler API. This option cannot be used in combination with disable_tracing.

call_counting

Immediately start CPU profiling in the call counting mode. Note that you do not have to profile CPU right from the start; instead, in many cases it's better to start or stop measuring at a later moment - from the UI or by using the Profiler API. This option cannot be used in combination with disable_tracing.

alloc_each=<N>

Immediately start object allocation profiling in the classic mode, recording each N-th allocation.

This option can be used in combination with alloc_size_limit (the other option controlling the classic mode), but is mutually exclusive with alloc_object_counting (the object counting mode) and alloc_heap_sampling (the heap sampling mode).

This option cannot be used in combination with disable_alloc and disable_heap_sampling on Java 11+, or with disable_alloc alone on an older Java version.

(Since 2016.02) To record only those objects whose size exceeds the threshold set with alloc_size_limit please specify alloc_each=0.

Note that you do not have to record allocations right from the start; instead, you can start or stop profiling later from the profiler UI or using Profiler API.

alloc_size_limit=<size in bytes>

Immediately start object allocation profiling in the classic mode, recording allocation of all objects with size bigger than or equal to the specified value.

This option can be used in combination with alloc_each (the other option controlling the classic mode), but is mutually exclusive with alloc_object_counting (the object counting mode) and alloc_heap_sampling (the heap sampling mode).

This option cannot be used in combination with disable_alloc and disable_heap_sampling on Java 11+, or with disable_alloc alone on an older Java version.

Note that you do not have to record allocations right from the start; instead, you can start or stop profiling later from the profiler UI or using Profiler API.

alloc_sampled

Use sampled object allocation profiling. This option influences only object allocation profiling in the classic mode, which is started with alloc_each and/or alloc_size_limit.

alloc_heap_sampling=<N>

Immediately start object allocation profiling in the heap sampling mode. Heap sampling uses the JVM heap sampling event available in Java 11+ to record objects created after allocating each N bytes on average.

This option is mutually exclusive with alloc_each and alloc_size_limit (the classic mode) and alloc_object_counting (the object counting mode).

This option cannot be used in combination with disable_heap_sampling.

Note that you do not have to record allocations right from the start; instead, you can start or stop profiling later from the profiler UI or using Profiler API.

alloc_object_counting

Immediately start object allocation profiling in the object counting mode.

This option is mutually exclusive with alloc_each and alloc_size_limit (the classic mode) and alloc_heap_sampling (the heap sampling mode).

This option cannot be used in combination with disable_alloc and disable_heap_sampling on Java 11+, or with disable_alloc alone on an older Java version.

Note that you do not have to record allocations right from the start; instead, you can start or stop profiling later from the profiler UI or using Profiler API.

monitors

Immediately start monitor profiling. Note that you do not have to profile monitors right from the start. You have the flexibility to start or stop profiling at any later time through the profiler UI or using Profiler API.

used_mem=<percent>

Automatically capture a memory snapshot when used heap memory reaches the threshold.

Note: this option just adds corresponding trigger on startup. Use triggers directly for a more sophisticated functionality.

used_mem_hprof=<percent>

Automatically capture a HPROF snapshot when used heap memory reaches the threshold.

Note: this option just adds corresponding trigger on startup. Use triggers directly for a more sophisticated functionality.

periodic_perf=<period in seconds>

Periodically capture performance snapshots.

Note: this option just adds corresponding trigger on startup. Use triggers directly for a more sophisticated functionality.

periodic_mem=<period in seconds>

Periodically capture memory snapshots in the profiler's format (*.snapshot).

Note: this option just adds corresponding trigger on startup. Use triggers directly for a more sophisticated functionality.

periodic_hprof=<period in seconds>

Periodically capture HPROF snapshots.

Note: this option just adds corresponding trigger on startup. Use triggers directly for a more sophisticated functionality.

threads=full|states|off

The threads option regulates the collection of data specific to the threads within a profiled application. In most cases, collecting this information does not result in significant overhead. However, it is sensible to turn it off on production servers to ensure minimal profiling overhead.

  • full - The default value. Collect both thread states and stacks.
  • states - Collect only thread states.
  • off - Do not collect thread states and stacks.
exceptions=on

Enable exception events in the JVM and immediately start the exception profiling.

This is the default mode on Oracle JDK and OpenJDK HotSpot, i.e. non-IBM JVMs.

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 events in the JVM to totally eliminate corresponding overhead. The exception profiling will not be available.

This is the default mode on IBM JVMs because the overhead is significant.

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.

probe_on=<pattern>

probe_off=<pattern>

probe_auto=<pattern>

probe_disable=<pattern>

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

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 <user home>/.yjp/triggers.txt, where user home corresponds to the account under which a profiled application is launched.

By default, that file does not exist, thus no triggers are applied.

Optimization and troubleshooting options

Reduce profiling overhead or troubleshoot stability issues by disabling some profiling capabilities.

These options can be switched on startup only, i.e. corresponding behavior cannot be altered during runtime.

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.
quiet=true|false

The quiet option suppresses or allows printing occasional agent messages to stdout and stderr, such as printing agent log path on application startup.

  • true - The default value. Suppresses agent messages to stdout and stderr.
  • false - Allows agent messages to stdout and stderr.
disable_alloc

Do not instrument bytecode with instructions needed for object allocation profiling.

disable_alloc is implied if the heap sampling event is available (Java 11+) and disable_heap_sampling is not specified.

disable_heap_sampling

Use bytecode instrumentation for object allocation profiling instead of the heap sampling event introduced in Java 11. If disable_alloc or disable_all are also specified, object allocation profiling will not be available.

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.

Try this option as a workaround if you experience crashes of an IBM JVM.

disable_all

Disable several capabilities at once: disable_async_sampling, disable_alloc, disable_natives, disable_tracing, exceptions=disable, probe_disable=*, telemetry=off, threads=off


YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content, 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.