Analyzer lj-gc-step-calls

Name

lj-gc-step-calls - Number of LuaJIT GC function calls per second

This analyzer monitors the frequency of LuaJIT garbage collector step function invocations in OpenResty, Kong, and APISIX applications. It captures the rate of GC step calls per second to assess garbage collection activity and overhead. The analyzer generates line charts showing GC call frequency over time, helping identify excessive GC pressure, tune GC parameters, and optimize memory allocation patterns to reduce GC-related performance impact.

Resource Category

CPU.

Application Type & Technical Stack

  • OpenResty
  • Kong
  • APISIX

Command Line Syntax

The analyzer can be invoked directly on the command-line via the orxray utility from the openresty-xray-cli software package.

Alternatively, the analyzer can also be invoked manually or automatically on the web console UI of OpenResty XRay (like on the Advanced web page).

# PID is the target process PID.
orxray analyzer run lj-gc-step-calls -p PID

# trace a shell command directly
orxray analyzer run lj-gc-step-calls -c SHELL_CMD

# PGID is the process group ID or any process's PID within the target process
# group.
orxray analyzer run lj-gc-step-calls -p -PGID

# trace any processes started from the specified executable path.
orxray analyzer run lj-gc-step-calls --exe /path/to/exe/file

Tracing Multiple Processes

Supported.

Output Formats

  • Line Charts
  • Plain Texts

Output Example

[
  {
      "title": "Number of LuaJIT GC function calls per second",
      "subtitle": "",
      "series": {
          "data": [
              11,
              25,
              30,
              12,
              19,
              9,
              10,
              6,
              20,
              12,
              21,
              8,
              4,
              0,
              0
          ],
          "name": "Number of LuaJIT GC function calls"
      },
      "ver": 1,
      "categories": [
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15"
      ],
      "categoryTitle": "Time (sec)",
      "valueTitle": "Count",
      "type": "line"
  }
]

Author

The OpenResty Inc. Team.

Copyright (C) by OpenResty Inc. All rights reserved.