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
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/