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

Expose realm-core compact() #967

Closed
sushihangover opened this issue Dec 4, 2016 · 2 comments · Fixed by #968
Closed

Expose realm-core compact() #967

sushihangover opened this issue Dec 4, 2016 · 2 comments · Fixed by #968
Assignees

Comments

@sushihangover
Copy link

Feature Request: Just fill in the first two sections below.

What do you want to achieve?

The ability to compact a Realm database via realm-core compact like the Java version of .compactRealmFile, or RLMRealm.compact, etc...

Actual Results

Currently we are experiencing huge Realm files due to writing and refreshing on different threads.

We have issues of device/app faults due to DB size on iOS/Android, had a iOS (iPhone 7 256GB) beta app user with a 120GB realm file that compressed to under 12MB.

Basic app/realm setup:

─Main instance (UI Thread)
├── "Write" instance on a different thread 
│     i.e. a service performing updates to RealmObjects also creating new objects
├── "Read" instance on a different thread 
│    i.e. a read-only instance that is monitoring changes and performing Refresh() to get the latest changes from the "Write" instance to dispatch events to app.

Example: A Realm file on iOS after one app session is 1,25,829,120 bytes

Note: This is about avg. after an app session as we are now eventing DB size with app analytics to track it but have seen a few 100+GB files that had less then 20MB of data.

After implementing a dump DB to JSON-based files, delete & recreate realm routine in the app, file size is 327,680 bytes. Same results if you copy the bloated db to OS-X and use Realm Browser to load and then "Export to Compacted Realm".

Version of Realm and tooling

Realm version(s): v.0.80.0
Xamarin/Visual Studio version: VS2015 / XS 6 / VS4M 7
Which operating system version and device: Android and iOS

@nirinchev
Copy link
Member

Thanks for the feedback, it's definitely something we've had in our backlog and I'll bump its priority.

@sushihangover
Copy link
Author

@nirinchev Thank you 😄 (and thanks for the fast reply!)

@nirinchev nirinchev self-assigned this Dec 4, 2016
@nirinchev nirinchev removed the S:Review label Dec 9, 2016
@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

Successfully merging a pull request may close this issue.

2 participants