The ARMS agent collects JVM metrics in five categories: memory, garbage collection (GC), threads, classes, and file descriptors. All metrics are gathered through standard JDK management interfaces (java.lang.management) on a periodic schedule.
For each metric, the following sections cover its collection method, reported name, type, unit, dimensions, and underlying JDK API.
Memory metrics
The ARMS agent periodically calls ManagementFactory.getPlatformMXBeans(MemoryPoolMXBean.class) to retrieve memory usage for each JVM memory pool.
Each MemoryPoolMXBean reports the initial, maximum, committed, and used sizes for a specific memory space. To query these values directly:
public static void printCurrentJVMMemoryUsage() {
List<MemoryPoolMXBean> beans = ManagementFactory.getPlatformMXBeans(MemoryPoolMXBean.class);
for (MemoryPoolMXBean bean : beans) {
System.out.printf("area=%s\tname=%s\tinitial=%d\tmax=%d\tcommited=%d\tuse=%d\n", bean.getType().name(),
bean.getName(), bean.getUsage().getInit(), bean.getUsage().getMax(), bean.getUsage().getCommitted(), bean.getUsage().getUsed());
}
}Sample output (varies by JVM version):
area=NON_HEAP name=Code Cache initial=2555904 max=134217728 commited=3211264 use=3139712
area=NON_HEAP name=Metaspace initial=0 max=-1 commited=8388608 use=7950584
area=NON_HEAP name=Compressed Class Space initial=0 max=1073741824 commited=1048576 use=919408
area=HEAP name=PS Eden Space initial=67108864 max=1409286144 commited=67108864 use=39057856
area=HEAP name=PS Survivor Space initial=11010048 max=11010048 commited=11010048 use=0
area=HEAP name=PS Old Gen initial=179306496 max=2863661056 commited=179306496 use=0The agent reports these values directly without additional processing.
Reported metrics
| Metric | Type | Unit | Description |
|---|---|---|---|
arms_jvm_mem_init_bytes | Gauge | Bytes | Initial memory size requested by the JVM. |
arms_jvm_mem_max_bytes | Gauge | Bytes | Maximum memory size available. |
arms_jvm_mem_committed_bytes | Gauge | Bytes | Memory committed to the JVM by the OS. |
arms_jvm_mem_used_bytes | Gauge | Bytes | Memory currently in use. |
Dimensions
| Dimension | Description | Example values |
|---|---|---|
area | Memory space type. | heap, nonheap |
id | Memory space name. | eden, survivor, total |
For details on JVM memory spaces, see JVM memory details.
GC metrics
The collection method depends on your agent version:
Before V4.4.0: A scheduled task polls
ManagementFactory.getPlatformMXBeans(GarbageCollectorMXBean.class).V4.4.0 and later: The agent subscribes to
GarbageCollectionNotificationInfoevents for real-time collection.
Each GarbageCollectorMXBean reports cumulative GC counts and durations since JVM startup. To query these values directly:
public static void printGC() {
List<GarbageCollectorMXBean> beans = ManagementFactory.getPlatformMXBeans(GarbageCollectorMXBean.class);
for (GarbageCollectorMXBean bean : beans) {
System.out.printf("name=%s\tgcCount=%d\tgcTime=%d\n", bean.getName(),
bean.getCollectionCount(), bean.getCollectionTime());
}
}Sample output (varies by JVM version):
name=PS Scavenge gcCount=0 gcTime=0
name=PS MarkSweep gcCount=0 gcTime=0Because these values are cumulative since JVM startup, the agent computes the delta between consecutive collections (default interval: 15 seconds). It reports per-interval counts and durations.
Reported metrics
| Metric | Type | Unit | Description |
|---|---|---|---|
arms_jvm_gc_delta | Gauge (delta) | Count | Number of GC occurrences in the current collection interval. |
arms_jvm_gc_seconds_delta | Gauge (delta) | Seconds | GC time consumed in the current collection interval. |
Dimensions
| Dimension | Description | Example values |
|---|---|---|
gen | GC generation type. | young, old |
cause | GC trigger reason (V4.4.0+). | System.gc(), Heap Dump Initiated GC, Allocation Failure |
Garbage collector name mapping
The ARMS agent maps actual garbage collector names to standardized gen dimension values to simplify analysis.
Standard collectors
| Garbage collector name | gen value |
|---|---|
| Copy | young |
| G1 Young Gen | young |
| G1 Old Gen | old |
| G1 Young Generation | young |
| G1 Old Generation | old |
| ParNew | young |
| ConMarkSweep | old |
| ConcurrentMarkSweep | old |
| PS Scavenge | young |
| PS MarkSweep | old |
| PS Serial | young |
| MarkSweepCompact | old |
ZGC collectors
ZGC uses a fundamentally different design that does not fit the traditional young/old classification. The ARMS agent maps ZGC collectors separately:
| Garbage collector name | gen value |
|---|---|
| ZGC Cycles | cycles |
| ZGC Pauses | pauses |
| ZGC Minor Cycles | young_cycles |
| ZGC Minor Pauses | young_pauses |
| ZGC Major Cycles | old_cycles |
| ZGC Major Pauses | old_pauses |
Thread stack usage chart
The ARMS console displays a Thread Stack Usage chart. The agent does not collect this metric. Instead, the value equals the current live thread count multiplied by 1 MB. This is the default per-thread stack size the JVM allocates for local variable tables, operand stacks, dynamic links, and method return addresses.

