Animation suspends when Gargbage Collector cleans the memory

Software: Away3D 4.x

stani.spb, Newbie
Posted: 18 March 2014 09:30 AM   Total Posts: 4

I use md5 models for animation. I noticed a small problem which can be serious enough for making a game on Away3d technology. When animation is started , memory consumption immediately begin to grow average 1 kb per each enterFrame call. I found no memory allocations in my code. Scout showed that this small memory allocations occur in a View3d.render chain (i.e. in Object3d.lookAt function).

This would not be such a big poblem as Garbage Collector cleans the memory periodically. The problem is when GC cleans the memory, animation suspends for a second (iOS, PC)  which will be not a pleasant surprise for gamer.

Does anyone succeeded to escape such animation pauses on these constant GC memory cleans?


Kicker, Member
Posted: 12 May 2017 06:26 PM   Total Posts: 52   [ # 1 ]

Just stumbled upon the same problem recently. The garbage collector makes the game stutter every few seconds when animations are playing.
It makes my game almost completely unplayable…


Kicker, Member
Posted: 13 May 2017 11:23 AM   Total Posts: 52   [ # 2 ]

I found something that solves the issue, partly: When an animation stops, the animator keeps playing, and the skeleton is marked as dirty at every frame, even though no animation is playing. So if you don’t have any animation to play at a given time, calling animator.stop() can greatly reduce the garbage collection, depending on your situation.
But it’s still a makeshift solution… Maybe there a way to pool some of the stuff being garbage collected, I don’t know.



Away3D Forum

Member Login