REFramework
REFramework copied to clipboard
[MHR] memory leak
while working on a mod i opened the garbage colection stats and saw the memory ticking up i managed to pinpoint the issue to a function hooked with on_pre_gui_draw_element
this is the smallest script i could replicate it on
function on_draw(element, context)
local game_object = element:call("get_GameObject")
return true
end
re.on_pre_gui_draw_element(on_draw)
the only setting that fixed this was swaping the garbage collection handler to lua and not the REFramework one
Though I'm not 100% sure I think this issue might have been the cause of a recent crash problem I was having. As it was crashing after a few hunts consistently (usually after 30-40 mins). At the time I hadn't read this post yet so I didn't really test much and just downgraded after a while but it was taking down steam with it, and even the terminal if I tried running steam from it (I'm on Linux), so I couldn't even check error messages.
crash dump: reframework_crash.zip
Same here. When I am modding the game, I noticed that the game will randomly freeze for a random time when I click "Reset script".
Just now I click "Reset script" to reload my newest change, then the game froze. I found the game was using ~15GB mem at that time and kept decresing ( I guess it's doing GC) until 2GB, then the game resumed.
Here is the mem usage graph:
this could solve the problem
The garbage collection handler setting removes some of the symptoms, but RAM and VRAM both keep increasing. 1.3.4 does not have this issue (or at least not badly enough to notice it until you leave the game open for 5 hours), every version afterwards does.
The garbage collection handler setting removes some of the symptoms, but RAM and VRAM both keep increasing. 1.3.4 does not have this issue (or at least not badly enough to notice it until you leave the game open for 5 hours), every version afterwards does.
is this still the case in the latest release, or has the mem leak been corrected?