-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
RLMException mmap() failed #4868
Comments
NM- I've RTFM'd a little more and decided to compress by making a copy at startup. |
Take a look at our radar from several years ago about this: rdar://17119975. The best way to resolve this is to remind Apple of this issue. We believe there's no technical basis for the limitation. Also, please see #4755 which will expose a block to safely compact the Realm on first access, something which is difficult to do safely using Realm's existing public interface at the moment. |
There are a few issues with that approach that you should be aware of, that #4755 aims to improve on:
|
Our Realms don't go over 6-10MB (which is why I think I haven't seen this until recently-) so I think I'm safe on the 200MB re-write of just data. I will re-double the watch for a race, but I'm doing this at a place where no one is trying to use the Realm yet. Hopefully. |
I did find the others on this issue, however I am still seeing it.
Xcode 8.3.1 / iOS 10.3.1
Realm Objective-C 2.5.1 / Pods
I am getting random crashes with:
Fatal Exception: RLMException
mmap() failed: Cannot allocate memory size: [some number] offset: 0
Curious is the large numbers I'm seeing. For example, I had one this morning with:
Cannot allocate memory size: 1610612736 offset: 0
When I get these, I have a piece of code that will send in a copy of the Realm with:
RLMRealm *realm = [RLMRealm defaultRealm];
NSURL *urlCopy = [NSURL fileURLWithPath:[self tempCopyPath]];
write to a file, zip and email etc. etc.
When I open the file from the device, it's 1.4MB.
I may be confused on the flow, but it looks like Realm trying for a gig+ for a 1.4MB file?
Happens in 2.4.4-2.5.1 (at least)
I'm *speculating if the on device file is growing due to lots of writes and deletes that aren't recovered, and the file I pull down (since it's a copy) has the deleted space compacted by the write.
Is there something I need to do on the device to compact and recover deleted space? Or is that a red herring-
Thanks in advance for your time.
The text was updated successfully, but these errors were encountered: