I see. But when you refresh the page, the Flash Player instance is tore
down, so the player's memory is released. When you reload a stub swf, the
memory used by the player might or might not be released immediately. Most
likely it won't. That's not necessarily a bug or a leak. It could be, but my
point was that you should keep in mind that GC is not deterministic; because
maybe you don't have a leak in the first place. The mere fact that the
memory footprint grows doesn't mean there's a leak.

Cheers
Juan Pablo Califano



2009/10/1 TS <sunnrun...@gmail.com>

> Well I'm going to use gskinner's workaround by pulling the content swf from
> a subdomain. I am not looking at task manager overall sys memory but, at
> the
> privat working set from the processes tab. And I can see it get loaded then
> every refresh it adds 2-4MB to the working set. On page refresh it drops
> back to where it was.
>
> Thanks, T
>
> -----Original Message-----
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Juan Pablo
> Califano
> Sent: Thursday, October 01, 2009 6:35 AM
> To: Flash Coders List
>  Subject: Re: [Flashcoders] [MEMORY LEAK]
>
> >>>>
>
> Every time it reloads
> however, I watch firefox take away memory consistently and when I refresh
> that page memory use drops back to normal.
>
> >>>
>
> First and most important, are you sure it's leak? The fact that Firefox
> (not
> even the player itself) doesn't release memory right away doesn't mean
> there's a leak. At all.
>
> Sorry for the self reference, but a while ago I answered a question in
> stackoverflow about an alleged memory leak.
>
> http://stackoverflow.com/questions/1020146/why-sytem-totalmemory-keeps-incre
> asing/1022648#1022648.
> Perhaps it helps to get my point across.
>
> Looking at Qindows manager or System.totalMemory is probably the worst
> possible way to detect a leak, given how the player works. You'll get tons
> of false positives and the info is rather useless anyway.
>
> What has been of great help, at least for me, is using Flex Builder's
> profiler. It lets you inspect objects in memory, force a gc, etc. Plus, if
> you do find a leak, you can trace where the leaked object has been
> allocated. A simple test for your scenario would be taking a snapshot
> before
> loading your swf, then another when it's loaded, then unload, force a GC
> and
> take another snapshot. Then you can compare memory at those points and be
> in
> a better position to determine if there's a leak, and, in that case, what
> could be causing it.
>
> Hope it helps.
>
> Cheers
> Juan Pablo Califano
>
>
>
>
>
> 2009/9/30 TS <sunnrun...@gmail.com>
>
> > Hello, this issue is killing me. I had a swf that loaded an xml file then
> > loaded images from the xml file and then killed the display list, xml,
> > images etc... then restarted based on a timer. Every time it reloads
> > however, I watch firefox take away memory consistently and when I refresh
> > that page memory use drops back to normal. So, I said screw this, I'm
> going
> > to create an empty swf and load the swf with all the magic in it and add
> it
> > to the empty swf. I figured if I add the swf to the main stage and kill
> > that
> > one reference to the swf when I was done with it, I should have fixed my
> > problem. Here's my code. Can someone please tell me what is going on?
> >
> >
> > stop();
> >
> > var mLoader:Loader = new Loader();
> > function startLoad()
> > {
> >        var mRequest:URLRequest = new
> > URLRequest("hasch_flash/currently_watched_videos.swf");
> >        //var mRequest:URLRequest = new
> > URLRequest("currently_watched_videos.swf");
> >        mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
> > onCompleteHandler, false, 0, true);
> >        mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
> > onProgressHandler, false, 0, true);
> >        mLoader.load(mRequest);
> > }
> >
> > function onCompleteHandler(loadEvent:Event)
> > {
> >        trace("load " + loadEvent.currentTarget.content);
> >        trace("loadTarget " + loadEvent.target);
> >        addChild(loadEvent.currentTarget.content);
> > }
> > function onProgressHandler(mProgress:ProgressEvent)
> > {
> >        var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
> >        trace(percent);
> > }
> > startLoad();
> >
> >
> > TimerExample();
> >
> > // Set off timer to kill carousel and restart movie
> > function TimerExample() {
> >        var myTimer:Timer = new Timer(30000, 0);
> >        myTimer.addEventListener("timer", timerHandler);
> >        myTimer.start();
> > }
> >
> > function timerHandler(event:TimerEvent):void {
> >        trace(this.removeChildAt(0)); // remove from display list
> >        mLoader = null;
> >        mLoader =  new Loader(); // clear from memory
> >        startLoad();
> >        trace("timerHandler: " + event);
> > }
> >
> >
> > Thanks for any advice. T
> >
> > _______________________________________________
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to