---
type: api
title: Get JVM statistics
description: Get threads count, garbage collators(GC) and memory details.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/logstash/v9/operation/operation-nodestatsjvm
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/logstash/v9/operation/operation-nodestatsjvm
products:
  - Logstash
---

# Get JVM statistics

- Server: `/`

## Paths

- `GET` `/_node/stats/jvm`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/logstash/v9/authentication#basicauth)

## Description

Get threads count, garbage collators(GC) and memory details.

## Query String Parameters

- `pretty` (boolean)
  If you append `?pretty=true` to the request, the JSON returned will be pretty formatted. Use it for debugging only!

## Response

A JSON object containing jvm statistics.

`application/json`

- `jvm` (object)
  - `threads` (object)
    - `count` (integer)
      The number of active JVM threads.
    - `peak_count` (integer)
      The peak number of active JVM threads.
  - `mem` (object)
    - `heap_used_percent` (integer)
      The percentage of heap memory used.
    - `heap_committed_in_bytes` (integer)
      The committed heap memory in bytes.
    - `heap_max_in_bytes` (integer)
      The maximum heap memory in bytes.
    - `heap_used_in_bytes` (integer)
      The used heap memory in bytes.
    - `non_heap_used_in_bytes` (integer)
      The used non-heap memory in bytes.
    - `non_heap_committed_in_bytes` (integer)
      The committed non-heap memory in bytes.
    - `pools` ({} JVMMemoryPools)
      - `survivor` ({} JVMMemoryPool)
        - `peak_used_in_bytes` (integer)
        - `used_in_bytes` (integer)
        - `peak_max_in_bytes` (integer)
        - `max_in_bytes` (integer)
        - `committed_in_bytes` (integer)
      - `old` ({} JVMMemoryPool)
        - `peak_used_in_bytes` (integer)
        - `used_in_bytes` (integer)
        - `peak_max_in_bytes` (integer)
        - `max_in_bytes` (integer)
        - `committed_in_bytes` (integer)
      - `young` ({} JVMMemoryPool)
        - `peak_used_in_bytes` (integer)
        - `used_in_bytes` (integer)
        - `peak_max_in_bytes` (integer)
        - `max_in_bytes` (integer)
        - `committed_in_bytes` (integer)
  - `gc` (object)
    - `collectors` ({} JVMGCCollectors)
      - `old` ({} JVMGCCollector)
        - `collection_time_in_millis` (integer)
        - `collection_count` (integer)
      - `young` ({} JVMGCCollector)
        - `collection_time_in_millis` (integer)
        - `collection_count` (integer)
  - `uptime_in_millis` (integer)
    The JVM uptime in milliseconds.
## Code Examples

#### Console

```console
GET /_node/stats/jvm
```

#### curl

```curl
curl -X GET "/_node/stats/jvm"
```

## Response Examples

#### 200

```json
{
  "jvm": {
    "threads": {
      "count": 117,
      "peak_count": 119
    },
    "mem": {
      "heap_used_percent": 4,
      "heap_committed_in_bytes": 245366784,
      "heap_max_in_bytes": 4294967294,
      "heap_used_in_bytes": 206685392,
      "non_heap_used_in_bytes": 175223280,
      "non_heap_committed_in_bytes": 196739072,
      "pools": {
        "young": {
          "committed_in_bytes": 92274688,
          "max_in_bytes": -1,
          "used_in_bytes": 69206016,
          "peak_max_in_bytes": -1,
          "peak_used_in_bytes": 171966464
        },
        "old": {
          "committed_in_bytes": 146800640,
          "max_in_bytes": 4294967296,
          "used_in_bytes": 131187920,
          "peak_max_in_bytes": 4294967296,
          "peak_used_in_bytes": 135186368
        },
        "survivor": {
          "committed_in_bytes": 6291456,
          "max_in_bytes": -1,
          "used_in_bytes": 6291456,
          "peak_max_in_bytes": -1,
          "peak_used_in_bytes": 23068672
        }
      }
    },
    "gc": {
      "collectors": {
        "young": {
          "collection_count": 37,
          "collection_time_in_millis": 192
        },
        "old": {
          "collection_count": 0,
          "collection_time_in_millis": 0
        }
      }
    },
    "uptime_in_millis": 2512572
  }
}
```

