“Be inspired, enjoy your work, keep learning and never forget to play.” — gskinner

Memory Leak in AS3 Loader Class

Posted: October 22nd, 2007 | Author: Tiago Bilou | Filed under: Actionscript3 | 28 Comments »

Today I came across a nasty memory leak in the Loader Class.

I was writting a simple screensaver class that loads external images from the hdd and displays them. Sounds simple? It is. The problem was that everytime I loaded an image, the system memory would go up. I started by checking my eventListeners. They where all weak referenced. I went through the code looking for places where I could be keeping a reference and hence preventing the GC to collect it, but I couldn't find any.

There is something keeping the GC from removing the old images from memory...

Everytime the Loader calls the load() method the image is read into memory and stays there. I tried calling the unload() method but that doesn't help.

Then, how can one remove the loaded image from memory? If you know please let me know...

The only workaround I came up with was gskinners unsupported method to force the GC

This works great, but I would like to know what's keeping the GC from removing the previous images from memory...
Let me know if you have an answer.

Example showing the memory leak


Air: Flv Snapshots

Posted: October 22nd, 2007 | Author: Idoru | Filed under: Actionscript3, Adobe AIR, Adobe Flex, Experiments, Tutorial, Video | 3 Comments »

I just had a go at air today,

A co-worker of mine needed an application that would make it easy for him to take snapshots of .flv files for a content management system, so i came up with the idea of having a go and doing it with air.

So as a follow up i'll make a little tutorial explaining how it works. As Usual you can have a look in the code for the intructions. And should you have any questions feel free to ask them.

Air application file -Thumb

Update: Now published with the final AIR version.