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.

Comparing memory snapshots

This feature lets you compare any two memory snapshots.

To locate memory leaks, consider using the object generations feature.

To compare snapshots:

  • Open both snapshots.
  • Select one of them.
  • Use File | Compare Snapshot with... (also available from the popup menu) and select the snapshot to compare with.

When comparing memory snapshots, there is an option to choose objects of which reachability scopes to be included to the comparison results:

reachability dialog

The Comparison tab with memory views Classes and Classes and packages will open. The views have 2 columns: Objects (+/-) and Size (+/-). These display the differences in object counts and sizes. Positive values mean that Snapshot 2 (the later memory state) has more objects and/or its objects have the bigger total size.

memory snapshot comparison

100% of size corresponds to the total size of all objects in the old snapshot. Likewise, 100% of count corresponds to the object count in the old snapshot.

Please note that memory snapshot comparison provides only object count and size difference, it cannot tell which particular objects have gone or have been created between the snapshots being compared. This is because an object in the JVM heap does not essentially have a persistent ID. An object identifier is valid in particular snapshot only, it is in fact the object's physical address which may alter when the garbage collector compacts the heap or moves objects between heap generations. To address this limitation and enable object identification, YourKit profiler offers the object generations feature whose implementation involves object tagging with the help of the JVMTI API.

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.