previous      content      next
Leak detection: working with paths

YourKit Java Profiler provides a unique and very powerful way to detect memory leak - calculation of paths between objects in memory.
A path is a very simple and intuitive concept. A path between Object 1 and Object n is a sequence of objects where:

  • First element is Object 1
  • Each element in the sequence, starting with the second one, is referenced from its predecessor
  • Last element is Object n

There are two actions in YourKit Java Profiler for finding paths:

  • Select an object and use Memory | Paths from GC Roots... (Ctrl+P) to find out why that object is retained in memory. This action is needed when you have found a leaked object and want to fix the memory leak.
  • Memory | Paths between Predefined Sets... is the most common way to find out how an object of the source set references objects of the target set.

You can limit the number of paths to find. It is guaranteed that the shortest paths are found first, i.e. there are no paths shorter than the ones displayed.

previous      content      next