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.

Group objects by class loader

When analyzing Java memory snapshots, it's often useful to understand the distribution of objects in the heap. One valuable approach is to group objects by their class loaders. Class loaders are responsible for loading classes into the Java Virtual Machine (JVM), and different parts of an application may use different class loaders. Understanding the distribution of objects per class loader can offer insights into various issues such as memory leaks, class loading problems, or performance bottlenecks.

Objects grouped by their class loaders

Paths from GC roots to the loader object are explicitly available as a dependent Paths from GC Roots view. This allows you to learn why particular class loader is retained in memory.

Why analyzing class loaders is useful

1. Isolate memory leaks: Knowing which class loader is responsible for an unusually high number of object instances can help isolate the source of memory leaks.

2. Plugin or module analysis: In modular systems or applications that support plugins, each plugin or module may have its own class loader. Grouping by class loader helps in assessing the memory footprint of each module.

3. Isolate third-party libraries: Java applications often use multiple third-party libraries, each loaded by their own class loader or shared ones. Grouping by class loaders can isolate the classes from each library, allowing you to understand the memory consumption of each library separately.

4. Understand class versioning: In some complex systems where multiple versions of a class may exist, understanding which class loader loaded which version of class can help troubleshoot issues related to class version conflicts.

YourKit uses cookies and other tracking 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 Privacy Policy.