getgc

Lists live garbage-collected objects.

Syntax

Signature
getgc(IncludeFunctions: boolean?, IncludeStrings: boolean?) -> {any}

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
IncludeFunctionsboolean?Include live functions in addition to tables.
IncludeStringsboolean?Include live, nonempty strings up to 256 bytes.

Returns

TypeDescription
{any}One-based list of live objects matching the requested kinds.

Notes

IncludeFunctions adds functions, and IncludeStrings adds nonempty strings of at most 256 bytes. Results are a snapshot and their order is unspecified.

Example

Luau
local Result = getgc()
print(Result)