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

mmap in chunks when running Group::compact() when necessary #2581

Closed
jpsim opened this issue Apr 21, 2017 · 5 comments
Closed

mmap in chunks when running Group::compact() when necessary #2581

jpsim opened this issue Apr 21, 2017 · 5 comments

Comments

@jpsim
Copy link
Contributor

jpsim commented Apr 21, 2017

We've seen cases in practice where Realm files have grown so large that they cannot be mmapped in their entirety all at once, which leaves users with very few options to recover that data.

Now that we officially expose compact() in Cocoa's public API (realm/realm-swift#4755), that provides for an escape hatch for some Realms to be shrunk to a size that can be mmapped.

So if mmapping the file in its entirety fails, core could incrementally just map the section it cares about at a given time, read the required data from it, unmap it, then move on to the next section.

@finnschiermer
Copy link
Contributor

finnschiermer commented Apr 27, 2017

@jpsim I think this is a duplicate of #1935 ? If you agree, I'll close it.

@jpsim
Copy link
Contributor Author

jpsim commented Apr 27, 2017

Perhaps? From what I can tell #1935 is more about mmapping the whole file still, just not necessarily contiguously.

@finnschiermer
Copy link
Contributor

No, #1935 is about the very special requirement we currently have to mmap the entire file contiguously as the file opened. It's an obvious shortcoming which we have not been able to prioritize.

@jpsim
Copy link
Contributor Author

jpsim commented Apr 27, 2017

Would it be easier to solve in the specific case of compact when we know there are no other readers or writers? Might be easier than solving the general case?

If so, let's keep this open. Otherwise we can close as a duplicate.

@finnschiermer
Copy link
Contributor

Nope, no low hanging fruit for this one. We have to do #1935. Closing this.

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

No branches or pull requests

2 participants