Memory consumption is one of the big
work-items on the next version of the Player, beyond that I don’t have
much info other than what I’ve posted already.
Matt
From: Scott Barnes [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 02, 2005
11:52 PM
To: [email protected]
Subject: [flexcoders] Memory Leak?
I dunno whats going with GMAIL as I tried sending this earlier but
kept going to Matt only...
Heres a memory Leak test thing I did.
I did a basic script which looks like this:
<mx:Script>
<![CDATA[
public var IsViewStack:Boolean = false;
import mx.containers.*;
import mx.controls.*;
import com.SynergyFLEX.viewpods.test.testpod1;
import com.SynergyFLEX.viewpods.test.testpod2;
import com.SynergyFLEX.viewpods.test.testpod3;
import de.richinternet.utils.Dumper;
function loadPod() {
if(IsViewStack) {
} else {
var aList = new Array();
aList.push(testpod1);
aList.push(testpod2);
aList.push(testpod3);
aList.push(Button);
aList.push(TabNavigator);
aList.push(Accordion);
aList.push(Label);
aList.push(TextInput);
var itm = Math.round(Math.random()*aList.length);
Dumper.info(itm);
var t = baseStack.createChild(aList[itm]);
baseStack.selectedChild = t;
}
}
function delPod(indx) {
baseStack.destroyChildAt(indx);
}
]]>
</mx:Script>
<mx:HBox
width="100%">
<mx:Button label="LoadPod()" click="loadPod()"/>
<mx:Button label="Del Pod 1" click="delPod(1)"/>
<mx:Button label="Del Pod 2" click="delPod(2)"/>
<mx:Button label="Del Pod 3" click="delPod(3)"/>
<mx:Button label="Del Pod 4" click="delPod(4)"/>
</mx:HBox>
<mx:HBox
width="100%" height="100%">
<!-- Sector 1-->
<mx:Panel id="sector1" width="100%"
height="100%">
</mx:Panel>
<!-- Sector 2 -->
<mx:Panel id="sector2" width="100%"
height="100%">
</mx:Panel>
<!-- Sector 3 -->
<mx:Panel id="sector3" width="100%"
height="100%">
<mx:LinkBar id="sectorLinks"
dataProvider="baseStack"/>
<mx:ViewStack id="baseStack" width="100%"
height="100%">
<mx:HBox label="Test"/>
</mx:ViewStack>
</mx:Panel>
</mx:HBox>
Both browsers continue to ask for more memory
every click of
createChild and Destroy. Furthermore when you
click on LinkBar items
(back and forth randomly) I noticed that it too
increases memory.
I then noticed if you refresh your browser memory
(thankfully) reverts
back to its original size.
After 15 mins the best result I got was:
Internet Explorer:
before: 51,000k (give or take)
after: 55,500k (give or take)
15mins: 55,400k (give or take)
FireFox was pretty much the same results.
Q. Am i destroying incorrectly? should i do
something else first? ie
what should i do.
As over a long period an application can easily
climb in memory usage
and the only counter-act for this would be to
change mxml files via
url when they go from screen to screen? it seems
cumbersome but that
appears base don the above to be a possible
solution?
--
Regards,
Scott Barnes
http://www.mossyblog.com
http://www.flexcoder.com
(Coming Soon)
Yahoo! Groups Links
|