Skip to main content
Inspiring
December 9, 2011
Question

iPad memory management

  • December 9, 2011
  • 1 reply
  • 908 views

Hi

I've been working on getting a version of an AIR  for desktop app onto an iPad. I'm testing on an iPad 1 right now.

The app first creates about 20MB worth of display objects, and then loads in about 15MB worth of image data that gets cut up and displayed as Bitmaps in the objects created in step 1.

In the cut-up phase, 15MB of BitmapData objects are created to copy images from the loaded in image data into the display objects. This is where the screen goes black and the app crashes. I know it's a memory issue because it works fine on the desktop.

I'm not sure how to tell how much RAM is available to my app... but is using 50MB enough to take down the iPad?

I already have a few ideas on how to streamline my image loading and processing, but are there any best practices on how to deal with image (Bitmap) memory, or AIR for iPad memory management in general ?

Thanks

This topic has been closed for replies.

1 reply

Known Participant
December 9, 2011

Hi

Maybe this help you.

I have a app with many images. Load, unload, zoom, motions, etc

I clean the memory used this command:

library: flash.system.System

System.gc();

Use this to analise the memory

var mem1:String = Number( System.freeMemory / 1024 / 1024 ).toFixed( 2 ) +

"Mb";;

var mem2:String = Number( System.totalMemory / 1024 / 1024 ).toFixed( 2 ) +

"Mb";

trace("free memory = "mem1 " / Total memory = "mem2)

And in preferences/publish cache is a possible allocate more memory.

sorry for my poor english.

GL

Bruno Brustoloni e Oliveira