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


[Flashcoders] Flash http request does not call back inside IE ActiveX occasionally.

2009-10-01 Thread Pavel Repkin
My Windows (C++) program hosts Flash ActiveX. I use XML.sendAndLoad() to
communicate to the server inside Flash part of the application. Occasionally
XML.sendAndLoad() does not call back. That makes the whole application
useless. Only restart helps.

I have found using HTTP Analyser, that the requests even do not go to the
internet. There is something that prevents the request way from Flash to
ActiveX to Internet Explorer to Internet.

I use AS 2.0

Please help! This problem is driving me mad.

It seems to be a very advanced question, I wonder if anyone has a clue :(
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Ads inside Flash application

2009-10-01 Thread Pavel Repkin
I want to publish ads inside Flash application.
Do you know any ad-network that allows publishing ads inside Flash apps?
There is a Mochi ads network, they do publish the ads inside Flash, but they
accept only games.
And my app is not a game.
___
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

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 is 

[Flashcoders] ASDoc Help

2009-10-01 Thread pedro
Does anybody have any references or tutorials on how to modify ASDoc  
output? I'm not talking about adding ASDoc comments, I know how to  
write those, but information on how to modify the docs that it creates.


I managed to figure out how to add appendixes with the link below. But  
how do I tell ASDocs to actually include those files (html, js, css,  
images) with the documentation when it generates? Also, can I make my  
own tags (@bug, @todo)? I know there is a secret @warning tag that is  
disabled, but are there others?


The only links I've found are these:
http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_9.html
http://personal.boristhebrave.com/project/asdoc-enhancements

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


[Flashcoders] AS3 fl.controls.List instance change events not bubbling

2009-10-01 Thread Stephen Downs
Change events sent by instances of fl.controls.List in my Flash AS3  
project have lost their effervescence. The AS3 Language and Components  
Reference states that change events sent by List bubble by default,  
but when I check the event being sent it has the bubbles property set  
to false.


This is highly annoying as I have a master component parent containing  
many Lists and I just need to listen to the component parent with a  
single listener for the event.


Does anyone know how to force bubbling into a List instance change  
event (besides re-wrapping the event in another dispatcher)?

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


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,