Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

profiler.heap

Where the Luau heap is held. memory says which component retains bytes; heap walks the VM's own object graph and names what holds them — a table's fields, a closure's captured variables (by the variable's name), a metatable, a prototype. With no root it counts the whole heap by object type and memory category. With a Luau expression naming a value it reports the bytes that value reaches, the bytes only it holds (what dropping it frees), the split by the first reference taken from it, and the largest objects it reaches with the path of references to each. The same accounting is the global luauHeapSnapshot(root?, opts?), which takes the value itself. The call walks every object of the VM, so it takes time in proportion to the heap; its graph is kept within a byte budget (opts.maxBytes, 1 GiB at its peak) and the call answers a reason instead when the heap is larger.