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.

Memory inspections

See also Event inspections

Typical memory-related problems can be recognized with the help of the Inspections feature. Inspections enable automatic high-level analysis of application memory. Each inspection automatically detects a specific memory issue. Performing this type of analysis by hand would be a very complicated (if at all possible) task.

With the help of inspections you can easily find the causes and possible solutions of usual memory-related problems.

The Inspections view is added to any objects view, such as Memory or a tab representing a subset of objects. Inspections for all objects (i.e. for the entire snapshot) are also available via top-level tab Inspections.

Inspections view

(1) To run all inspections as a batch use Run All Inspections button.

(2) To run a single inspection, select it in the tree and use Run This Inspection Only button (this is especially useful if you want to apply the changes made to an inspection's options).

All inspections are grouped by category:

Duplicate Strings

Find all System.String's with identical text values.
Problem: Duplicate strings waste memory.
Possible solution: Share string instance via pooling or using intern().

Duplicate Objects

Find objects of the same class equal field by field, and arrays equal element by element.
Problem: duplicate instances waste memory.
Possible solution: reduce the number of instances by sharing, lazily creating, not storing permanently.

Zero Length Arrays

Find multiple instances of zero-length arrays of particular type.
Problem: Memory waste and additional load for garbage collector.
Possible solution: Use empty array per-class singleton e.g. via a static field in class.

Null Fields

Find instance fields with high percentage of 'null' values.
Problem: Possible memory waste.
Possible solutions: If some of the fields are not used, get rid of them rarely assigned fields can be moved to subclasses in the class hierarchy.

Sparse Arrays

Find arrays with big number of 'null' elements.
Problem: Possible memory waste.
Possible solution: Use alternate data structures e.g. maps or rework algorithms.

Sparse Primitive Arrays

Find arrays of primitive types with big number of 0 elements.
Problem: Possible memory waste.
Possible solution: Use alternate data structures e.g. maps or rework algorithms.

Arrays with all the same elements

Find arrays such that all their elements are the same.
Problem: possible memory waste.
Possible solution: use alternate data structures e.g. maps or rework algorithms.

Dictionary Hash Code Distribution

Find Dictionaries with non-uniformly distributed hash codes.

To achieve good Dictionary performance, hash codes of objects used as keys should be uniformly distributed. Otherwise, collection access performance degrades due to hash collisions. The inspection finds Dictionaries with entries most unevenly distributed among buckets.

Possible solution: consider better GetHashCode() implementation for objects used as keys, or use wrappers with properly implemented GetHashCode().

Highly Referenced Objects

Find objects referenced by a large number of other objects.
Possible problems: Incorrect relations between objects in memory, logical errors and/or non-optimal data structures.

Self Referencing Objects

Find objects with fields referencing 'this'.
Problem: Possibly incorrect logic and/or memory waste.
Possible solution: Remove redundant fields.

Non-zero-based arrays

Find non-zero-based arrays.
Non-zero-based arrays can cause performance and portability problems.

Objects With Biggest Distance To Nearest GC Root

Find objects with longest paths to GC root.
Intention: helps finding longest chains of objects such as linked lists, queues, trees etc.

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.