lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


----- Original Message -----
From: "Jens Wessling" <wessling@soartech.com>
| Is there a way to remove functions from memory once they have been loaded?

function x()
end

x=nil  -- remove reference to function object
collectgarbage()  -- force garbage collection immediately


>From manual:
collectgarbage ([limit])
Sets the garbage-collection threshold for the given limit (in Kbytes), and
checks it against the byte counter. If the new threshold is smaller than the
byte counter, then Lua immediately runs the garbage collector (see Section 5.6).
If limit is absent, it defaults to zero (thus forcing a garbage-collection
cycle).


N