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.

Snapshot directory

Snapshot directory is the directory where snapshot files are created. By default, the snapshot directory is <user home>/Snapshots.

For some reason you may want to change the snapshot directory location. For example, the user home can be located on a disk with insufficient free space, or on a network drive with slow access. To change the snapshot directory, use Settings | Snapshot Directory... in the main menu.

Snapshots in Docker container

For security purposes, the user home directory in a docker container may not exist or may be read-only. In this case the default snapshot directory will be /tmp.

Detailed description

This is an advanced topic. It contains technical details that you do not normally have to know to profile your applications.

Action Settings | Snapshot Directory... stores the specified directory in the file <user home>/.ynp/snapshotdir.txt. This is a text file encoded in UTF-8. The file may not exist until you customize the directory for the first time.

When the profiler UI and the profiled application run under the same user, the situation is straightforward: snapshots are stored in the directory specified in <user home>/.ynp/snapshotdir.txt, or, if the file does not exist or defines an invalid directory, the default location <user home>/Snapshots will be used.

When the profiled application runs under a different user (e.g., it is started as a service), the profiler UI and the profiler agent will have different home directories and different access rights to the file system. As a result, the directory you configured in the profiler UI may be inaccessible to the profiled application, and your setting will be ignored.

Please find below detail on the order in which the snapshot directory is chosen in different cases. We will refer the user which runs the profiler UI as ui_user, and the user which runs the profiled application as agent_user. These can be the same user or different users, as mentioned above.

The basic idea is: if possible, use the directory configured in the profiler UI, otherwise use settings in the profiled application user home.

  1. Performance snapshots of local or remote applications captured from within the profiler UI, downloaded snapshots of remote applications, or uncompressed snapshots from archives are created by ui_user in:

    • The directory specified in <UI user home>/.ynp/snapshotdir.txt, if the file contains a directory to which ui_user has read and write access.
    • <UI user home>/Snapshots
  2. Memory snapshots of local applications captured from within the profiler UI are created by agent_user in:

    • The directory specified with dir startup option of the profiled application, if specified.
    • The directory specified in <UI user home>/.ynp/snapshotdir.txt, if the file exists and contains a directory to which agent_user has read and write access.
    • <UI user home>/Snapshots if agent_user has read and write access.
    • The directory specified in <agent user home>/.ynp/snapshotdir.txt, if the file contains a directory to which agent_user has read and write access.
    • <agent user home>/Snapshots.
  3. Snapshots captured on exit, on trigger or via the profiler API are created by agent_user in:

    • The directory specified with dir startup option of the profiled application, if specified.
    • The directory specified in <agent user home>/.ynp/snapshotdir.txt, if the file contains a directory to which agent_user has read and write access.
    • <agent user home>/Snapshots.

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.