-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Lua] - Locally scoped variables not gc-ed #1030
Comments
I think this is related to yuin/gopher-lua, not specific to Nakama Server Framework. According to yuin/gopher-lua#miscellaneous-notes there are slightly differences between yuin/gopher-lua and Just a few months ago, there was an context leak with coroutine lib yuin/gopher-lua#438, which I have already fixed and been merged yuin/gopher-lua@8ee9c41. Base of my observation the memory will be freed at some point of time. |
@deflinhec yes, this is specific to yuin/gopher-lua and partly to nakama and how it is using this lib. We could maybe close this but it would be than nice to extend lua docs and add best pratices when it comes to developing in sad runtime on what to take extra care. Like here for memory releasing time as it could impact session lenght/number of matches performed until "used" memory has been released. |
Description
Using locally scoped variables in lua runtime are not being released correctly, thus memory of table keeps increasing overtime.
Provided Code
`local d = {}
do
local a = {}
local b = 1
d['a'] = a
d['b'] = b
end
for k, v in pairs(d) do
print(k, v)
end
collectgarbage()
print("=====================")
for k, v in pairs(d) do
print(k, v)
end`
Steps to Reproduce
Expected Result
Inner locally scoped variables are released as soon as they are no longer used and memory is retained correctly.
Actual Result
Memory persists and inner locally scoped variables are kept.
Context
Your Environment
The text was updated successfully, but these errors were encountered: