# Possible Memory Leak?

**URL:** https://forum.kirupa.com/t/possible-memory-leak/240733
**Category:** flash
**Created:** [October 5, 2007, 3:11pm UTC](https://forum.kirupa.com/t/possible-memory-leak/240733 "2007-10-05T15:11:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![absolutezero342](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@absolutezero342](https://forum.kirupa.com/u/absolutezero342)
#### Post date: [October 5, 2007, 3:11pm UTC](https://forum.kirupa.com/t/possible-memory-leak/240733/1 "2007-10-05T15:11:07Z")

</div>

OK, here’s the situation…I have one SWF acting as a loader to load in the rest of my SWF’s and in the loader SWF I have a ScrollPane instance on stage and when nav buttons are clicked, I load new SWF’s into the ScrollPane instance. The “home.swf” loads by default at startup. When I click on another SWF, there is a call to:

```auto
 
var req:URLRequest = new URLRequest("another.swf");
ScrollPaneInstance.load(req);

```

which loads the new SWF and SHOULD unload the previous SWF. Notice I say “SHOULD”!  
I run a trace on System.totalMemory at regular intervals and the number never decreases; in fact, it increases drastically! For example, when I click a button and load in a new SWF, it will jump 10MB, but then when I click back to “home.swf”, it will jump even higher yet!

Here’s an example trace output doing what I just described(loading “home.swf”, loading “another.swf” and then clicking back to “home.swf”):

21.640625MB  
21.7578125MB  
21.765625MB  
21.78515625MB  
21.7890625MB  
26.2421875MB  
26.50390625MB  
32.67578125MB  
34.03125MB  
34.03515625MB

Your help is appreciated!
