- System requirements
- Profiler architecture
- Profiler installation
- Uninstall profiler
- Running the profiler
- Profiler activation
- Welcome screen
- Start profiling
- Profiling overhead
- Snapshots
- Solving performance problems
- CPU profiling
- Thread profiling
- Virtual threads support
- Object allocation profiling
- Memory profiling
- Monitor profiling
- Exception profiling
- JFR (Java Flight Recorder)
- Telemetry
- Probes: monitor events of various kinds
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Automatic deobfuscation
- Summary
- Filters
- Profiler command line
- Export of profiling results to external formats
- Profiler Java API
- Profiler HTTP API
- Settings
- Troubleshooting and FAQ
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
- This is an extremely lightweight mode. Thanks to its low overhead, object counting can be used in production.
- 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
- The thread in which the object was created and the full stack trace are not available.
- 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.