macrumors 65816

I just wanna know, what will b the default heap size for an app in device??

Click to expand...

You shouldn't have to worry about that. Your application should behave completely correctly whether or not it runs out of memory. In other words, it should be able to handle didReceiveMemoryWarning: and release unnecessary objects that are allocated to bring down memory usage.

Big, centralized data sets being held in memory to me indicates lack of design forethought, though I'm not really sure what you're developing. Maybe you should look at caching the data in a file and loading what you need as you need it.

thread startermacrumors 6502

You shouldn't have to worry about that. Your application should behave completely correctly whether or not it runs out of memory. In other words, it should be able to handle didReceiveMemoryWarning: and release unnecessary objects that are allocated to bring down memory usage.

Big, centralized data sets being held in memory to me indicates lack of design forethought, though I'm not really sure what you're developing. Maybe you should look at caching the data in a file and loading what you need as you need it.

Click to expand...

Okie...

But i am getting a black screen after i use my app for somtimes....
I read that we want to dealloc alll the instances and terminate the app when we get a memory warning... So hows the recovery is possible??

macrumors 68040

But i am getting a black screen after i use my app for somtimes....
I read that we want to dealloc alll the instances and terminate the app when we get a memory warning... So hows the recovery is possible??

How we can terminate app programatically???

Click to expand...

You do not need to be responsible for terminating the app when you get a memory warning. You should just release as much memory as possible and if that still doesn't satisfy the OS, it will terminate the app.

macrumors 65816

But i am getting a black screen after i use my app for somtimes....
I read that we want to dealloc alll the instances and terminate the app when we get a memory warning... So hows the recovery is possible??

How we can terminate app programatically???

Click to expand...

You're probably getting a "black screen" because views that do not currently have a parent at the time of the memory warning are released by the default behavior of UIViewController's didReceiveMemoryWarning method.

In these cases (when views are released), loadView is called on the view controllers that have been released when those views need to be displayed. If you didn't implement loadView: in your view controllers, then you need to.

App termination and other such things are handled by the OS, and are only done in cases where your application doesn't release enough memory when requested and keeps taking up more memory. If you're getting memory warnings a lot, chances are you need to look at the design of your application and tone down the memory usage a bit.

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.