system-threads

Retrieves the stack traces and lock status of all system threads. Requires cluster administrator privileges.

Command properties

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

Syntax

system-threads [prettystack=BOOL] [stack=BOOL]

Options

prettystack=BOOL
Formats the stack trace in a human-readable form (default: t).
  • t: Converts the stack trace to a string in the same format as jstack.
  • f: Returns the stack trace as an array of maps containing class, file, line number, and method information.
stack=BOOL
Retrieves stack traces (default: t).
  • t: Uses JMX ThreadMXBean to retrieve thread stack traces and lock information.
  • f: Returns only thread ID, name, and state without fetching stack traces.

Output fields

FieldTypeDescription
tidlongThread ID
namestringThread name
statestringThread state. One of: NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING, TERMINATED
stacktracestringThread stack trace (same format as jstack). Not returned when stack=f.

Error codes

Parsing errors
Error codeMessageDescription
95040no-read-permissionThe user does not have cluster administrator privileges
92004access-denied-to-local-filesystemA non-boolean value was specified for the prettystack or stack option
Runtime errors

N/A

Description

The system-threads command retrieves stack traces and lock status for all threads in the JVM. Use it to examine thread dumps during incident analysis or performance diagnostics.

When stack=t (the default), thread information and stack traces are retrieved together through JMX ThreadMXBean. When prettystack=t (the default), the result is converted to a jstack-format string that includes lock information. When prettystack=f, the stack trace is returned as an array of maps containing class, file, line number, and method information.

When stack=f, only the thread list is retrieved without stack traces. This is useful when you need to quickly check thread states without collecting stack traces.

Cluster administrator privileges are required to run this command.

Examples

  1. Retrieve a full thread dump

    system-threads
    

    Retrieves the stack traces and lock status of all threads in the system.

  2. Retrieve thread list without stack traces

    system-threads stack=f
    

    Returns only thread ID, name, and state. Runs faster because stack traces are not collected.

  3. Retrieve stack traces as an array

    system-threads prettystack=f
    

    Returns the stack trace as an array of maps containing class, file, line number, and method information.

  4. Filter for BLOCKED threads

    system-threads | search state == "BLOCKED"
    

    Retrieves the thread dump and filters for threads in the BLOCKED state.