A memory snapshot represents the memory state of the profiled application at the moment it was captured. It contains information about all classes loaded by JVM, about all existing objects, and about references between objects.
Snapshots can contain values of fields and arrays of primitive types (int, long, char etc.). Read more.
Optionally, snapshot can contain information about object allocations.
Note: If the profiled application ran on Java 5 / JVMTI, recorded lengths of arrays are not exact. Instead they are estimated based on the size of the array as a whole and the size of one array element. The reason is that Java 5 provides no reasonably fast ways to get the exact values. This issue has been solved in Java 6 by extending JVMTI API with the appropriate means.
Inaccessible objects are treated as if they were already collected
When a snapshot is opened in the profiler, objects that are not referenced and thus can be collected are treated as collected. It is also assumed that all weak and soft references are nulled, and the objects accessible by only weak or soft references are treated as collected. This simplifies memory leak detection and helps you focus on the real, "hard referenced" problems.
In a very special case, you may want to keep weak/soft references. To achieve this, specify
properties '-Dyjp.keep.weak.refs=true' and/or '-Dyjp.keep.soft.refs=true':
- Under Windows, alter
<YourKit Java Profiler Home>\bin\win32\yjp.ini. - Under Linux, Solaris or Mac OS X, you will need to patch the command line in
yjp.sh.
Note: These are experimental options and may be dropped in future releases.
Snapshot formats
You have an option to capture snapshot in YourKit Java Profiler format or via JVM built-in dumper:
Read more about HPROF snapshots.
