From b7861d6a318b300ee4f11ae06397352bba85081a Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Thu, 12 Aug 2021 22:34:09 -0700 Subject: [PATCH] Add Lua gc call to keep Lua memory usage constant --- tool/net/redbean.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tool/net/redbean.c b/tool/net/redbean.c index c9bad5f8c..237a636ba 100644 --- a/tool/net/redbean.c +++ b/tool/net/redbean.c @@ -545,6 +545,9 @@ static void CollectGarbage(void) { LOGIFNEG1(munmap(unmaplist.p[unmaplist.n].p, unmaplist.p[unmaplist.n].n)); LOGIFNEG1(close(unmaplist.p[unmaplist.n].f)); } +#ifndef STATIC + (void)lua_gc(L, LUA_GCCOLLECT); +#endif } static void UseOutput(void) {