Your best option is not to bring in 20MB of XML at a time.

 

Also, due to the way the player managers memory, doing a A,B,C test
isn't going to tell you much.  You really need to write a loop that
loads new XML every 30 seconds and let it run overnight and see if
memory tops out.  If the strings are relatively similar, the memory
should stop growing in any significant way.  We did make many changes to
reduce the memory load in Flex 3 for XML, but you'll still see some
growth.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Ilam Mougy
Sent: Saturday, March 29, 2008 6:26 PM
To: [email protected]
Subject: [flexcoders] Re: memory leak in converting string to xml

 

Well, it looks like this is a known "deferred" issue.
Looks like the player (not the Flex sdk) is the one that leaks when
you convert string to xml
(https://bugs.adobe.com/jira/browse/SDK-11982
<https://bugs.adobe.com/jira/browse/SDK-11982> ), but this means, if you
have a RIA that asks for repeated xml files, it will be crash!

I wish I know any way to convert to xml and avoiding the string route.
Anyone?

Thanks,

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Ilam Mougy" <[EMAIL PROTECTED]> wrote:
>
> I am almost giving up on this issue, I don't know any work around.
> Here is example, in AS:-
> 
> var strToBeXML:String = '<root>...</root>';// this is huge string,
> 20Meg xml for example.
> myTrace('***** memory before xml conversion (A): ' +
System.totalMemory);
> var xmlObj:XML = new XML(strToBeXML);
> myTrace('***** memory after xml conversion (B): ' +
System.totalMemory);
> // now, there is no way to get rid of this increase in memory!
> xmlObj = null;
> myTrace('***** memory after xml deletion (C): ' + System.totalMemory);
> 
> protected function myTrace(str:String):void{
> forceGC();
> trace(str);
> }
> public function forceGC():void{
> try {
> new LocalConnection().connect('foo');
> new LocalConnection().connect('foo');
> } catch (e:*) {}
> }
> 
> (C) is always similar to (B).
> Any hits? I need to get rid of this xml object memory allocation and
> I can't. I think I read all the articles about memory leaks. I
> haven't used Flex 3 yet, but I am sure if I try and it says there is a
> leak, so what, what should I do?
> 
> Thanks for your help.
>

 

Reply via email to