View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:48 pm



Reply to topic  [ 3 posts ] 
 Memory leaks with MOSRotatings 
Author Message
DRL Developer
DRL Developer
User avatar

Joined: Thu Jun 11, 2009 2:34 pm
Posts: 966
Location: Moscow, Russia
Reply with quote
Post 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?


Wed Jan 26, 2011 9:02 pm
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post 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


Wed Jan 26, 2011 9:33 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Thu Jun 11, 2009 2:34 pm
Posts: 966
Location: Moscow, Russia
Reply with quote
Post Re: Memory leaks with MOSRotatings
That helped, thanks man. Memory still leaking a bit, but at least not so fast :)


Sat Jan 29, 2011 9:23 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.064s | 13 Queries | GZIP : Off ]