# Memory leaking with loading in swf

**URL:** <https://forum.kirupa.com/t/memory-leaking-with-loading-in-swf/301378>\
**Category:** Uncategorized\
**Created:** [December 8, 2009, 4:16pm UTC](https://forum.kirupa.com/t/memory-leaking-with-loading-in-swf/301378 "2009-12-08T16:16:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitroplonker](https://avatars.discourse-cdn.com/v4/letter/n/3da27b/32.png) [@nitroplonker](https://forum.kirupa.com/u/nitroplonker)\
**Post date:** [December 8, 2009, 4:16pm UTC](https://forum.kirupa.com/t/memory-leaking-with-loading-in-swf/301378/1 "2009-12-08T16:16:51Z")

</div>

I have a problem in that i have a holder swf which loads in other swf’s externally. My problem is that the holder loads all the movies in correctly but the memory usage of the swf just keeps going up and up even though i am trying to remove the movieclip after each has finished it’s run.

```php

function movie_end() {
    //remove movie
    newmov.removeMovieClip(swfs[n]);
    n++;
    if (urls[n]==undefined) { n = 0; }
    _root.targetUrl = urls[n];
    newmov = _root.createEmptyMovieClip('holder', 1);
    newmov.loadMovie(swfs[n]);
    
    // attempt to save cookie
    so.data.promo = n;
    so.data.promoDate = now();
    so.flush();
}

```

any ideas as it’s driving me nuts.
