# Memory leaks in loading/unloading pictures

**URL:** <https://forum.kirupa.com/t/memory-leaks-in-loading-unloading-pictures/325986>\
**Category:** flash\
**Created:** [November 15, 2011, 4:15pm UTC](https://forum.kirupa.com/t/memory-leaks-in-loading-unloading-pictures/325986 "2011-11-15T16:15:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![drxnele](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@drxnele](https://forum.kirupa.com/u/drxnele)\
**Post date:** [November 15, 2011, 4:15pm UTC](https://forum.kirupa.com/t/memory-leaks-in-loading-unloading-pictures/325986/1 "2011-11-15T16:15:40Z")

</div>

I load image from url like this

```auto

imageholder = this.attachMovie("imageholder", "image", this.getNextHighestDepth());
imageholder.swapDepths(selectMenu);
loader.loadClip(uri, imageholder.bigImage_mc); 

```

this== root, imageholder is MC that contains empty MC named bigImage\_mc, selectMenu needs to be in front of loaded image (2nd line) and loader is MovieClipLoader()

Image is unloaded and removed like this

```auto

loader.unloadClip(imageholder.bigImage_mc);
imageholder.swapDepths(selectMenu);
removeMovieClip(imageholder); 

```

but when I unload image it doesn’t free any memory, and when i load new image it increase memory usage… I am doing here something wrong but I just can’t see what…

I even tried

```auto
System.gc();
System.gc();

```

after removeMovieClip(); as i found this on some website… but with no improvement

Big thanks,  
drxnele
