major Flash Player GC bug converting string to XML
When converting a string to XML the memory used by the XML will never free up no matter the references or garbage collection tricks you have up your sleeve. This is really excruciating when needing to parse large XML files from a Flex or AIR app.
http://bugs.adobe.com/jira/browse/SDK-11982
http://bugs.adobe.com/jira/browse/SDK-11244
http://bugs.adobe.com/jira/browse/FP-599 <- Looks like this issue has been open for well over a year and may be fixed for the next release of Flash Player (apparently not 10.0.42.34 released a few days ago, just checked, perhaps they mean the next full release :/)
UPDATE: Luca in the comments pointed me to an apparent fix they’ve added to AIR 1.5.2 via System.disposeXML(xml) found in the release notes here.
I’ve verified that this new method works like a charm. It seams like a bit of a strange one-off hack that they’ve put it in under System for AIR only but I’m guessing that they wanted to address it quickly for the SDK that needed it most. Hopefully the regular Flash Player fix is coming in the next major update and won’t require this unusual method.
I think that in AIR you have from 1.5.2 version a new static method called disposeXML to make available for garbage collection your XML.
More info in AIR release notes: http://www.adobe.com/support/documentation/en/air/1_5_2/releasenotes_developers.html
@luca that is amazing, thanks for the heads up! I’ll look into it
Hi i had question to disposeXML() method it’s require
Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10.1, AIR 1.5.2
When i try it’s in air app it’s works,
but when to try it on web using Flash player 10.1.84 and try on 3.2 and 4.0 sdks it’s can’t be compiled no Flash Builder 4 and therefore i can’t use it’s. Can you explain what i do wrong and simple sample how to do right.