Jump to content
Search Community

Weird Memory Leak using ImageLoader

Williemaster test
Moderator Tag

Recommended Posts

First of all let me thank you for your awesome loading features, what i mostly liked about them is that you can define loaders in an XML file, great job.

 

Now to the important part. I just found out about Adobe Scout and decided to give it a try to tune my App and I found something quite weird that nearly doubled my memory use. The problem is that when i tried to decompress a loaded bitmapData with the getPixel(0,0) technique, two things used memory, Bitmap DisplayObjects and BitmapData, both used 20.480 KB. Why Bitmap DisplayObjects used memory? I thought that only BitmapData should have used memory, the Bitmap DisplayObjects was later garbage collected, but why is it being created in the first place.... So i tried using getPixel(0,0) on a clone of the bitmapData i loaded and Bitmap DisplayObjects never appeared. Is the Bitmap DisplayObjects memory being used by the ContentDisplay object that comes with the loader? If so, what can i do to prevent this from happening?

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums. 

 

Not 100% sure but it seems like this might describe the numbers you are seeing.

 

  • Bitmap DisplayObjects – memory used by Flash Player to store the decompressed version of any images you load–whether it's through a Loader instance or as an embedded resource in a SWF file. It also includes the memory used by mipmaps.
  • BitmapData – memory used to store BitmapData objects, including objects that are subclasses of BitmapData. Note that this data is stored in unmanaged memory, and the managed ActionScript BitmapData object is just a handle to this memory.

http://www.adobe.com/devnet/scout/articles/scout-memory-profiling.html

 

We haven't heard of any memory leaks in ImageLoader, it would help to see a demo that shows memory building up over time and impacting performance.

Also, you might want to do similar operations on assets you load using native AS3 classes (no ImageLoader) and see if the behavior is wildly different.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...