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

Too much memory being consumed during some tests #50

Open
dibyendumajumdar opened this issue Sep 6, 2015 · 0 comments
Open

Too much memory being consumed during some tests #50

dibyendumajumdar opened this issue Sep 6, 2015 · 0 comments

Comments

@dibyendumajumdar
Copy link
Owner

When auto compiling all Lua functions, the memory usage increases greatly during the running of Lua tests. The problem has become apparent when running tests with -port=true; previously I was running tests with -U=true.

The issue seems to be because in JIT mode each compiled function has associated with it the LLVM module, execution engine plus the generated code. But Lua's garbage collector is unaware of the size of the function objects - hence the rate at which these objects are collected / finalized is not fast enough.

Putting a call to lua_gc(L, LUA_GCSTEP, 200) seems to help but then causes tests in gc.lua to fail.

For now I have put in a call to lua_gc(L, LUA_GCCOLLECT, 0) after every n JIT compilations - n can be configured. This is crude but appears to limit the amount of memory being used. A better solution is required - one that doesn't cause a full GC.

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