1

From Max size of an iOS application I came to know that a typical iOS application binary can be up to 2GB. However, the executable file limit is 100MB. What is the maximum heap limit for a typical iOS application? It would be great if one can let me know the heap/ data segment/ code segment limits too.

Is there any restrictions from Apple?

Community
  • 1
  • 1
Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256

2 Answers2

5

As @gnasher729 said,

Your application will be killed if it uses too much RAM.

There is no absolute-hard limit on RAM usage in iOS. But Apple does provide the methods applicationDidReceiveMemoryWarning and didReceiveMemoryWarning for the UIApplicationDelegate and UIViewController, respectively. Implementing those methods will let you know when Apple is about to kill your app unless you reduce your memory usage (quickly). Here's some documentation regarding these: App Programming Guide for iOS: Performance Tips.

Daniel Storm
  • 18,301
  • 9
  • 84
  • 152
dudeman
  • 1,106
  • 8
  • 19
  • To add a minor point; as the question specifically uses the term *heap*. Your app's heap size is also constrained by your own stack usage at a given point in time. Basically, the heap starts at the bottom and grows upwards and the stack starts at the top and grows downwards. Actual implementation details vary, but in essence the stack and heap are competing for the same memory. – Avi Dec 24 '15 at 06:15
3

Your application will be killed if it uses too much RAM. It may cause other applications to be killed as well. So don't ask for any limits, get an iPhone 4s and make sure your app runs fine on it. You won't be making friends by using too much memory.

gnasher729
  • 51,477
  • 5
  • 75
  • 98