PDA

View Full Version : Possible Memory Leak?



absolutezero342
October 5th, 2007, 11:11 AM
OK, here's the situation...I have one SWF acting as a loader to load in the rest of my SWF's and in the loader SWF I have a ScrollPane instance on stage and when nav buttons are clicked, I load new SWF's into the ScrollPane instance. The "home.swf" loads by default at startup. When I click on another SWF, there is a call to:



var req:URLRequest = new URLRequest("another.swf");
ScrollPaneInstance.load(req);


which loads the new SWF and SHOULD unload the previous SWF. Notice I say "SHOULD"!
I run a trace on System.totalMemory at regular intervals and the number never decreases; in fact, it increases drastically! For example, when I click a button and load in a new SWF, it will jump 10MB, but then when I click back to "home.swf", it will jump even higher yet!

Here's an example trace output doing what I just described(loading "home.swf", loading "another.swf" and then clicking back to "home.swf"):

21.640625MB
21.7578125MB
21.765625MB
21.78515625MB
21.7890625MB
26.2421875MB
26.50390625MB
32.67578125MB
34.03125MB
34.03515625MB

Your help is appreciated!

absolutezero342
October 5th, 2007, 01:15 PM
hello anybody?

SlowRoasted
October 5th, 2007, 01:20 PM
unload before you load a new one

absolutezero342
October 5th, 2007, 01:27 PM
there is no unload method on ScrollPane, so you are left with setting a new source, that's the only way I know of to "unload" anyway!

absolutezero342
October 5th, 2007, 03:29 PM
c'mon guys, give me something....sorry, I'm impatient at this point!

robgungor
October 6th, 2007, 02:45 PM
c'mon guys, give me something....sorry, I'm impatient at this point!

Hey Man,

I'm pretty sure this memory leak is a flash bug that someone like senocular could address. I've seen three other posts recently that address it.

rob