previous      content      next
Allocation recording

YourKit Java Profiler can optionally record object allocations, that is, track method call stacks where objects are created. Memory snapshots captured when allocations are being recorded contain allocation information. If an object was created when allocations were not being recorded, or recording was stopped at least once after the object had been created, snapshot will contain no allocation information for that object.

Recording of allocations adds performance overhead. This is the reason why allocations should not be recorded permanently. Instead, it is recommended to record allocations only when you really need them.

The allocation can be recorded in 2 ways:

  • Adaptively, skipping allocation events for some percent of objects in order to keep moderate overhead. Adaptive recording results are sufficient to find excessive garbage allocation while keeping profiling overhead at a much lower level.
  • For each created object: This mode may be used in rare cases e.g. when allocation information for some particular object must be obtained.

You can control recording of allocations from UI, or via Profiler API. You can also record allocations from the start of application execution (see Running applications with Profiler).

You can start and stop recording of allocations during execution of your application as many times as you wish. When allocations are not recorded, memory profiling adds no performance overhead to the application being profiled.

Allocation recording is useful to find the excessive garbage collection

previous      content      next