diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-07-22 13:59:29 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-07-22 13:59:29 +0000 |
commit | ff892ab41a3bce6b8043c2597d537cd803f517f9 (patch) | |
tree | 1fd27ee9f9e0091d65f9bdfbf6ca7bfdaded3162 /libs | |
parent | 7b316be27b5ccfe2ca57b88c5d72d241d794611c (diff) |
libs/lucid: perform full gc cycle prior to forking, massively improves memory consumption
Diffstat (limited to 'libs')
-rw-r--r-- | libs/lucid/luasrc/lucid.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/lucid/luasrc/lucid.lua b/libs/lucid/luasrc/lucid.lua index 5d62a6cd8..7ecdf2acd 100644 --- a/libs/lucid/luasrc/lucid.lua +++ b/libs/lucid/luasrc/lucid.lua @@ -136,7 +136,6 @@ function run() end elseif stat == 0 then ifaddrs = nixio.getifaddrs() - collectgarbage("collect") end for _, cb in ipairs(tickt) do @@ -231,6 +230,8 @@ function create_process(threadcb, waitcb) if threadlimit and tcount >= threadlimit then nixio.syslog("warning", "Cannot create thread: process limit reached") return nil + else + collectgarbage("collect") end local pid, code, err = nixio.fork() if pid and pid ~= 0 then |