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 counting

How object counting works

Object counting is the most lightweight allocation profiling mode in YourKit Java Profiler. The profiler uses bytecode instrumentation to injects lightweight hooks at the points where objects are created. In this mode, only the number, size, and types of created objects are recorded. The performance impact is minimal, with overhead comparable to incrementing an integer counter.

Advantages

  1. This is an extremely lightweight mode. Thanks to its low overhead, object counting can be used in production.
  2. Object counting records the class and method where the object was created, as well as the type of the created object. For each class and method, it also records the cumulative number of created objects and their total size.

Disadvantages

  1. The thread in which the object was created and the full stack trace are not available.
  2. Instrumentation increases bytecode size and slows down class loading. In some cases, such as very long Java methods, instrumentation may not be possible if the method's bytecode exceeds the size limit.

YourKit uses cookies and other technologies to improve your browsing experience on our website, to show you personalized content, 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 YourKit privacy policy.