[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Change in GC behaviour -- Ever-increasing memory usage
- From: Sergey Zakharchenko <doublef.mobile@...>
- Date: Wed, 30 Jan 2019 11:50:24 +0000
Hello Pedro,
Pedro Tammela <pctammela@gmail.com>:
> I believe this issue happens in 'normal' tables as well.
> This code [1] will grow the memory steadily and will exhaust the
> [1] https://pastebin.com/KCsHduKB
for (i = 0; i < (1UL << 24); i++) {
void *ptr;
ptr = lua_newuserdata(L, 4096);
luaL_setmetatable(L, "mt");
ref = luaL_ref(L, 1);
luaL_unref(L, 1, ref);
}
I may be misunderstanding but ... Don't you just keep creating
userdata and filling up the Lua stack? There's no lua_pop or similar.
luaL_unref [-0, +0, -] only unrefs the object, but doesn't pop it.
Best regards,
--
DoubleF