Analyzer lj-tab-unreachable-node

Name

lj-tab-unreachable-node - Find unreachable nodes in the lua tables.

This analyzer identifies orphaned and unreachable nodes in LuaJIT table structures within OpenResty, Kong, and APISIX applications. It scans table memory layouts to detect nodes that are allocated but not accessible through normal table traversal, indicating potential memory leaks. The analyzer generates bar charts showing the distribution of unreachable nodes across tables, helping diagnose memory waste and optimize table memory usage.

Resource Category

Memory.

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-tab-unreachable-node -p PID

# trace a shell command directly
orxray analyzer run lj-tab-unreachable-node -c SHELL_CMD

Tracing Multiple Processes

Not supported.

Output Formats

  • Bar Charts
  • Plain Texts

Output Example

[
  {
      "title": "Find Unreachable Nodes In The Lua Tables",
      "subtitle": "",
      "series": {
          "data": {
              "Hash table chains": 2392,
              "Hash table nodes": 7073,
              "Lua tables": 2227,
              "Unreachable nodes": 0
          },
          "name": "Count"
      },
      "ver": 1,
      "type": "bar"
  }
]

Author

The OpenResty Inc. Team.

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