libs/lucid: perform full gc cycle prior to forking, massively improves memory consumption
This commit is contained in:
parent
7b316be27b
commit
ff892ab41a
1 changed files with 2 additions and 1 deletions
|
@ -136,7 +136,6 @@ function run()
|
||||||
end
|
end
|
||||||
elseif stat == 0 then
|
elseif stat == 0 then
|
||||||
ifaddrs = nixio.getifaddrs()
|
ifaddrs = nixio.getifaddrs()
|
||||||
collectgarbage("collect")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, cb in ipairs(tickt) do
|
for _, cb in ipairs(tickt) do
|
||||||
|
@ -231,6 +230,8 @@ function create_process(threadcb, waitcb)
|
||||||
if threadlimit and tcount >= threadlimit then
|
if threadlimit and tcount >= threadlimit then
|
||||||
nixio.syslog("warning", "Cannot create thread: process limit reached")
|
nixio.syslog("warning", "Cannot create thread: process limit reached")
|
||||||
return nil
|
return nil
|
||||||
|
else
|
||||||
|
collectgarbage("collect")
|
||||||
end
|
end
|
||||||
local pid, code, err = nixio.fork()
|
local pid, code, err = nixio.fork()
|
||||||
if pid and pid ~= 0 then
|
if pid and pid ~= 0 then
|
||||||
|
|
Loading…
Reference in a new issue