Skip to content

Commit 04e53ee

Browse files
committed
bugfix: Lua VM might run out of memory when lua_code_cache is off; now we always enforce a full Lua GC cycle right after unloading most of the loaded Lua modules when the Lua code cache is turned off.
1 parent 8e6c9a3 commit 04e53ee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ngx_http_lua_cache.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ ngx_http_lua_clear_package_loaded(lua_State *L)
406406
/* package loaded */
407407
lua_pop(L, 2);
408408

409+
/* force a full GC cycle */
410+
lua_gc(L, LUA_GCCOLLECT, 0);
411+
409412
#if 0
410413
lua_newtable(L);
411414
lua_setglobal(L, "_G");

0 commit comments

Comments
 (0)