Crash on mmap
Closed this issue · 5 comments
aehlke commented
Expected behavior
No crash on sync.
Actual behavior(optional)
Crash on sync.
Thread 18: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=9 "mmap() failed: Cannot allocate memory size: 28311552 offset: 67108864" UserInfo={NSLocalizedDescription=mmap() failed: Cannot allocate memory size: 28311552 offset: 67108864, Error Code=9}
Reference links(optional)
Realm recommends using autoreleasepool when using Realm in threads. Should the BackgroundWorker.shared.start inner block be wrapped in an autoreleasepool to possibly resolve this?
aehlke commented
aehlke commented
Looks like this is a Realm issue with many people running into it: realm/realm-swift#6572
Regardless, it does seem like this ought to have autoreleasepool per Realm's docs?
Fonceur commented
I'm also getting that issue with Realm 5.1.0.
caiyue1993 commented
It should not be an issue of IceCream. Someone says that downgrading Realm to 4.4.1 helps: realm/realm-swift#6572 (comment)
You guys could give it a try.
aehlke commented
Thanks. Does the inclusion of autoreleasepool make sense there regardless?