[RESOLVED] Memory leaks with tables ?
Posted: Sat Oct 15, 2016 2:19 pm
Hello !
I'm making a framework on the top of Love, and I've been doing some example when I saw the tween lagging after a few seconds. Adding some debug info to the drawing, I can see the FPS dropping when the memory is expending. The problem is the memory does not stop growing, at a point where I can have 1 FPS for a simple love.graphics.print .
The GitHub repo : https://github.com/neoshadow-studio/ns-framework
You need to see the "example/scene_node.moon" file. Basically, it create a scene node and a tween (framework/scene_tree/tween.moon) and the FPS are dropping and the memory grows while the tween is processing. The memory extensive step of this process is the computation of the interpolated value (line 218) :
In the example the interpolated value is a vector (framework/scene_tree/transform.moon) which has the __add, __sub, __mul and __div meta-methods, which create a new instance of the Vector class. I don't really know if the leak come from here, and I don't know how to debug this and how to fix this problem.
Thanks for your help and your answers !
I'm making a framework on the top of Love, and I've been doing some example when I saw the tween lagging after a few seconds. Adding some debug info to the drawing, I can see the FPS dropping when the memory is expending. The problem is the memory does not stop growing, at a point where I can have 1 FPS for a simple love.graphics.print .
The GitHub repo : https://github.com/neoshadow-studio/ns-framework
You need to see the "example/scene_node.moon" file. Basically, it create a scene node and a tween (framework/scene_tree/tween.moon) and the FPS are dropping and the memory grows while the tween is processing. The memory extensive step of this process is the computation of the interpolated value (line 218) :
Code: Select all
v = @start_value + (@end_value - @start_value) * @.easing t
@reference.value = v
Thanks for your help and your answers !