Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory over usage by the Lua infrastructure: Lua scripts bytecode cache is not freed during garbage collection #6305

Open
asafpor opened this issue Aug 6, 2019 · 0 comments

Comments

@asafpor
Copy link

asafpor commented Aug 6, 2019

On each creation of new Lua script, a new closure is allocated and the allocated object is linked to the garbage collection.
{code}
Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e) {
Closure *c = cast(Closure *, luaM_malloc(L, sizeLclosure(nelems)));
luaC_link(L, obj2gco(c), LUA_TFUNCTION);
{code}

Creation of many scripts cause inflation of the memory used by the Lua infrastructure of Redis.

From reviewing the code seems like the LUA_TFUNCTION should be freed by the garbage collection, but, for some reason the closures are stored forever.
Is it by design, how can I free the bytecode cache without reset the Lua engine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant