Read mmap limitations

Number:rdar://17119975 Date Originated:03-Jun-2014 09:46 AM
Status:Closed Resolved:
Product:iOS Product Version:7.1
Classification:Other Bug Reproducible:Always
According to the Apple documentation ( there should be no limit to the size of read-only files, as pages should be paged out accordingly.

Steps to Reproduce:
1. Open the Xcode project in this GitHub repo:
2. Tweak the parameters in AppDelegate.m - line 19
3. Run example on different iOS devices

Expected Results:
No limit to the size of the read-only mmap'ed files

Actual Results:
Depending on the number of files and device the maximum size for a real-only mmap'ed file is between 300mb to 1900mb.

iOS 7.1


iPad Air, iPhone 5s, iPhone 4s


User Response – 20-Nov-2014 03:57 PM

Yes, this is still an issue. There are cases where it's necessary to mmap large files, such as with an mmapped database like Realm [].

According to Apple's "Memory Usage Performance Guidelines" [], iOS should "provide up to 4 gigabytes of addressable space per 32-bit process".

Response from Apple – 20-Nov-2014 07:52 AM

This issue behaves as intended based on the following:

The kernel enforces a fairly restrictive limit on the size of a process's virtual address space and that's probably what you're bumping into.

Please update your bug report to let us know if this is still an issue for you.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!