Affects Version/s: Adobe Flex SDK Previous
Fix Version/s: None
Component/s: Spark: Image
Environment:Affected OS(s): All OS Platforms
Language Found: English
Steps to reproduce:
1. Create an application that uses s:Image.
2. Set the source of the image to a URL. (I used a file URL.)
3. Run the application in the profiler and note how many instances of BitmapData exist.
4. Change the image to a new URL and check your instance count again (even after forcing garbage collection).
There are always two instances of BitmapData. Never more than two, but there are two when there should only be one. This is a problem because twice as much memory is being used as is necessary. On the desktop, this isn't noticeable, but on mobile, it can mean the difference between an application crashing and running correctly.
Expected Results: There should always be only one instance of BitmapData.
Workaround (if any): Rather than setting the source property to a URL, if you get the bytes of the image, create your own BitmapData, and assign that to the s:Image component, there will only be one instance of BitmapData (which is the correct behavior).