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: Cannot allocate memory size: #8523
Comments
➤ PM Bot commented: Jira ticket: RCOCOA-2315 |
I've ran into similar issues with a large Realm database (> 5GB). Despite lots of free memory, allocation failed in various ways. The solution was to add the entitlement Extended Virtual Addressing to the app. |
Adding the entitlement is one way to mitigate the issue. Another is to understand what's causing Realm files to be open for extended periods on background threads. You can have a Realm instance open on the main thread for the lifetime of your app, but Realms open on background threads should be closed as soon as possible or |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
How frequently does the bug occur?
Always
Description
In the scenario I use, I have several queues, the main thread, the work serial queue, and some child threads. The main thread mainly listens for data changes through the realm observe and feedback on the UI, and the work serial queue is used to perform data write operations. The child thread is mainly used to read realm data while working on business scenarios. It rarely changes, and if there is a change, I will put it in the work queue. But there are errors related to # mmap() failed: Cannot allocate memory size: and bad::alloc, and I want to know how I can modify my code to reduce the occurrence of these errors.
I have a few questions:
But there are some databases that read frequently, and I will try to hold these relam handles in different threads.This was also done when we used version 10.13, but this error did not occur.
3、Is there any way to monitor how much mmap space relam is using?So I can try to do some analysis from memory.
From what we can see, it seems to be an issue after realm was upgraded from 10.13 to 10.43, but we don't know what possible cause affected this at this time. It would be better if you could help me provide some analytical ideas, thank you!
Stacktrace & log output
I can't reproduce it, it exists in our production environment version
Can you reproduce the bug?
No
Reproduction Steps
No response
Version
10.43
What Atlas Services are you using?
Local Database only
Are you using encryption?
Yes
Platform OS and version(s)
ios17.1.2
Build environment
Xcode version: 15.2
The text was updated successfully, but these errors were encountered: