Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Java Agent for Memory Measurements
| Date | Stars |
|---|---|
| 2026-07-31 | 693 |
| 2026-08-05 | 693 |
| 2026-08-06 | 693 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Overview
Jamm provides `MemoryMeter`, a Java agent for all Java versions to
measure actual object memory use including JVM overhead.
Jamm assume that the JVM running the code is an HotSpot JVM. It has not been tested with other type of JVMs.
# Building
"mvn package"; optionally, "mvn install"
# Setup your toolchains.xml
We want to compile and test using different JVM versions. Configuration option jdkToolchain can be used to supply an alternate
toolchain specification. To achieve our goal we need first to setup `toolchains.xml`.
The `toolchains.xml` file is the configuration file where you set the installation paths of your toolchains. This file
should be put in your `${user.home}/.m2` directory. When the maven-toolchains-plugin executes, it looks for the `toolchains.xml`
file, reads it and looks for a toolchain matching the toolchains requirements configured in the plugin.
Jamm repo contains a `toolchains.example.xml` which you can use as a baseline for your own `toolchains.xml`. You need it
to be able to run the tests. Copy `toolchains.example.xml` to `${user.home}/.m2`, rename the file to `toolchains.xml`.
In `toolchains.xml`, check to update your vendor and jdkHome for JDK8, JDK11 and JDK17 which you have installed on your machine.
# Running Tests
The tests can be run with "mvn test". The `JvmArgs` property can be used to specify the JVM arguments that can be used for running the tests.
For example:
```
mvn test -DjvmArgs="-Xmx64g"
mvn test -DjvmArgs="-Xmx64g -XX:ObjectAlignmentInBytes=16 -XX:-UseCompressedClassPointers"
```
`mvn test` runs all tests with JDK8, JDK11, and then with JDK17
To run the tests with only one particular JDK version run:
* for JDK8:
```
mvn surefire:test@test-default
```
or
```
mvn surefire:test
```
* for JDK11:
```
mvn surefire:test@test-jdk11
```
* for JDK17:
```
mvn surefire:test@test-jdk17
```
# Use
The best way to use `MemoryMeter` is to start the JVM with "-javaagent:<path to>/jamm.jar" in order to use the
`Instrumentation` strategy to guess objects' sizes.
`MemoryMeter` can be used in your code like this:
MemoryMeter meter = MemoryMeter.builder().build();
meter.measure(object);
meter.measureDeep(object);
If you would like to use `MemoryMeter` in a web application, make sure
that you do NOT put this jar in `WEB-INF/lib`, as that may cause problems
since your code is accessing a `MemoryMeter` from a different class loader
than the one loaded by the `-javaagent` and won't see it as initialized.
If you want `MemoryMeter` not to measure some specific classes, you can
mark the classes (or interfaces) using the `Unmetered` annotation.
# The Maven coordinates for the latest version of Jamm
```
<groupId>com.github.jbellis</groupId>
<artifactId>jamm</artifactId>
<version>0.4.0</version>
```
# 0.4.0 breaking changes
The 0.4.0 version comes with speed improvements and support java versions up to Java 17 but also some breaking
changes at the API level.
* The `MemoryMeter` constructor and the static methods used to configure the different options (`withGuessing`, `ignoreOuterClassReference`, `ignoreKnownSingletons`, `ignoreNonStrongReferences`, `enableDebug`) have been removed. Instead `MemoryMeter` instances must be created through a `Builder`.
* The `omitSharedBufferOverhead` option has been removed. Instead a `ByteBufferMode` can be provided as an argument to `measureDeep`. The provided mode must match the way the application is creating SLABs for accurate results.
* The ability to provide a tracker for visited object has been removed.
* `Guess` values have been changed to each represent a single strategy. Fallback strategies can be defined through the `MemoryMeter.Builder::withGuessing` method.
* `MemoryMeter.countChildren` has been removed.
* The `MemoryMeter.measure` and `MemoryMeter.measureDeep` now accept `null` parameters
* Jamm is not trying anymore to support non Hotspot JVM (e.g. OpenJ9)
* By default `MemoryMeter.measureDeep` is now ignoring the spExcerpt of 16,046 characters
Read on GitHub61
59
Jonathan Ellis · DataStax · United States
20
17
15
5
2
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
Not classified yet. Classification runs as part of npm run ingest.