WoW API: collectgarbage

From AddOn Studio
Revision as of 01:56, 9 December 2006 by WoWWiki>Jgoemat (Added "count" as a parameter, found in mod "!!Warmup")
Jump to navigation Jump to search

WoW API < collectgarbage

collectgarbage -Documentation by Aradan-

Sets garbage collection limit and calls the garbage collector if the Lua byte counter exceeds this limit.

collectgarbage({limit})

Parameters

Arguments

({limit})
limit
Number - GC limit (in KiB). If omitted, defaults to zero, forcing garbage collection.
limit
"count" - will return the total kilobytes of memory used

Example

collectgarbage() -- Force garbage collection
collectgarbage(131072) -- Set GC limit to 128 MiB
collectgarbage("count") -- return kilobytes of memory in use, i.e. 2048 for 2 megabytes

Note

There is a Lua function with the exact same name but its parameters and behavior is quite different from the WoW API version.