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.

Object allocation recording

The 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.

1. Ensure object allocation recording is enabled in your profiled application

Due to performance considerations, object allocation recording is not always enabled. You should explicitly enable it when starting your profiled application.

With object allocation recording enabled, even if allocations are not actually being recorded, there is some overhead to the application being profiled. The overhead depends on the number of created objects; in most cases it is not significant (less than 3-5%).

2. Start object allocation recording

Connect to running profiled application and start object allocation recording with the help of corresponding toolbar button:

In some cases, it may be useful to immediately start object allocation recording as soon as profiled application starts. Please find corresponding option on the Welcome screen.

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 also control recording of allocations via profiler API.

3. Allocation telemetry

Allocation telemetry is available when allocations are being recorded. However, it provides only basic information. For comprehensive analysis, capture a memory snapshot (see below).

4. Capture snapshot

Capture memory snapshot for analysis of recorded allocation information.

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

If you capture a performance snapshot instead, only allocation telemetry will be available.

Notes

You can start and stop object allocation recording during execution of your application as many times as you wish.

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.