New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mmap() failed: Cannot allocate memory size #6431
Comments
One of Realm's current limitations is that a Realm file cannot be larger than the amount of memory your application would be allowed to map in iOS. The exception you're seeing occurs when iOS denies Realm's attempt to map further memory, indicating that you've reached the maximum file size we support for that device. There are a few ways you can attempt to work around this limitation:
Be sure that If you can share further information about the types of data you're storing, or even a sample dataset, we can provide more specific advice. If you're not comfortable sharing this information publicly feel free to do so privately by emailing lee.maguire@mongodb.com and referencing this GitHub issue. |
我也遇到同样的问题了。不过我们的文件达到了6442450944 。以下是错误日志: |
Really? That doesn't in the document. |
Since my two last release, I have several crashes about realm size file (according crash report):
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=9 "mmap() failed: Cannot allocate memory size: 1879048192 offset: 0" UserInfo={NSLocalizedDescription=mmap() failed: Cannot allocate memory size: 1879048192 offset: 0, Error Code=9}: file
or
crash_info_entry_0 Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=2 "Unable to open a realm at path '/var/mobile/Containers/Data/Application/B30A63B7-0584-4841-860C-9B62844112ED/Documents/default.realm': Invalid top array (ref: 90691440, size: 0) Exception backtrace: 0 Realm 0x0000000106aeeea8 _ZNK5realm9SlabAlloc6verifyEv + 376 1 Realm 0x0000000106b8e778 _ZN5realm5Group18validate__top_arrayERKNS_5ArrayERKNS_9SlabAllocE + 1364 2 Realm 0x0000000106b96f94 _ZN5realm11SharedGroup7do_openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbbNS_18SharedGroupOptionsE + 3224 3 Realm 0x0000000106ab5c58 _ZN5realm5_impl11RealmFriend13read_group_toERNS_5RealmENS_9VersionIDE + 4644 4 Realm 0x0000000106ab58ec _ZN5realm5_impl11RealmFriend13read_group_toERNS_5RealmENS_9VersionIDE + 3768 5 Realm 0x0000
At the first init of my realm instance.
I think it’s not possible the file size should be as big. We don’t save enough data to have this file size.
I don’t reproduce the issue, I just see it in the crash reporting.
I have to get the current user from the database in the application delegate. In the didFinishLaunchingWithOptions method.
Goals
Fetch data from DB
Expected Results
Get data from DB
Actual Results
Crash
Steps to Reproduce
I don’t reproduce the issue, I just see it on my crash report. I print my personal realm file size and I’ve 65536bytes.
Code Sample
In Appdelegate / didFinishLaunchingWithOptions
The application crash at the initialization of the realm instance.
Version of Realm and Tooling
Xcode: 11.3.1
Realm Object Server version: N/A
RealmSwift: 4.3.1
Thanks for advances.
The text was updated successfully, but these errors were encountered: