Skip to content
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

The Realm cannot be initialized because the Realm file is too large. How to fix this Realm file? #5966

Closed
JJson opened this issue Oct 29, 2018 · 4 comments

Comments

@JJson
Copy link

JJson commented Oct 29, 2018

When Realm initializes, the following error is thrown:
{NSLocalizedDescription=mmap() failed: Cannot allocate memory size: 1744830464 offset: 0, Error Code=9}

we have fixed the problem in my code, but how to fix a file that is too large. The file contains the user's non-renewable data, and we don't want the user's data to be deleted.

@bmunkholm
Copy link
Contributor

If the file is too large for the app to open it, you have to transfer the file to a device (any computer) wich can open it. You then have to programmatically make it smaller and then send it back to the device where you delete the original file and replace it with the compressed.

@JJson
Copy link
Author

JJson commented Oct 29, 2018

If the file is too large for the app to open it, you have to transfer the file to a device (any computer) wich can open it. You then have to programmatically make it smaller and then send it back to the device where you delete the original file and replace it with the compressed.

Is there any way to fix it on the mobile app? Ask the user copy the file out and upload it to us, we fix it and send it back, which is too much trouble for the general user. We hope to fix this file by updating the app. Is there any way to do this?

@bmunkholm
Copy link
Contributor

bmunkholm commented Oct 29, 2018

Unfortunately if the file is somehow too big to open there is nothing you can do in the app except doing what I outlined programmatically. You don't need to ask your user to do anything. You could send the database to a server that would then return the compressed database. Assuming you know why it was big (you say you fixed the problem) and know how to get it smaller.

@JJson
Copy link
Author

JJson commented Oct 29, 2018

Unfortunately if the file is somehow too big to open there is nothing you can do in the app except doing what I outlined programmatically. You don't need to ask your user to do anything. You could send the database to a server that would then return the compressed database. Assuming you know why it was big (you say you fixed the problem) and know how to get it smaller.

All right.
Although this situation has occurred, most of the time it is the reason for our Realm users. However, whether it is possible to add a remedy for Realm to this situation.
Anyway, thank you for your answer.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants