AcediaDocumentation

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

ParameterTypeDescription
includeTablesboolean?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

8421

The exact count depends on live heap state at the time of the call.

On this page