Join our Newsletter — 33% off our NHI Course

Class Histogram

A class histogram is a JVM diagnostic listing of loaded classes and their instance counts and memory use. Administrators use it to inspect heap composition, identify object growth, and support troubleshooting of memory leaks or unusual runtime behaviour in a Java process.

What the Class Histogram Shows

A class histogram is a JVM snapshot of the classes currently loaded in a Java process, with counts and memory usage per class. It gives operators a quick view of heap composition so they can spot dominant object types, unusual growth, or a pattern that may point to a leak.

Unlike a full heap dump, the histogram is intentionally compact. That makes it useful during live troubleshooting because it exposes broad allocation shape without the overhead and analysis burden of capturing every object reference.

Why Administrators Use It

Administrators typically use a class histogram when a Java service is slowing down, consuming more memory than expected, or behaving inconsistently under load. It helps answer practical questions such as which classes are consuming the most space and whether one type is growing faster than the rest.

The value is in trend recognition. A single histogram can be informative, but repeated histograms taken over time are much better for showing whether a class count is stable, drifting upward, or suddenly spiking after a deployment, traffic change, or configuration update.

How to Interpret the Output

The most useful rows are rarely the largest by raw count alone. High instance counts may be harmless for small objects, while a smaller number of large instances can dominate memory use. Interpretation should therefore consider both object count and retained footprint, along with the role that class plays in the application.

A histogram can also reveal whether the observed memory pressure is likely to be application-level object growth, framework caching, class loading churn, or temporary runtime activity. That distinction matters because not every increase indicates a leak; some growth reflects legitimate workload or warm-up behaviour.

Using It in Memory Troubleshooting

Class histograms are often one step in a broader diagnostic workflow. They help narrow the search before deeper analysis with a heap dump, garbage collection logs, or application metrics. In practice, they are most useful when paired with questions about recent code changes, unusual request patterns, or long-lived caches.

For operators, the key benefit is speed: a histogram can quickly confirm whether a suspected class is actually accumulating and whether the heap profile aligns with the symptoms seen in latency, throughput, or garbage collection behaviour. For more general control and monitoring context, see NIST Cybersecurity Framework 2.0 and NIST SP 800-53 Rev 5 Security and Privacy Controls.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST CSF 2.0 DE.CM-01 — Monitoring for anomalous activity A class histogram supports runtime monitoring for abnormal heap and object-growth patterns.
Recommendation — Use DE.CM-01 monitoring to detect abnormal Java heap growth and allocation patterns.
NIST SP 800-53 Rev 5 AU-6 — Audit Record Review, Analysis, and Reporting Histogram output is operational evidence used to review unusual runtime behaviour and memory growth.
Recommendation — Review histogram evidence under AU-6 to investigate abnormal runtime behaviour.