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.

In order to keep moderate overhead, it is reasonable to skip allocation events for some percent of objects. This approach is useful to find the excessive garbage collection.

Also, you can record allocations for each object with size bigger than certain threshold. It is valuable to know where the biggest objects are allocated. Normally there are not so many such big objects, thus recording their allocation should not add any significant overhead.

In some rare cases you can record each created object e.g. when allocation information for some particular object must be obtained. To achieve this, set "Record each" to 1.

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.

Recorded allocations are shown in Allocations view, Garbage collection view and Quick info

previous      content      next