-
Notifications
You must be signed in to change notification settings - Fork 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
NPC's have a (Lua) memory leak & crash potential #3552
Comments
Probably the npc system is at fault (I think it's known from having memory leaks), if you empty the lua files to bare minimum is it still leaking? Or if you use another npc. |
There's some exception with code forgottenserver/src/luascript.cpp Line 300 in 0e20d54
could someone confirm this with unmodded tfs? |
Before creating an issue, please ensure:
support matter (use https://otland.net/forums/support.16/ for support)
Steps to reproduce (include any configuration/script required to reproduce)
Expected behaviour
NPC's cleanly deallocate their memory upon being removed
Actual behaviour
NPC's do not deallocate their memory upon being removed
Observations
lua_gc
, reload times stay consistent, which gives evidence of the Lua environment getting trashedforgottenserver/src/luascript.cpp
Line 4604 in e1e1bc2
local activeTest = tests.monster
orlocal activeTest = tests.item
does not produce the same memory leakRELOAD_TYPE_TALKACTIONS
,RELOAD_TYPE_CREATURESCRIPTS
orRELOAD_TYPE_ACTIONS
etc, the entire Lua environment is affectedTest Outputs
With the call to
lua_gc
enabled (increasing timings)With the call to
lua_gc
disabled (consistent timings)Memory Graphs
NPC Test
Monster Test
Item Test
Impact on the server
Eventually, the Lua environment will run out of available memory to allocate and you will get the following error, after which the server will shortly crash
The text was updated successfully, but these errors were encountered: