Skip to main content
Inspiring
October 28, 2007
Question

Memory Leaks in AS2

  • October 28, 2007
  • 4 replies
  • 672 views
Hey folks,

I am working on some *AS2* code.

Problem: Basically, I'm loading my SWF file in Firefox; and the memory
used is going upwards nonstop. After a couple of minutes, all system
resources are used and I need to restart the browser. I suspect
(obviously) a memory leak or the garbage collection not doing its proper
job.

Question: Is there some tools I can use to diagnose this problem and
retrace where the leak is coming from. Ultimately is there some garbage
collection optimization I should be aware of?

Thanks
This topic has been closed for replies.

4 replies

Inspiring
October 29, 2007
On Sun, 28 Oct 2007 04:04:44 +0000, Michel B wrote:

> Hey folks,
>
> I am working on some *AS2* code.
>
> Problem: Basically, I'm loading my SWF file in Firefox; and the memory
> used is going upwards nonstop. After a couple of minutes, all system
> resources are used and I need to restart the browser. I suspect
> (obviously) a memory leak or the garbage collection not doing its proper
> job.
>
> Question: Is there some tools I can use to diagnose this problem and
> retrace where the leak is coming from. Ultimately is there some garbage
> collection optimization I should be aware of?
>
> Thanks

I have an update. It turns out the memory is leaking ONLY one of my
machines (which is running Ubuntu Gutsy Gibbon 7.10). I am running the
latest version of Flash 9.0.48. I tried the SWF on Windows and other
flavors of Linux, and it works fine there.

Anyone encountered the same problem?
kglad
Community Expert
Community Expert
October 29, 2007
you have some kind of endless loop. are you repeatedly trying to load something (like a load statement that repeatedly executes)? are you using a loop of some kind (like a preloader)?
Inspiring
October 28, 2007
On Sun, 28 Oct 2007 11:11:31 -0500, DMennenoh **AdobeCommunityExpert**
wrote:

> How are you loading your clip? This pretty much has to be a problem with
> how you're doing it, otherwise this problem would appear all the time-
> and it doesn't.

Hmm, I haven't looked at that approach; maybe something messing up here.

I'm loading the SWF through JavaScript using the "SWFObject v1.4.4: Flash
Player detection and embed"; looks similar to the following:

<div id='object-content'></div>

<script type='text/javascript'>
theObject = new SWFObject("object.swf", "uid", "100%", "100%", "7",
"#FFFFFF", false, "high", null, "noflash.html");

theObject.addParam("param_1", "default");
theObject.addVariable('var_1', "some value");

theObject.write("object-content");
</script>
Inspiring
October 28, 2007
How are you loading your clip? This pretty much has to be a problem with how
you're doing it, otherwise this problem would appear all the time- and it
doesn't.

--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/