Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. JVM
  3. jamm

jamm

Apache-2.0Javav0.3.0

A Java agent and library for measuring actual object memory usage, including JVM overhead, across multiple Java versions.

GitHubGitHub
693 stars124 forks0 contributors

What is jamm?

Jamm is a Java library and agent that measures the actual memory usage of Java objects, including JVM overhead. It provides the `MemoryMeter` tool to help developers understand the true memory footprint of their objects, which is essential for performance tuning and avoiding memory leaks in Java applications.

Target Audience

Java developers and performance engineers who need to analyze and optimize memory consumption in their applications, particularly those working with complex object graphs or large-scale systems.

Value Proposition

Jamm offers accurate memory measurement across multiple Java versions (8, 11, 17) and JVM configurations, with support for various measurement strategies and flexible filtering options, making it a reliable tool for deep memory analysis.

Overview

Java Agent for Memory Measurements

Use Cases

Best For

  • Profiling memory usage of complex object graphs in Java applications
  • Optimizing memory consumption in performance-critical systems
  • Debugging memory leaks by understanding object footprints
  • Comparing memory overhead of different data structures
  • Benchmarking memory impact of code changes across Java versions
  • Analyzing ByteBuffer allocations in slab-based memory management

Not Ideal For

  • Applications deployed on non-HotSpot JVMs like OpenJ9, due to untested compatibility and assumptions about JVM internals
  • Projects where JVM startup cannot be modified to include the -javaagent flag, limiting access to the most accurate Instrumentation strategy
  • Environments with strict Java module system (JPMS) enforcement that block reflective access without additional JVM arguments like add-exports
  • Quick prototyping or development phases where only high-level memory estimates are needed, as Jamm's deep analysis adds overhead

Pros & Cons

Pros

Accurate Measurement Strategies

Supports Instrumentation, Unsafe, and Specification strategies, with Instrumentation being safest when using the Java agent for precise object size estimation across Java 8, 11, and 17.

Deep Object Graph Analysis

Can recursively measure entire object graphs with measureDeep, including options to filter classes or ignore references, essential for profiling complex memory footprints.

Flexible Filtering Options

Allows skipping measurement of specific classes or fields using the @Unmetered annotation or custom filters, providing fine-grained control over memory analysis.

ByteBuffer Specialization

Offers specialized modes (NORMAL, SLAB_ALLOCATION_NO_SLICE, SLAB_ALLOCATION_SLICE) for accurate ByteBuffer measurements in slab-based allocations, critical for buffer management scenarios.

Cons

Breaking API Changes

Version 0.4.0 introduced significant breaking changes, such as removing constructors and static methods in favor of a Builder pattern, requiring code updates and migration efforts.

HotSpot JVM Dependency

Assumes and only tested with HotSpot JVM; explicitly not compatible with other JVMs like OpenJ9, limiting its use in diverse or legacy environments.

Java Module System Complications

Under JPMS, reflection may be blocked, requiring add-exports or add-opens JVM arguments for accurate crawling, which can be cumbersome and error-prone in production setups.

Inaccuracies Without Agent

Without the -javaagent, strategies like Unsafe may fail for records or hidden classes (e.g., lambdas), and Specification has known issues with certain JVM arguments, reducing reliability.

Frequently Asked Questions

Quick Stats

Stars693
Forks124
Contributors0
Open Issues6
Last commit2 years ago
CreatedSince 2011

Tags

#memory-management#memory-measurement#instrumentation#jvm#benchmarking#java-agent#hotspot-jvm#performance

Built With

J
JMH
M
Maven
J
Java

Included in

JVM2.2k
Auto-fetched 16 hours ago

Related Projects

leakcanaryleakcanary

A memory leak detection library for Android.

Stars29,958
Forks3,987
Last commit2 days ago
ZipkinZipkin

Zipkin is a distributed tracing system

Stars17,447
Forks3,102
Last commit3 months ago
async-profilerasync-profiler

Sampling CPU and HEAP profiler for Java featuring AsyncGetCallTrace + perf_events

Stars9,093
Forks976
Last commit19 hours ago
BTraceBTrace

Production-safe dynamic tracing and diagnostics for Java applications—attach to live JVMs with no restart or recompilation.

Stars5,986
Forks958
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub