> For the complete documentation index, see [llms.txt](https://docs.xplatform.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xplatform.com/talon/developing-applications/configuring-the-runtime/monitoring/memory-statistics.md).

# Memory Statistics

Configure memory statistics collection covering JVM heap, off-heap (native) memory, IO buffers, and ADM entity lifecycle tracking.

## Overview

Talon can track detailed memory usage statistics including JVM heap and non-heap usage, off-heap (native) memory allocations, IO buffer lifecycle, and ADM entity pooling. Memory stats collection is disabled by default because it adds some overhead. When enabled, memory stats are included in XVM heartbeats and can also be output independently via standalone trace logging.

## Enabling Memory Stats

To enable memory stats collection, set the `nv.memory.stats.enable` system property to `true`:

```bash
-Dnv.memory.stats.enable=true
```

Or in DDL:

```xml
<env>
  <nv.memory.stats.enable>true</nv.memory.stats.enable>
</env>
```

To disable memory stats, remove the property or set it to `false`.

### Per-Entity-Type Breakdown

By default, entity stats are reported in aggregate across all entity types. To additionally get a per-entity-type breakdown, enable the type-level property:

```bash
-Dnv.memory.stats.enable=true -Dnv.memory.stats.type.enable=true
```

Or in DDL:

```xml
<env>
  <nv.memory.stats.enable>true</nv.memory.stats.enable>
  <nv.memory.stats.type.enable>true</nv.memory.stats.type.enable>
</env>
```

## Standalone Trace Output

Memory stats can be output periodically to a trace logger independently of XVM heartbeats. This is useful for standalone applications or debugging memory issues outside of the heartbeat cycle.

Set the `nv.memory.stats.interval` system property to the desired output interval in seconds:

```bash
-Dnv.memory.stats.enable=true -Dnv.memory.stats.interval=5
```

Or in DDL:

```xml
<env>
  <nv.memory.stats.enable>true</nv.memory.stats.enable>
  <nv.memory.stats.interval>5</nv.memory.stats.interval>
</env>
```

When enabled, a background thread (`X-Stats-Printer [com.neeve.memory.stats]`) periodically collects and traces memory stats to the `nv.memory.stats` logger at `INFO` level.

## Configuration Properties Reference

| Property                      | Default | Description                                                                        |
| ----------------------------- | ------- | ---------------------------------------------------------------------------------- |
| `nv.memory.stats.enable`      | `false` | Enable memory stats collection. Must be `true` for any memory stats to be recorded |
| `nv.memory.stats.type.enable` | `false` | Enable per-entity-type breakdown of entity stats                                   |
| `nv.memory.stats.interval`    | `0`     | Standalone trace output interval in seconds. `0` disables standalone trace         |

## Related Topics

* [Memory Stats](/talon/operating-applications/monitoring/memory-statistics.md) - Understanding and interpreting memory statistics at runtime
* [XVM Heartbeats](/talon/developing-applications/configuring-the-runtime/monitoring/xvm-heartbeats.md) - Configure XVM-level heartbeat emission
* [Engine Statistics](/talon/developing-applications/configuring-the-runtime/monitoring/engine-statistics.md) - Configure AEP engine metrics collection
* [Operating Model](/talon/concepts-and-architecture/operating-model.md) - Monitoring architecture overview
