Re: [Flashcoders] [MEMORY LEAK]

2009-10-02 Thread Muzak
I'd say, keep the loader instance (instead of creating a new one each time) and unload the loader content (the swf) using 
Loader.unloadAndStop.

http://kb2.adobe.com/cps/403/kb403670.html

http://www.gskinner.com/blog/archives/2008/07/additional_info.html

regards,
Muzak

- Original Message - 
From: Gregory Boland breakfastcof...@gmail.com

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Friday, October 02, 2009 5:57 AM
Subject: Re: [Flashcoders] [MEMORY LEAK]



All I can say is that you aren't releasing all of the references to this
material that you are trying to release from memory.

So after you make this call

addChild(loadEvent.currentTarget.content);

make that = to null as well as any other time that you are referring to this
content you are trying to rid.

I know if you run your program in Flex Builder and choose the profiler, you
can actually purge the garbage manually and see if the object you want to be
deleted gets purged.  If it hasn't then there is still something that is
referencing it.  However, after looking at your code it seems that you are
writing it on the timeline and i'm not sure how you would go about putting
that into Flex Builder.

best of luck

greg


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] [MEMORY LEAK]

2009-10-02 Thread TS
Muzak, I've got that already.

function timerHandler(event:TimerEvent):void {
trace(this.removeChildAt(0)); // remove loaded swf from display list
mLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, 
onCompleteHandler);
mLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, 
onProgressHandler);   
mLoader.unloadAndStop();
mLoader = null;
mLoader =  new Loader(); // clear from memory
startLoad();
trace(timerHandler:  + event);
}

Thanks, T

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Muzak
Sent: Friday, October 02, 2009 5:38 AM
To: Flash Coders List
Subject: Re: [Flashcoders] [MEMORY LEAK]

I'd say, keep the loader instance (instead of creating a new one each time) and 
unload the loader content (the swf) using 
Loader.unloadAndStop.
http://kb2.adobe.com/cps/403/kb403670.html

http://www.gskinner.com/blog/archives/2008/07/additional_info.html

regards,
Muzak

- Original Message - 
From: Gregory Boland breakfastcof...@gmail.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Friday, October 02, 2009 5:57 AM
Subject: Re: [Flashcoders] [MEMORY LEAK]


 All I can say is that you aren't releasing all of the references to this
 material that you are trying to release from memory.

 So after you make this call

 addChild(loadEvent.currentTarget.content);

 make that = to null as well as any other time that you are referring to this
 content you are trying to rid.

 I know if you run your program in Flex Builder and choose the profiler, you
 can actually purge the garbage manually and see if the object you want to be
 deleted gets purged.  If it hasn't then there is still something that is
 referencing it.  However, after looking at your code it seems that you are
 writing it on the timeline and i'm not sure how you would go about putting
 that into Flex Builder.

 best of luck

 greg

___
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


Re: [Flashcoders] [MEMORY LEAK]

2009-10-02 Thread Muzak

All you need is:

function timerHandler(event:TimerEvent):void {
mLoader.unloadAndStop();
startLoad();
trace(timerHandler:  + event);
}

- Original Message - 
From: TS sunnrun...@gmail.com

To: 'Flash Coders List' flashcoders@chattyfig.figleaf.com
Sent: Friday, October 02, 2009 9:27 PM
Subject: RE: [Flashcoders] [MEMORY LEAK]



Muzak, I've got that already.

function timerHandler(event:TimerEvent):void {
trace(this.removeChildAt(0)); // remove loaded swf from display list
mLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, 
onCompleteHandler);
mLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler); 
mLoader.unloadAndStop();

mLoader = null;
mLoader =  new Loader(); // clear from memory
startLoad();
trace(timerHandler:  + event);
}

Thanks, T



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread Ian Thomas
Just out of interest - why are you recreating the Loader() and
re-adding the listeners each time? It should work if you just create
the Loader once, add the listeners once - then every time you call
load() with a new URLRequest, you'll get new progress and complete
events.

Might help with your leaks.

HTH,
   Ian

On Thu, Oct 1, 2009 at 2:28 AM, TS sunnrun...@gmail.com wrote:
 Thanks for the info. Still reading it but, fme, it seems silly there's not
 an ExitRestart() method or something.

 Thanks, T


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Chris Foster
 Sent: Wednesday, September 30, 2009 7:08 PM
 To: Flash Coders List
 Subject: RE: [Flashcoders] [MEMORY LEAK]

 Hi T,

 No solution here, but this might relate to your current problem:
 http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html


 C:


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of TS
 Sent: Thursday, 1 October 2009 10:53 AM
 To: 'Flash Coders List'
 Subject: [Flashcoders] [MEMORY LEAK]

 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(3, 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
 This e-mail, including any attached files, may contain confidential and
 privileged information for the sole use of the intended recipient.  Any
 review, use, distribution, or disclosure by others is strictly prohibited.
 If you are not the intended recipient (or authorized to receive information
 for the intended recipient), please contact the sender by reply e-mail and
 delete all copies of this message.

 ___
 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


Re: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread Juan Pablo Califano


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-increasing/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(3, 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


Re: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread Jim Lafser
Problem might be with the XML class. I've seen problems in Flash Lite 3 where 
the idMap property of the XML class had to be deleted to prevent a memory leak. 
Tracing idMap will say undefined, must use ObjectDumper to see what it's 
actually pointing at. It appears that it will leak only if the XML file has 
nodes with an attribute of id.

--- On Thu, 10/1/09, Ian Thomas i...@eirias.net wrote:


From: Ian Thomas i...@eirias.net
Subject: Re: [Flashcoders] [MEMORY LEAK]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Date: Thursday, October 1, 2009, 4:17 AM


Just out of interest - why are you recreating the Loader() and
re-adding the listeners each time? It should work if you just create
the Loader once, add the listeners once - then every time you call
load() with a new URLRequest, you'll get new progress and complete
events.

Might help with your leaks.

HTH,
   Ian

On Thu, Oct 1, 2009 at 2:28 AM, TS sunnrun...@gmail.com wrote:
 Thanks for the info. Still reading it but, fme, it seems silly there's not
 an ExitRestart() method or something.

 Thanks, T


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Chris Foster
 Sent: Wednesday, September 30, 2009 7:08 PM
 To: Flash Coders List
 Subject: RE: [Flashcoders] [MEMORY LEAK]

 Hi T,

 No solution here, but this might relate to your current problem:
 http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html


 C:


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of TS
 Sent: Thursday, 1 October 2009 10:53 AM
 To: 'Flash Coders List'
 Subject: [Flashcoders] [MEMORY LEAK]

 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(3, 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
 This e-mail, including any attached files, may contain confidential and
 privileged information for the sole use of the intended recipient.  Any
 review, use, distribution, or disclosure by others is strictly prohibited.
 If you are not the intended recipient (or authorized to receive information
 for the intended recipient), please contact the sender by reply e-mail and
 delete all copies of this message.

 ___
 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

RE: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread TS
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(3, 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


RE: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread TS
I was just trying to clear that var. I thought if I said loader = new
Loader() it would make sure to kill the old loader and it's content?

Thanks, T

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Ian Thomas
Sent: Thursday, October 01, 2009 2:18 AM
To: Flash Coders List
Subject: Re: [Flashcoders] [MEMORY LEAK]

Just out of interest - why are you recreating the Loader() and
re-adding the listeners each time? It should work if you just create
the Loader once, add the listeners once - then every time you call
load() with a new URLRequest, you'll get new progress and complete
events.

Might help with your leaks.

HTH,
   Ian

On Thu, Oct 1, 2009 at 2:28 AM, TS sunnrun...@gmail.com wrote:
 Thanks for the info. Still reading it but, fme, it seems silly there's not
 an ExitRestart() method or something.

 Thanks, T


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Chris
Foster
 Sent: Wednesday, September 30, 2009 7:08 PM
 To: Flash Coders List
 Subject: RE: [Flashcoders] [MEMORY LEAK]

 Hi T,

 No solution here, but this might relate to your current problem:
 http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html


 C:


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of TS
 Sent: Thursday, 1 October 2009 10:53 AM
 To: 'Flash Coders List'
 Subject: [Flashcoders] [MEMORY LEAK]

 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(3, 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
 This e-mail, including any attached files, may contain confidential and
 privileged information for the sole use of the intended recipient.  Any
 review, use, distribution, or disclosure by others is strictly prohibited.
 If you are not the intended recipient (or authorized to receive
information
 for the intended recipient), please contact the sender by reply e-mail and
 delete all copies of this message.

 ___
 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


Re: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread Juan Pablo Califano
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(3, 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

RE: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread Kerry Thompson
Juan Pablo Califano wrote:

 The mere fact that the
 memory footprint grows doesn't mean there's a leak.

Juan Pablo is correct, and it's important to understand why. (If you already
understand garbage collection, you need read no further, unless you want to
check the accuracy of my description :-)

As you create objects, or even variables, the Flash player allocates
memory--this is common to most runtime engines/virtual machines, including
Shockwave, C#, Java, Visual Basic (I think), and all the way back to UCSD
Pascal.

When you delete an object, or a variable goes out of scope, that memory is
no longer needed, and the Flash player notes that it is available for
re-use. It does not, however, immediately re-use the memory--in fact, it
probably doesn't even zero it out right away. The data are still there, but
the memory is marked as available.

These memory blocks are often not contiguous--your memory looks something
like a fragmented hard disk. You have a few bytes here, a couple K bytes
there. When the Flash player's memory gets too fragmented, it does a
garbage collection. That is, it moves currently-valid objects and
variables around to make everything contiguous (un-fragmented) again. It's
much like defragmenting your hard drive, except it is done in RAM (or
virtual RAM).

The browser is probably doing the same thing. If the user has navigated away
from your Flash page, it doesn't necessarily free that memory immediately.
In fact, it probably won't, so you can still navigate forwards and
backwards.

It's sort of like deleting a file on your disk used to be. I think it's
handled differently now, but in the bad old days, the OS would simply write
a special character into the first byte of the file. There were utilities we
used to recover accidentally deleted files--we could explore the disk, find
the data, change the first byte back to what it was supposed to be, and the
file was restored. (That's somewhat simplified, but it's the right concept).

HTH.

Cordially,

Kerry Thompson

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread TS
 The mere fact that the
memory footprint grows doesn't mean there's a leak.

So, is there a way to keep that footprint from growing. Is it poor garbage
collection?

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 1:24 PM
To: Flash Coders List
Subject: Re: [Flashcoders] [MEMORY LEAK]

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(3, 0);
 myTimer.addEventListener(timer, timerHandler);
 myTimer.start();
  }
 
  function timerHandler(event:TimerEvent):void {
 trace(this.removeChildAt(0)); // remove from display list

RE: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread TS
Yes I understand garbage collection(GC) and how it's SUPPOSE to work :)
However, there still remains the fact that my browser is at say 146,000K
private working set memory. Let my swf file sit there for a half hour or
more and now the working set is up to 300,000K. Refresh the page that the
swf is on and memory drops back to 146,000K. Now, turn off the mechanism
that kills the content swf and re-adds it to the main swf and viola, the
memory stays consistent at 146,000K.

So, is this code not removing the content.swf appropriately on my Timer?
Shouldn't GC be working appropriately and FF not adding additional memory?

function timerHandler(event:TimerEvent):void {
trace(this.removeChildAt(0)); // remove from display list
mLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,
onCompleteHandler); // clear from memory

mLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,
onProgressHandler); // clear from memory
mLoader.unloadAndStop();// clear from memory
mLoader = null; // clear from memory
mLoader =  new Loader(); // clear from memory
startLoad();
trace(timerHandler:  + event);
}

Thanks, T

PS I've been in IT since I was a kid and yes they still do mark the sectors
with a special character. The only secure erase from a drive is to do full
format and go a step further by writing back on the drive with garbage data
many times over until your paranoid self can feel good about it. However,
ultimately physically destroying the drive is the best way =)



-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
Thompson
Sent: Thursday, October 01, 2009 2:06 PM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] [MEMORY LEAK]

Juan Pablo Califano wrote:

 The mere fact that the
 memory footprint grows doesn't mean there's a leak.

Juan Pablo is correct, and it's important to understand why. (If you already
understand garbage collection, you need read no further, unless you want to
check the accuracy of my description :-)

As you create objects, or even variables, the Flash player allocates
memory--this is common to most runtime engines/virtual machines, including
Shockwave, C#, Java, Visual Basic (I think), and all the way back to UCSD
Pascal.

When you delete an object, or a variable goes out of scope, that memory is
no longer needed, and the Flash player notes that it is available for
re-use. It does not, however, immediately re-use the memory--in fact, it
probably doesn't even zero it out right away. The data are still there, but
the memory is marked as available.

These memory blocks are often not contiguous--your memory looks something
like a fragmented hard disk. You have a few bytes here, a couple K bytes
there. When the Flash player's memory gets too fragmented, it does a
garbage collection. That is, it moves currently-valid objects and
variables around to make everything contiguous (un-fragmented) again. It's
much like defragmenting your hard drive, except it is done in RAM (or
virtual RAM).

The browser is probably doing the same thing. If the user has navigated away
from your Flash page, it doesn't necessarily free that memory immediately.
In fact, it probably won't, so you can still navigate forwards and
backwards.

It's sort of like deleting a file on your disk used to be. I think it's
handled differently now, but in the bad old days, the OS would simply write
a special character into the first byte of the file. There were utilities we
used to recover accidentally deleted files--we could explore the disk, find
the data, change the first byte back to what it was supposed to be, and the
file was restored. (That's somewhat simplified, but it's the right concept).

HTH.

Cordially,

Kerry Thompson

___
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


Re: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread Gregory Boland
TS,

what is the content that you are loading from this external swf every 30,000
milliseconds?  It is feasible that what you are loading is causing the
memory of the Flash player to increase?

I never saw where you ready the swf itself for garbage collection.  I see
that you are setting the loader to null but you still have the content on
the stage.  Although it looks like you are trying to remove something from
the display list at position 0.

Are you sure that you are removing what you are intending to remove?  Maybe
a more thorough emptying of the display list is in order such as a for loop
through the list, removing whatever might be on it.

And keep in mind that the garbage collection doesn't necc happen as soon as
you make something = null.  It happens on a garbage cycle when Flash feels
like it, not when u want it to.


In Flash Player 9, the garbage collector's operations are deferred. This is
a very important thing to understand. Your objects will not be removed
immediately when all active references are deleted. Rather, they will be
removed at some indeterminate time in the future (from a developer
standpoint). The garbage collector uses a set of heuristics that look at the
RAM allocation and the size of the memory stack, among other things, to
determine when to run.
 -

http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html

greg


On Thu, Oct 1, 2009 at 5:00 PM, TS sunnrun...@gmail.com wrote:

 Yes I understand garbage collection(GC) and how it's SUPPOSE to work :)
 However, there still remains the fact that my browser is at say 146,000K
 private working set memory. Let my swf file sit there for a half hour or
 more and now the working set is up to 300,000K. Refresh the page that the
 swf is on and memory drops back to 146,000K. Now, turn off the mechanism
 that kills the content swf and re-adds it to the main swf and viola, the
 memory stays consistent at 146,000K.

 So, is this code not removing the content.swf appropriately on my Timer?
 Shouldn't GC be working appropriately and FF not adding additional memory?

 function timerHandler(event:TimerEvent):void {
trace(this.removeChildAt(0)); // remove from display list
 mLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,
 onCompleteHandler); // clear from memory

 mLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,
 onProgressHandler); // clear from memory
mLoader.unloadAndStop();// clear from memory
mLoader = null; // clear from memory
 mLoader =  new Loader(); // clear from memory
startLoad();
trace(timerHandler:  + event);
 }

 Thanks, T

 PS I've been in IT since I was a kid and yes they still do mark the sectors
 with a special character. The only secure erase from a drive is to do full
 format and go a step further by writing back on the drive with garbage data
 many times over until your paranoid self can feel good about it. However,
 ultimately physically destroying the drive is the best way =)



 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: Thursday, October 01, 2009 2:06 PM
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] [MEMORY LEAK]

 Juan Pablo Califano wrote:

  The mere fact that the
  memory footprint grows doesn't mean there's a leak.

 Juan Pablo is correct, and it's important to understand why. (If you
 already
 understand garbage collection, you need read no further, unless you want to
 check the accuracy of my description :-)

 As you create objects, or even variables, the Flash player allocates
 memory--this is common to most runtime engines/virtual machines, including
 Shockwave, C#, Java, Visual Basic (I think), and all the way back to UCSD
 Pascal.

 When you delete an object, or a variable goes out of scope, that memory is
 no longer needed, and the Flash player notes that it is available for
 re-use. It does not, however, immediately re-use the memory--in fact, it
 probably doesn't even zero it out right away. The data are still there, but
 the memory is marked as available.

 These memory blocks are often not contiguous--your memory looks something
 like a fragmented hard disk. You have a few bytes here, a couple K bytes
 there. When the Flash player's memory gets too fragmented, it does a
 garbage collection. That is, it moves currently-valid objects and
 variables around to make everything contiguous (un-fragmented) again. It's
 much like defragmenting your hard drive, except it is done in RAM (or
 virtual RAM).

 The browser is probably doing the same thing. If the user has navigated
 away
 from your Flash page, it doesn't necessarily free that memory immediately.
 In fact, it probably won't, so you can still navigate forwards and
 backwards.

 It's sort of like deleting a file on your disk used to be. I think it's
 handled differently now, but in the bad old days, the OS would simply

RE: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread TS
I have 2 swfs. 

1) Loader SWF: no assets are on stage nor are they loaded into other than
the content swf. The code is a timer and a loader. The timer reloads the
loader every 30 seconds which pulls in the content swf. And yes the remove
something from the display list at position 0. is the content swf which
does disappear when removed from the display list. When I check for
numChildren there is indeed only one item in the display list which is then
removed.

2) Content swf: loads an xml file with 10 references to thumbnails, then
after finished it loads the thumbs into a carousel.

The timer essentially kills the content swf and reloads it. The purpose of
the entire app is to show thumbnails of videos currently being watched and
refreshes every 30 seconds.

Is it possible that the content swf is loading something that is running as
a global var or something which keeps it in the loader swf?

Thanks, T





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gregory
Boland
Sent: Thursday, October 01, 2009 3:39 PM
To: Flash Coders List
Subject: Re: [Flashcoders] [MEMORY LEAK]

TS,

what is the content that you are loading from this external swf every 30,000
milliseconds?  It is feasible that what you are loading is causing the
memory of the Flash player to increase?

I never saw where you ready the swf itself for garbage collection.  I see
that you are setting the loader to null but you still have the content on
the stage.  Although it looks like you are trying to remove something from
the display list at position 0.

Are you sure that you are removing what you are intending to remove?  Maybe
a more thorough emptying of the display list is in order such as a for loop
through the list, removing whatever might be on it.

And keep in mind that the garbage collection doesn't necc happen as soon as
you make something = null.  It happens on a garbage cycle when Flash feels
like it, not when u want it to.


In Flash Player 9, the garbage collector's operations are deferred. This is
a very important thing to understand. Your objects will not be removed
immediately when all active references are deleted. Rather, they will be
removed at some indeterminate time in the future (from a developer
standpoint). The garbage collector uses a set of heuristics that look at the
RAM allocation and the size of the memory stack, among other things, to
determine when to run.
 -

http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html

greg


On Thu, Oct 1, 2009 at 5:00 PM, TS sunnrun...@gmail.com wrote:

 Yes I understand garbage collection(GC) and how it's SUPPOSE to work :)
 However, there still remains the fact that my browser is at say 146,000K
 private working set memory. Let my swf file sit there for a half hour or
 more and now the working set is up to 300,000K. Refresh the page that the
 swf is on and memory drops back to 146,000K. Now, turn off the mechanism
 that kills the content swf and re-adds it to the main swf and viola, the
 memory stays consistent at 146,000K.

 So, is this code not removing the content.swf appropriately on my Timer?
 Shouldn't GC be working appropriately and FF not adding additional memory?

 function timerHandler(event:TimerEvent):void {
trace(this.removeChildAt(0)); // remove from display list
 mLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,
 onCompleteHandler); // clear from memory

 mLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,
 onProgressHandler); // clear from memory
mLoader.unloadAndStop();// clear from memory
mLoader = null; // clear from memory
 mLoader =  new Loader(); // clear from memory
startLoad();
trace(timerHandler:  + event);
 }

 Thanks, T

 PS I've been in IT since I was a kid and yes they still do mark the
sectors
 with a special character. The only secure erase from a drive is to do full
 format and go a step further by writing back on the drive with garbage
data
 many times over until your paranoid self can feel good about it. However,
 ultimately physically destroying the drive is the best way =)



 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: Thursday, October 01, 2009 2:06 PM
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] [MEMORY LEAK]

 Juan Pablo Califano wrote:

  The mere fact that the
  memory footprint grows doesn't mean there's a leak.

 Juan Pablo is correct, and it's important to understand why. (If you
 already
 understand garbage collection, you need read no further, unless you want
to
 check the accuracy of my description :-)

 As you create objects, or even variables, the Flash player allocates
 memory--this is common to most runtime engines/virtual machines, including
 Shockwave, C#, Java, Visual Basic (I think), and all the way back

RE: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread TS
Been letting it run for a few hrs now and firefox is now using almost a gig
of memory.

Thanks, T

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gregory
Boland
Sent: Thursday, October 01, 2009 3:39 PM
To: Flash Coders List
Subject: Re: [Flashcoders] [MEMORY LEAK]

TS,

what is the content that you are loading from this external swf every 30,000
milliseconds?  It is feasible that what you are loading is causing the
memory of the Flash player to increase?

I never saw where you ready the swf itself for garbage collection.  I see
that you are setting the loader to null but you still have the content on
the stage.  Although it looks like you are trying to remove something from
the display list at position 0.

Are you sure that you are removing what you are intending to remove?  Maybe
a more thorough emptying of the display list is in order such as a for loop
through the list, removing whatever might be on it.

And keep in mind that the garbage collection doesn't necc happen as soon as
you make something = null.  It happens on a garbage cycle when Flash feels
like it, not when u want it to.


In Flash Player 9, the garbage collector's operations are deferred. This is
a very important thing to understand. Your objects will not be removed
immediately when all active references are deleted. Rather, they will be
removed at some indeterminate time in the future (from a developer
standpoint). The garbage collector uses a set of heuristics that look at the
RAM allocation and the size of the memory stack, among other things, to
determine when to run.
 -

http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html

greg


On Thu, Oct 1, 2009 at 5:00 PM, TS sunnrun...@gmail.com wrote:

 Yes I understand garbage collection(GC) and how it's SUPPOSE to work :)
 However, there still remains the fact that my browser is at say 146,000K
 private working set memory. Let my swf file sit there for a half hour or
 more and now the working set is up to 300,000K. Refresh the page that the
 swf is on and memory drops back to 146,000K. Now, turn off the mechanism
 that kills the content swf and re-adds it to the main swf and viola, the
 memory stays consistent at 146,000K.

 So, is this code not removing the content.swf appropriately on my Timer?
 Shouldn't GC be working appropriately and FF not adding additional memory?

 function timerHandler(event:TimerEvent):void {
trace(this.removeChildAt(0)); // remove from display list
 mLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,
 onCompleteHandler); // clear from memory

 mLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,
 onProgressHandler); // clear from memory
mLoader.unloadAndStop();// clear from memory
mLoader = null; // clear from memory
 mLoader =  new Loader(); // clear from memory
startLoad();
trace(timerHandler:  + event);
 }

 Thanks, T

 PS I've been in IT since I was a kid and yes they still do mark the
sectors
 with a special character. The only secure erase from a drive is to do full
 format and go a step further by writing back on the drive with garbage
data
 many times over until your paranoid self can feel good about it. However,
 ultimately physically destroying the drive is the best way =)



 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
 Thompson
 Sent: Thursday, October 01, 2009 2:06 PM
 To: 'Flash Coders List'
 Subject: RE: [Flashcoders] [MEMORY LEAK]

 Juan Pablo Califano wrote:

  The mere fact that the
  memory footprint grows doesn't mean there's a leak.

 Juan Pablo is correct, and it's important to understand why. (If you
 already
 understand garbage collection, you need read no further, unless you want
to
 check the accuracy of my description :-)

 As you create objects, or even variables, the Flash player allocates
 memory--this is common to most runtime engines/virtual machines, including
 Shockwave, C#, Java, Visual Basic (I think), and all the way back to UCSD
 Pascal.

 When you delete an object, or a variable goes out of scope, that memory is
 no longer needed, and the Flash player notes that it is available for
 re-use. It does not, however, immediately re-use the memory--in fact, it
 probably doesn't even zero it out right away. The data are still there,
but
 the memory is marked as available.

 These memory blocks are often not contiguous--your memory looks something
 like a fragmented hard disk. You have a few bytes here, a couple K bytes
 there. When the Flash player's memory gets too fragmented, it does a
 garbage collection. That is, it moves currently-valid objects and
 variables around to make everything contiguous (un-fragmented) again. It's
 much like defragmenting your hard drive, except it is done in RAM (or
 virtual RAM).

 The browser

Re: [Flashcoders] [MEMORY LEAK]

2009-10-01 Thread Gregory Boland
All I can say is that you aren't releasing all of the references to this
material that you are trying to release from memory.

So after you make this call

addChild(loadEvent.currentTarget.content);

make that = to null as well as any other time that you are referring to this
content you are trying to rid.

I know if you run your program in Flex Builder and choose the profiler, you
can actually purge the garbage manually and see if the object you want to be
deleted gets purged.  If it hasn't then there is still something that is
referencing it.  However, after looking at your code it seems that you are
writing it on the timeline and i'm not sure how you would go about putting
that into Flex Builder.

best of luck

greg

On Thu, Oct 1, 2009 at 3:37 PM, TS sunnrun...@gmail.com wrote:

 Been letting it run for a few hrs now and firefox is now using almost a gig
 of memory.

 Thanks, T

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gregory
 Boland
 Sent: Thursday, October 01, 2009 3:39 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] [MEMORY LEAK]

 TS,

 what is the content that you are loading from this external swf every
 30,000
 milliseconds?  It is feasible that what you are loading is causing the
 memory of the Flash player to increase?

 I never saw where you ready the swf itself for garbage collection.  I see
 that you are setting the loader to null but you still have the content on
 the stage.  Although it looks like you are trying to remove something from
 the display list at position 0.

 Are you sure that you are removing what you are intending to remove?  Maybe
 a more thorough emptying of the display list is in order such as a for loop
 through the list, removing whatever might be on it.

 And keep in mind that the garbage collection doesn't necc happen as soon as
 you make something = null.  It happens on a garbage cycle when Flash feels
 like it, not when u want it to.


 In Flash Player 9, the garbage collector's operations are deferred. This
 is
 a very important thing to understand. Your objects will not be removed
 immediately when all active references are deleted. Rather, they will be
 removed at some indeterminate time in the future (from a developer
 standpoint). The garbage collector uses a set of heuristics that look at
 the
 RAM allocation and the size of the memory stack, among other things, to
 determine when to run.
  -

 http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html

 greg


 On Thu, Oct 1, 2009 at 5:00 PM, TS sunnrun...@gmail.com wrote:

  Yes I understand garbage collection(GC) and how it's SUPPOSE to work :)
  However, there still remains the fact that my browser is at say 146,000K
  private working set memory. Let my swf file sit there for a half hour or
  more and now the working set is up to 300,000K. Refresh the page that the
  swf is on and memory drops back to 146,000K. Now, turn off the mechanism
  that kills the content swf and re-adds it to the main swf and viola, the
  memory stays consistent at 146,000K.
 
  So, is this code not removing the content.swf appropriately on my Timer?
  Shouldn't GC be working appropriately and FF not adding additional
 memory?
 
  function timerHandler(event:TimerEvent):void {
 trace(this.removeChildAt(0)); // remove from display list
  mLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,
  onCompleteHandler); // clear from memory
 
  mLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,
  onProgressHandler); // clear from memory
 mLoader.unloadAndStop();// clear from memory
 mLoader = null; // clear from memory
  mLoader =  new Loader(); // clear from memory
 startLoad();
 trace(timerHandler:  + event);
  }
 
  Thanks, T
 
  PS I've been in IT since I was a kid and yes they still do mark the
 sectors
  with a special character. The only secure erase from a drive is to do
 full
  format and go a step further by writing back on the drive with garbage
 data
  many times over until your paranoid self can feel good about it. However,
  ultimately physically destroying the drive is the best way =)
 
 
 
  -Original Message-
  From: flashcoders-boun...@chattyfig.figleaf.com
  [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
  Thompson
  Sent: Thursday, October 01, 2009 2:06 PM
  To: 'Flash Coders List'
  Subject: RE: [Flashcoders] [MEMORY LEAK]
 
  Juan Pablo Califano wrote:
 
   The mere fact that the
   memory footprint grows doesn't mean there's a leak.
 
  Juan Pablo is correct, and it's important to understand why. (If you
  already
  understand garbage collection, you need read no further, unless you want
 to
  check the accuracy of my description :-)
 
  As you create objects, or even variables, the Flash player allocates
  memory--this is common to most runtime engines/virtual machines

[Flashcoders] [MEMORY LEAK]

2009-09-30 Thread TS
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(3, 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


RE: [Flashcoders] [MEMORY LEAK]

2009-09-30 Thread Chris Foster
Hi T,

No solution here, but this might relate to your current problem:
http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html


C:
 

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of TS
Sent: Thursday, 1 October 2009 10:53 AM
To: 'Flash Coders List'
Subject: [Flashcoders] [MEMORY LEAK]

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(3, 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
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient.  Any review, 
use, distribution, or disclosure by others is strictly prohibited.  If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] [MEMORY LEAK]

2009-09-30 Thread TS
Thanks for the info. Still reading it but, fme, it seems silly there's not
an ExitRestart() method or something.

Thanks, T


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Chris Foster
Sent: Wednesday, September 30, 2009 7:08 PM
To: Flash Coders List
Subject: RE: [Flashcoders] [MEMORY LEAK]

Hi T,

No solution here, but this might relate to your current problem:
http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html


C:
 

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of TS
Sent: Thursday, 1 October 2009 10:53 AM
To: 'Flash Coders List'
Subject: [Flashcoders] [MEMORY LEAK]

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(3, 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
This e-mail, including any attached files, may contain confidential and
privileged information for the sole use of the intended recipient.  Any
review, use, distribution, or disclosure by others is strictly prohibited.
If you are not the intended recipient (or authorized to receive information
for the intended recipient), please contact the sender by reply e-mail and
delete all copies of this message.

___
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


Re: [Flashcoders] [MEMORY LEAK]

2009-09-30 Thread Karl DeSaulniers
Try removing any listeners associated with that swf before unloading  
it. It's possible the remaining listeners are still listening. Someone  
may be able to verify this more than I though.


HTH

Karl

Sent from losPhone

On Sep 30, 2009, at 7:53 PM, TS sunnrun...@gmail.com wrote:

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(3, 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


RE: [Flashcoders] memory leak

2007-09-04 Thread Frank Pepermans
Are you using Bitmaps and/or BitmapData?
In that case try doing bitmapData.dispose() or
bitmap.bitmapData.dispose() when clearing an image

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tom
Huynen
Sent: 03 September 2007 22:09
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] memory leak

Hi There,

I created a flash projector file to display media on a flat screen.
The application loads images and xml and is supposed to loop all day
long.

However, after each loop the application steals 10 mb in memory more.

I deleted all the movieclips and checked all the vars with the help of a
foreach loop and deleted them to.

Does anybody know how to deal with this data leak??

Regards,

Tom
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] memory leak

2007-09-03 Thread Tom Huynen
Hi There,

I created a flash projector file to display media on a flat screen.
The application loads images and xml and is supposed to loop all day long.

However, after each loop the application steals 10 mb in memory more.

I deleted all the movieclips and checked all the vars with the help of a
foreach loop and deleted them to.

Does anybody know how to deal with this data leak??

Regards,

Tom
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Memory Leak

2006-09-07 Thread Meinte van't Kruis

you should read gskinners' reasearch on this, it's a 3 part story, pretty
interesting.

http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html

part 3 describes a way to force the gc to actually execute, for testing
purposes.

-Meinte

On 9/6/06, Michael Trim [EMAIL PROTECTED] wrote:


Can anybody point me in the direction of any more information on this
particular bug?

http://chattyfig.figleaf.com/pipermail/flashcoders/2006-March/161995.htm
l

We have implemented a solution that minimizes/maximizes to restore GC
but I would like to have a bit more info on why this is happening?

Is this still the case in FP9?

Thanks,

Michael
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Memory Leak

2006-09-06 Thread Michael Trim
Can anybody point me in the direction of any more information on this
particular bug?

http://chattyfig.figleaf.com/pipermail/flashcoders/2006-March/161995.htm
l

We have implemented a solution that minimizes/maximizes to restore GC
but I would like to have a bit more info on why this is happening?

Is this still the case in FP9?

Thanks,

Michael
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Memory leak in Flash projector

2006-03-16 Thread Steve Mathews
http://www.iarsn.com/taskinfo.html

On 3/15/06, Darren Cook [EMAIL PROTECTED] wrote:
  There was also a utility that someone on the team found that would
  force it to release the memory. But it was Windows only, and we had to
  support Mac so we ended up taking it out.

 Do you have a link or a name for that utility (I only need to support
 windows in the current project so that may do the trick)?

 Thanks,
 Darren
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Memory leak in Flash projector

2006-03-15 Thread Mike Mountain
I know there's an issue with using bitmapdata - 

http://www.gskinner.com/blog/archives/2005/10/major_flash_pla.html

Does that help anyone?

M

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of André Goliath
 Sent: 14 March 2006 23:01
 To: 'Flashcoders mailing list'
 Subject: RE: [Flashcoders] Memory leak in Flash projector
 
 I had similar issues and solved it by minimizing/restoring 
 the App via a third party wrapper (SWF Studio in my case) in 
 an Interval. 
 It seems that by doing that the Garbage Collector is forced 
 to run, it´s the same for Win.shide/show.
 
 However I was not able to find the memory leak in my code 
 yet, it is quite complex with bunch of AS2 classes involved, 
 but I *think* I deleted evere reference after use, but maybe 
 I´m wrong with that,...
 
 hth
 
 André
 
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Memory leak in Flash projector

2006-03-15 Thread Steve Mathews
This is the same thing that I discovered on a project last year. We
even discussed the issue with Macromedia and they basically told us
that the player was not intended to run for long periods of time.

The minimize, restore does seem to work though. It seems to allow the
GC to actually release the unneeded memory back to Windows.

There was also a utility that someone on the team found that would
force it to release the memory. But it was Windows only, and we had to
support Mac so we ended up taking it out.

On 3/14/06, André Goliath [EMAIL PROTECTED] wrote:
 I had similar issues and solved it by minimizing/restoring the App via a
 third party wrapper (SWF Studio in my case) in an Interval.
 It seems that by doing that the Garbage Collector is forced to run, it´s the
 same for Win.shide/show.

 However I was not able to find the memory leak in my code yet, it is quite
 complex with bunch of AS2 classes involved, but I *think* I deleted evere
 reference after use, but maybe I´m wrong with that,...

 hth

 André


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Darren Cook
 Sent: Tuesday, March 14, 2006 2:42 AM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] Memory leak in Flash projector

 On Feb 25th 2006 Andreas Rønning wrote:
  This is very serious. The majority of my work is kiosk apps.
  Any more details on this, official Macromedia stance on it? Future fixes?

 Does anyone have more information on this? For instance what kind of
 features or media types or actionscript are causing the leak?

 We have a flash 8 application that has to be able to run for months
 without rebooting, but was leaking memory at 31Mb/hour! I realized I
 still had a textarea logger running but having removed that it is still
 leaking at 5MB/hour.

 We've tried running it as Flash 7, and also tried disabling all flv
 movies, but it still seems to leak at the same rate. Does that sound
 like something wrong we're doing in the actionscript (e.g. somehow
 holding on to references so stopping the garbage collector freeing the
 memory?) or like a player bug?

 Is there a way to force the garbage collector to run? (our application
 often has the CPU near 100% - I wondered if garbage collection only
 happens when the CPU is quiet?)

 Has anyone seen the memory leak go away when switching to zinc or a
 similar projector?

 Any advice would be very welcome,

 Darren


  Marcelo Volmaro wrote:
  Well, unless you used a lot of the new FX, i recommend you going back
  to the v7 player. The v8 has a lot of errors/memory leaks, mostly of
  them related to the new bitmap engine.
 
  I recently had to change a lot of code that takes advantage of the new
  system to the old one, because a lot of things breaks badly.
 
  On Fri, 24 Feb 2006 15:32:51 -0300, Joe Cutting [EMAIL PROTECTED]
  wrote:
 
  Hello,
 I think I've found a memory leak in the Flash player on the PC.
  I made a fairly simple animation (no actionscript) and built a
  projector and when I run
  it in a loop the amount of memory needed continues to rise. (as
  measured using Task Manager).
 
  I'm using Flash Player version 8,0,22,0 on Windows XP professional.
 
  Has anyone else experienced this, or even better found a cure?
 
  If there is no cure then this is pretty serious for anyone using
  flash in a kiosk type situation.
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Memory leak in Flash projector

2006-03-15 Thread Darren Cook
 There was also a utility that someone on the team found that would
 force it to release the memory. But it was Windows only, and we had to
 support Mac so we ended up taking it out.

Do you have a link or a name for that utility (I only need to support
windows in the current project so that may do the trick)?

Thanks,
Darren
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Memory leak in Flash projector

2006-03-14 Thread Darren Cook
On Feb 25th 2006 Andreas Rønning wrote:
 This is very serious. The majority of my work is kiosk apps.
 Any more details on this, official Macromedia stance on it? Future fixes?

Does anyone have more information on this? For instance what kind of
features or media types or actionscript are causing the leak?

We have a flash 8 application that has to be able to run for months
without rebooting, but was leaking memory at 31Mb/hour! I realized I
still had a textarea logger running but having removed that it is still
leaking at 5MB/hour.

We've tried running it as Flash 7, and also tried disabling all flv
movies, but it still seems to leak at the same rate. Does that sound
like something wrong we're doing in the actionscript (e.g. somehow
holding on to references so stopping the garbage collector freeing the
memory?) or like a player bug?

Is there a way to force the garbage collector to run? (our application
often has the CPU near 100% - I wondered if garbage collection only
happens when the CPU is quiet?)

Has anyone seen the memory leak go away when switching to zinc or a
similar projector?

Any advice would be very welcome,

Darren


 Marcelo Volmaro wrote:
 Well, unless you used a lot of the new FX, i recommend you going back
 to the v7 player. The v8 has a lot of errors/memory leaks, mostly of
 them related to the new bitmap engine.

 I recently had to change a lot of code that takes advantage of the new
 system to the old one, because a lot of things breaks badly.

 On Fri, 24 Feb 2006 15:32:51 -0300, Joe Cutting [EMAIL PROTECTED]
 wrote:

 Hello,
I think I've found a memory leak in the Flash player on the PC.
 I made a fairly simple animation (no actionscript) and built a
 projector and when I run
 it in a loop the amount of memory needed continues to rise. (as
 measured using Task Manager).

 I'm using Flash Player version 8,0,22,0 on Windows XP professional.

 Has anyone else experienced this, or even better found a cure?

 If there is no cure then this is pretty serious for anyone using
 flash in a kiosk type situation.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Memory leak in Flash projector

2006-03-14 Thread Scott Fegette
FYI, I can't speak specifically to either root cause or eventual effect/fix,
but this entire thread has been routed to the Player team for triage and
consideration (as will any subsequent suggestions/comments that follow
fhere).  Thanks for bringing it to our attention!

-Scott

scott fegette
adobe systems

On 3/13/06, Darren Cook [EMAIL PROTECTED] wrote:

 On Feb 25th 2006 Andreas Rønning wrote:
  This is very serious. The majority of my work is kiosk apps.
  Any more details on this, official Macromedia stance on it? Future
 fixes?

 Does anyone have more information on this? For instance what kind of
 features or media types or actionscript are causing the leak?

 We have a flash 8 application that has to be able to run for months
 without rebooting, but was leaking memory at 31Mb/hour! I realized I
 still had a textarea logger running but having removed that it is still
 leaking at 5MB/hour.

 We've tried running it as Flash 7, and also tried disabling all flv
 movies, but it still seems to leak at the same rate. Does that sound
 like something wrong we're doing in the actionscript (e.g. somehow
 holding on to references so stopping the garbage collector freeing the
 memory?) or like a player bug?

 Is there a way to force the garbage collector to run? (our application
 often has the CPU near 100% - I wondered if garbage collection only
 happens when the CPU is quiet?)

 Has anyone seen the memory leak go away when switching to zinc or a
 similar projector?

 Any advice would be very welcome,

 Darren


  Marcelo Volmaro wrote:
  Well, unless you used a lot of the new FX, i recommend you going back
  to the v7 player. The v8 has a lot of errors/memory leaks, mostly of
  them related to the new bitmap engine.
 
  I recently had to change a lot of code that takes advantage of the new
  system to the old one, because a lot of things breaks badly.
 
  On Fri, 24 Feb 2006 15:32:51 -0300, Joe Cutting [EMAIL PROTECTED]
  wrote:
 
  Hello,
 I think I've found a memory leak in the Flash player on the PC.
  I made a fairly simple animation (no actionscript) and built a
  projector and when I run
  it in a loop the amount of memory needed continues to rise. (as
  measured using Task Manager).
 
  I'm using Flash Player version 8,0,22,0 on Windows XP professional.
 
  Has anyone else experienced this, or even better found a cure?
 
  If there is no cure then this is pretty serious for anyone using
  flash in a kiosk type situation.
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com




--


- Scott
  Macromedia, Inc.
[EMAIL PROTECTED]
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Memory leak in Flash projector

2006-03-14 Thread André Goliath
I had similar issues and solved it by minimizing/restoring the App via a
third party wrapper (SWF Studio in my case) in an Interval. 
It seems that by doing that the Garbage Collector is forced to run, it´s the
same for Win.shide/show.

However I was not able to find the memory leak in my code yet, it is quite
complex with bunch of AS2 classes involved, but I *think* I deleted evere
reference after use, but maybe I´m wrong with that,...

