IOS RAM Limit for Realm

From the Realm: https://realm.io/docs/objc/latest/#current-limitations

"Any single Realm file cannot be larger than the amount of memory that your app will be allowed to map to on iOS - this varies per device and depends on how fragmented the memory space is at that point in time (there is an open radar about this issue: rdar: / /17119975). If you need to store more data, you can map it across multiple Realm files. "

Does this mean that one Realm file is always stored in RAM? Or does it mean that the address space must be large enough? This statement is very confusing ...

+3


source to share


2 answers


Since Realm uses mmap

under the hood, it currently relies on the program's address space to have a contiguous block of unclaimed addresses, larger than the Realm file size. This differs from the actual amount of free memory, since memory can be free

d from many different parts of the address space, leaving a lot of unused memory, but not large blocks of address space sufficient for mmap

the Realm file.



+4


source


This is talking about memory mapping, that is, virtual memory using the file as a backup storage. In theory, the operating system could access an unlimited amount of data in this way, completely regardless of the amount of RAM you have. These files are definitely NOT stored in RAM. They take up address space, so you'll be limited in a 32-bit application, but they don't take up RAM.



In practice, I tried mapping a 1GB file and it worked without issue.

+1


source







All Articles