system-gc-logs

Retrieves JVM GC log entries. Cluster administrator permission is required.

Command properties

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

Syntax

system-gc-logs [fastcheck=BOOL] [duration=INT{mon|w|d|h|m|s}] [from=DATE] [to=DATE]

Options

fastcheck=BOOL
Quickly scans and outputs only lines that indicate potential GC problems. When set to t, only lines of type Allocation Stall, To-space Exhausted, and Pause Full are output. (Default: f)
duration=INT{mon|w|d|h|m|s}
Limits results to GC logs within the specified time range from the current time. Use units mon (month), w (week), d (day), h (hour), m (minute), or s (second). For example, 10s means the last 10 seconds relative to query execution time. Cannot be used when both from and to options are specified.
from=DATE
Start time of the retrieval range, in yyyy[MM[dd[HH[mm[ss]]]]] format. If month, day, etc. are omitted, the earliest possible time is used. The start time is included in the results.
to=DATE
End time of the retrieval range, in yyyy[MM[dd[HH[mm[ss]]]]] format. If month, day, etc. are omitted, the earliest possible time is used. The end time is not included in the results.

Output fields

FieldTypeDescription
_timetimestampGC log timestamp
typestringGC log type. One of ALLOC_STALL, TO_SPACE_EXHAUSTED, FULL_GC, or RAW.
durationdoubleGC execution time (milliseconds). Returned only for ALLOC_STALL or FULL_GC type.
levelstringGC log severity level
msgstringGC log message body. Returned when the log format is [timestamp][level] message.
linestringOriginal GC log line. Returned for unparseable formats or RAW type.

Error codes

Parsing errors
Error codeMessageDescription
95020No read permission. Cluster administrator permission is required.The user does not have cluster administrator permission
95030Invalid from value.The from option value cannot be parsed as a date
95031Invalid to value.The to option value cannot be parsed as a date
95032Invalid from value.The to value is earlier than the from value
95023Cannot use duration option when both from and to options are specified.duration was used while both from and to were specified
95131Invalid fastcheck value: [value]A non-boolean value was specified for the fastcheck option
Runtime errors

N/A

Description

The system-gc-logs command reads the JVM GC log file (gc.log) and retrieves GC log entries.

Using the fastcheck=t option, you can quickly retrieve only entries that indicate potential GC problems (Allocation Stall, To-space Exhausted, Pause Full). With fastcheck=t, the type field returns the corresponding type, and if a GC execution time is available, the duration field returns it in milliseconds.

When you specify a time range with the from and to options, only GC log files within that range are selectively read.

Cluster administrator permission is required to run this command.

Examples

  1. Retrieve all GC logs

    system-gc-logs
    

    Retrieves all JVM GC logs.

  2. Quickly retrieve only problematic GC entries

    system-gc-logs fastcheck=t
    

    Retrieves only GC log entries of types Allocation Stall, To-space Exhausted, and Pause Full.

  3. Retrieve GC logs from the last hour

    system-gc-logs duration=1h
    

    Retrieves GC logs from within the last hour.

  4. Analyze Full GC frequency

    system-gc-logs fastcheck=t duration=1d
    | search type == "FULL_GC"
    | stats count() as cnt, avg(duration) as avg_ms
    

    Retrieves the number of Full GC occurrences and average execution time over the last day.