system-memory-pools

Retrieves the current status of heap and off-heap memory. Specifying a scope lets you retrieve off-heap memory pool or object information.

Command properties

PropertyDescription
Command typeDriver query
Required permissionNone
License usageNot counted
Parallel executionNot supported
Distributed executionNot supported

Syntax

system-memory-pools [scope={pools|objects}]

Options

scope={pools|objects}
Specifies the detailed scope within off-heap to retrieve. If not specified, returns one summary record each for the heap and off-heap areas.
  • pools: Retrieves usage and available capacity per off-heap memory pool. Returns the same result as the system-offheap-pools command.
  • objects: Retrieves information about objects allocated in off-heap memory. Returns the same result as the system-memory-objects command.

Output fields

When scope is not specified:

FieldTypeDescription
typestringMemory area type. heap: JVM heap memory, offheap: off-heap memory outside the JVM heap
freelongApproximate free memory size (unit: bytes). Returned only when type=heap.
totallongApproximate total memory size (unit: bytes). Returned only when type=heap.
object_countintegerNumber of objects in the direct buffer area. Returned only when type=offheap.
total_capacitylongTotal number of objects the direct buffer can accommodate. Returned only when type=offheap.

When scope=pools:

FieldTypeDescription
typestringMemory type. Always offheap
namestringOff-heap memory pool name
usinglongCurrent usage of the memory pool (unit: bytes)
availablelongAvailable capacity of the memory pool (unit: bytes). The total pool size minus current usage.

When scope=objects:

FieldTypeDescription
typestringMemory type. Always offheap
namestringName of the object allocated in off-heap memory
usinglongMemory size currently used by the object (unit: bytes)

Error codes

Parsing errors
Error codeMessageDescription
95091invalid-scope-optionThe scope value is not pools or objects
Runtime errors
Error codeMessageDescriptionBehavior
95091invalid-scope-optionThe scope value is not pools or objectsAbort query

Description

The system-memory-pools command retrieves system memory information. When scope is not specified, it returns one summary record each for the JVM heap and off-heap areas. The heap record (type=heap) contains the approximate free memory (free) and total memory (total) as reported by the JVM Runtime. The off-heap record (type=offheap) contains the number of objects in the direct buffer area and the total number of objects the buffer can accommodate.

Specifying scope=pools retrieves usage and available capacity per off-heap memory pool. Specifying scope=objects retrieves the names and memory usage of objects allocated in off-heap. Each mode returns the same result as the system-offheap-pools and system-memory-objects commands, respectively.

Examples

  1. Retrieve heap and off-heap memory summary

    system-memory-pools
    

    Retrieves a summary of JVM heap free/total capacity and off-heap object count.

  2. Retrieve off-heap memory pool usage

    system-memory-pools scope=pools
    

    Retrieves current usage and available capacity for each off-heap memory pool.

  3. Retrieve off-heap object information

    system-memory-pools scope=objects
    

    Retrieves the names and memory usage of objects allocated in off-heap memory.

  4. Calculate heap memory usage percentage

    system-memory-pools
    | search type = "heap"
    | eval used = total - free
    | eval used_pct = round(used * 100 / total, 1)
    | fields type, used, total, used_pct
    

    Calculates heap memory usage and usage percentage (%).