Thread metrics
The ARMS agent periodically calls ManagementFactory.getThreadMXBean() to retrieve thread counts.
The returned ThreadMXBean instance provides the cumulative started thread count, current live thread count, and daemon thread count. The agent also counts live threads by state: RUNNABLE, BLOCKED, WAITING, and TIMED_WAITING.
To query these values directly:
public static void printThreads() {
ThreadMXBean threadMXBean = java.lang.management.ManagementFactory.getThreadMXBean();
int threadCount = threadMXBean.getThreadCount();
int daemonThreadCount = threadMXBean.getDaemonThreadCount();
long totalStartedThreadCount = threadMXBean.getTotalStartedThreadCount();
long terminatedThreadCount = totalStartedThreadCount - threadCount;
System.out.printf("allStartedThreadCount=%d\tcurrentThreadCount=%d\tdaemonThreadCount=%d\tterminatedThreadCount=%d\n"
, totalStartedThreadCount, threadCount, daemonThreadCount, terminatedThreadCount);
}Sample output (varies by JVM version):
allStartedThreadCount=5 currentThreadCount=5 daemonThreadCount=4 terminatedThreadCount=0The terminated thread count equals the cumulative started count minus the current live count. All other values come directly from ThreadMXBean. The agent reports these values without additional processing.
Reported metrics
| Metric | Type | Unit | Description |
|---|---|---|---|
arms_jvm_threads_count | Gauge | Count | Thread count by state. |
Dimensions
The state dimension distinguishes thread categories:
state value | Description |
|---|---|
live | Total live threads. |
daemon | Daemon threads. |
terminated | Terminated threads (ARMS agent 4.x only). |
new | Threads in NEW state. |
runnable | Threads in RUNNABLE state. |
blocked | Threads in BLOCKED state. |
wait | Threads in WAITING state. |
timed-wait | Threads in TIMED_WAITING state. |
Class loading metrics
The ARMS agent periodically calls ManagementFactory.getClassLoadingMXBean() to retrieve class loading counts.
The returned ClassLoadingMXBean provides cumulative loaded and unloaded class counts since JVM startup. To query these values directly:
public static void printCurrentJVMMemoryUsage() {
ClassLoadingMXBean classLoaderMXBean = ManagementFactory.getClassLoadingMXBean();
long totalLoadedClassCount = classLoaderMXBean.getTotalLoadedClassCount();
long unloadedClassCount = classLoaderMXBean.getUnloadedClassCount();
System.out.printf("totalLoadedClassCount=%d\tunloadedClassCount=%d\n"
, totalLoadedClassCount, unloadedClassCount);
}Sample output (varies by JVM version):
totalLoadedClassCount=1355 unloadedClassCount=0Because these values are cumulative since JVM startup, the agent computes the delta between consecutive collections (default interval: 15 seconds) to report per-interval counts.
Reported metrics
| Metric | Type | Unit | Description |
|---|---|---|---|
arms_class_load_loaded | Gauge (delta) | Count | Number of classes loaded in the current collection interval. |
arms_class_load_un_loaded | Gauge (delta) | Count | Number of classes unloaded in the current collection interval. |
File descriptor metrics
The ARMS agent periodically calls ManagementFactory.getOperatingSystemMXBean() to retrieve file descriptor usage. This metric is available only on Unix-based systems, where the bean is an instance of UnixOperatingSystemMXBean.
To query these values directly:
public static void printFDUsage() {
OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean();
if (!(operatingSystemMXBean instanceof UnixOperatingSystemMXBean)) {
return;
}
long openFDCount = ((UnixOperatingSystemMXBean) operatingSystemMXBean).getOpenFileDescriptorCount();
long maxFDCount = ((UnixOperatingSystemMXBean) operatingSystemMXBean).getMaxFileDescriptorCount();
System.out.printf("openFDCount=%d\tfdOpenRatio=%f\n"
, openFDCount, (double) openFDCount / maxFDCount);
}Sample output (varies by JVM version):
openFDCount=184 fdOpenRatio=0.017969The open ratio is calculated as openFileDescriptorCount / maxFileDescriptorCount. The agent reports these values without additional processing.
Reported metrics
| Metric | Type | Unit | Description |
|---|---|---|---|
arms_file_desc_open_count | Gauge | Count | Number of file descriptors currently open. |
arms_file_desc_open_ratio | Gauge | Ratio (0-1) | Ratio of open file descriptors to the maximum allowed. |