Data Realms Fan Forums
http://45.55.195.193/

Memory leaks with MOSRotatings
http://45.55.195.193/viewtopic.php?f=73&t=21271
Page 1 of 1

Author:  weegee [ Wed Jan 26, 2011 9:02 pm ]
Post subject:  Memory leaks with MOSRotatings

I'm making a new mod with complex UI and I use lots of MOSRotatings to draw UI elements. Sometimes the whole UI needs to be redrawn every 5 seconds, that means that about 1000 of "particles" are removed and then put back. But although I use ToDelete, = nil and RemoveParticle on every particle I draw, memory graph keeps getting higher and higher until it hits 2Gb limit at 32bit Win7 and crashes CC. I've monitored particle count and found no particle leaks. Everything drawn gets removed for sure. It's not Lua memory, I use manually start GC every 5 and it shows approx 800kb memory all the time. And memory remains used even if I restart my activity. Any ways to fix this somehow?

Author:  none [ Wed Jan 26, 2011 9:33 pm ]
Post subject:  Re: Memory leaks with MOSRotatings

hmm no quite sure about that, here is my script for a UI element I use a MOSParticle instead.

Code:
if MovableMan:ValidMO(self.ui) then
   self.ui.Pos = Vector(self.Pos.X, self.Pos.Y - 26);
   self.ui:NotResting();
   self.ui.Age = 0;
   self.ui.ToSettle = false;
else
   self.ui = CreateMOSParticle("UI element");
   self.ui.Pos = Vector(self.Pos.X, self.Pos.Y - 26);
   MovableMan:AddParticle(self.ui);
end

Author:  weegee [ Sat Jan 29, 2011 9:23 pm ]
Post subject:  Re: Memory leaks with MOSRotatings

That helped, thanks man. Memory still leaking a bit, but at least not so fast :)

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/