getgc
Lists functions and userdata reachable through the current VM collector.
This is a snapshot of collector objects, not a recursive walk of a script environment. Other actor VMs are separate. Inspect values before using them.
getgc(includeTables: boolean?): {any}Parameters
| Parameter | Type | Description |
|---|---|---|
includeTables | boolean? | Include tables as well; defaults to false. |
Example
local objects = getgc(true)
local count = 0
for _, value in pairs(objects) do
if type(value) == "table" then count += 1 end
end
print(count)Example output
8421The exact count depends on live heap state at the time of the call.
