It is unfortunate that there is no good way to see what OS level resources are being used and how. Generally, bitmaps can use resources outside that measured by system.totalMemory. If 20 large PNGs eat 800Mb, that's 40MB per image which I don't think is impossible for large PNGs
Alex Harui Flex SDK Developer Adobe Systems Inc.<http://www.adobe.com/> Blog: http://blogs.adobe.com/aharui From: [email protected] [mailto:[email protected]] On Behalf Of Scott Delap Sent: Friday, February 20, 2009 7:51 AM To: [email protected] Subject: [flexcoders] Optimizing Allocated Memory versus Used Memory in Flex/Air Applications I've searched Google on this topic for a few hours with no success so I wanted to throw this out for the list to comment on. I'm working on an Air application that loads 20+ large png files. For some extreme cases we are seeing our application spike up to 800-1200m of operating system memory usage causing it to crash. I think we've resolved the issue by trial an error. However, in trying to track down the culprit I was disappointed by the information I had available from the Flex tooling. Using System.totalMemory and the Flex Builder memory optimizer, I often see a maximum memory usage of around 50m. However, the operating system (OS X or Windows will often show the same adl process using 400m or greater). From reading various articles on memory management and GC of Flash I'm assuming the difference is allocated memory versus actual in use memory. I'm further theorizing that image loading is using external OS resources or something to that effect. Is there any way to get more information from the Flash runtime about the OS level memory usage and what objects/classes are causing issues. It is kind of hard to track down a memory leak when you don't have visibility into the causes.

