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 customization

Quick overview

Snapshot directory is the directory where snapshot files are created.

By default, the snapshot directory is <user home>/Snapshots

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

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.

Detailed description

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

Action Settings | Snapshot Directory... stores the specified directory in file <user home>/.yjp/snapshotdir.txt

This is a text file in UTF-8 encoding. The file may not exist until you customize the directory first time.

When the profiler UI and the profiled application run under the same user, the situation is very simple: snapshots are stored in the directory specified in <user home>/.yjp/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 different user (e.g. it is started as a service), the profiler UI and the profiler agent loaded as a part of the profiled application will have different home directories and different access rights to file system. As the result, the directory which you have configured in the profiler UI can be inaccessible for 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

Performance snapshots of local or remote applications captured from within the profiler UI, transferred memory snapshots of remote applications, or snapshots unpacked opening ZIP/GZIP archives:

Snapshot is created by UI user in

  • the directory specified in <UI user home>/.yjp/snapshotdir.txt, if the file contains a directory to which UI user has read and write access
  • <UI user home>/Snapshots

Memory snapshots of local applications captured from within the profiler UI

Snapshot is 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>/.yjp/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>/.yjp/snapshotdir.txt, if the file contains a directory to which agent user has read and write access
  • <agent user home>/Snapshots

Snapshots captured on exit, on trigger, via the profiler API or command line tool

Snapshot is 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>/.yjp/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 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.