hth

André


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Darren Cook
Sent: Tuesday, March 14, 2006 2:42 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Memory leak in Flash projector

On Feb 25th 2006 Andreas Rønning wrote:
 This is very serious. The majority of my work is kiosk apps.
 Any more details on this, official Macromedia stance on it? Future fixes?

Does anyone have more information on this? For instance what kind of
features or media types or actionscript are causing the leak?

We have a flash 8 application that has to be able to run for months
without rebooting, but was leaking memory at 31Mb/hour! I realized I
still had a textarea logger running but having removed that it is still
leaking at 5MB/hour.

We've tried running it as Flash 7, and also tried disabling all flv
movies, but it still seems to leak at the same rate. Does that sound
like something wrong we're doing in the actionscript (e.g. somehow
holding on to references so stopping the garbage collector freeing the
memory?) or like a player bug?

Is there a way to force the garbage collector to run? (our application
often has the CPU near 100% - I wondered if garbage collection only
happens when the CPU is quiet?)

Has anyone seen the memory leak go away when switching to zinc or a
similar projector?

Any advice would be very welcome,

Darren


 Marcelo Volmaro wrote:
 Well, unless you used a lot of the new FX, i recommend you going back
 to the v7 player. The v8 has a lot of errors/memory leaks, mostly of
 them related to the new bitmap engine.

 I recently had to change a lot of code that takes advantage of the new
 system to the old one, because a lot of things breaks badly.

 On Fri, 24 Feb 2006 15:32:51 -0300, Joe Cutting [EMAIL PROTECTED]
 wrote:

 Hello,
I think I've found a memory leak in the Flash player on the PC.
 I made a fairly simple animation (no actionscript) and built a
 projector and when I run
 it in a loop the amount of memory needed continues to rise. (as
 measured using Task Manager).

 I'm using Flash Player version 8,0,22,0 on Windows XP professional.

 Has anyone else experienced this, or even better found a cure?

 If there is no cure then this is pretty serious for anyone using
 flash in a kiosk type situation.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Memory leak in Flash projector

2006-02-24 Thread Joe Cutting

Hello,
  I think I've found a memory leak in the Flash player on the PC.
I made a fairly simple animation (no actionscript) and built a 
projector and when I run
it in a loop the amount of memory needed continues to rise. (as 
measured using Task Manager).


I'm using Flash Player version 8,0,22,0 on Windows XP professional.

Has anyone else experienced this, or even better found a cure?

If there is no cure then this is pretty serious for anyone using 
flash in a kiosk type situation.


Cheers

Joe

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Memory leak in Flash projector

2006-02-24 Thread Marcelo Volmaro
Well, unless you used a lot of the new FX, i recommend you going back to  
the v7 player. The v8 has a lot of errors/memory leaks, mostly of them  
related to the new bitmap engine.


I recently had to change a lot of code that takes advantage of the new  
system to the old one, because a lot of things breaks badly.


On Fri, 24 Feb 2006 15:32:51 -0300, Joe Cutting [EMAIL PROTECTED] wrote:


Hello,
   I think I've found a memory leak in the Flash player on the PC.
I made a fairly simple animation (no actionscript) and built a projector  
and when I run
it in a loop the amount of memory needed continues to rise. (as measured  
using Task Manager).


I'm using Flash Player version 8,0,22,0 on Windows XP professional.

Has anyone else experienced this, or even better found a cure?

If there is no cure then this is pretty serious for anyone using flash  
in a kiosk type situation.


Cheers

Joe

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
_
Marcelo Volmaro
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Memory leak in Flash projector

2006-02-24 Thread Andreas Rønning

This is very serious. The majority of my work is kiosk apps.
Any more details on this, official Macromedia stance on it? Future fixes?

- Andreas

Marcelo Volmaro wrote:
Well, unless you used a lot of the new FX, i recommend you going back 
to the v7 player. The v8 has a lot of errors/memory leaks, mostly of 
them related to the new bitmap engine.


I recently had to change a lot of code that takes advantage of the new 
system to the old one, because a lot of things breaks badly.


On Fri, 24 Feb 2006 15:32:51 -0300, Joe Cutting [EMAIL PROTECTED] 
wrote:



Hello,
   I think I've found a memory leak in the Flash player on the PC.
I made a fairly simple animation (no actionscript) and built a 
projector and when I run
it in a loop the amount of memory needed continues to rise. (as 
measured using Task Manager).


I'm using Flash Player version 8,0,22,0 on Windows XP professional.

Has anyone else experienced this, or even better found a cure?

If there is no cure then this is pretty serious for anyone using 
flash in a kiosk type situation.


Cheers

Joe

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--_
Marcelo Volmaro
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Memory leak in Flash projector

2006-02-24 Thread Marcelo Volmaro
Well, just today i filled 3 bugs reports on memory leaks and things that  
don´t get drawn correctly, all with test cases.
v8 also has problems with the new ExternalInterface under IE, if the  
object tag is inside a form.


Hope someone at Adobe fix all of this...

On Fri, 24 Feb 2006 16:19:03 -0300, Andreas Rønning  
[EMAIL PROTECTED] wrote:



This is very serious. The majority of my work is kiosk apps.
Any more details on this, official Macromedia stance on it? Future fixes?

- Andreas

Marcelo Volmaro wrote:
Well, unless you used a lot of the new FX, i recommend you going back  
to the v7 player. The v8 has a lot of errors/memory leaks, mostly of  
them related to the new bitmap engine.


I recently had to change a lot of code that takes advantage of the new  
system to the old one, because a lot of things breaks badly.


On Fri, 24 Feb 2006 15:32:51 -0300, Joe Cutting [EMAIL PROTECTED]  
wrote:



Hello,
   I think I've found a memory leak in the Flash player on the PC.
I made a fairly simple animation (no actionscript) and built a  
projector and when I run
it in a loop the amount of memory needed continues to rise. (as  
measured using Task Manager).


I'm using Flash Player version 8,0,22,0 on Windows XP professional.

Has anyone else experienced this, or even better found a cure?

If there is no cure then this is pretty serious for anyone using flash  
in a kiosk type situation.


Cheers

Joe

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--_
Marcelo Volmaro
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
_
Marcelo Volmaro
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com