Analyzer lj-dump-cdata-fin

Name

lj-dump-cdata-fin - Dump LuaJIT CDATA finalizer

This analyzer profiles the finalization of CDATA objects in LuaJIT-based applications such as OpenResty, Kong. The analyzer helps identify the C functions that are used as finalizers for CDATA objects, which can be useful for debugging memory management issues and understanding the lifecycle of CDATA objects in LuaJIT.

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-dump-cdata-fin -p PID

# trace a shell command directly
orxray analyzer run lj-dump-cdata-fin -c SHELL_CMD

# PGID is the process group ID or any process's PID within the target process
# group.
orxray analyzer run lj-dump-cdata-fin -p -PGID

# trace any processes started from the specified executable path.
orxray analyzer run lj-dump-cdata-fin --exe /path/to/exe/file

Tracing Multiple Processes

Supported.

Output Formats

  • Plain Texts

Output Example

{
    "title": "LuaJIT Cdata finalizer",
    "data": [
        [ "Type", "Address", "Name" ],
        [ "LJ_TCDATA", "0x7433410c3170", "str_free" ],
        [ "LJ_TCDATA", "0x7433410cca40", "url_free" ],
        [ "LJ_TCDATA", "0x7433410cb520", "ac_free" ],
        [ "LJ_TCDATA", "0x7433410c3080", "node_free" ]
    ],
    "type": "table",
    "ver": 1
}

Author

The OpenResty Inc. Team.

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