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

longlong String cause hard disk boom #6056

Closed
ameue opened this issue Jan 8, 2019 · 4 comments
Closed

longlong String cause hard disk boom #6056

ameue opened this issue Jan 8, 2019 · 4 comments

Comments

@ameue
Copy link

ameue commented Jan 8, 2019

A field holds 84000 + length JSON strings, and hard disk usage has soared by 27M。
The same data is stored in SQLite and realm, realm takes up much more space than SQLite

@bmunkholm
Copy link
Contributor

In general, Realms are not larger than SQLite.

  1. What's the total size of the strings you are storing?
  2. How much space is it taking up in SQLite?
  3. How do you add the data?
  4. Are you aware that Realms will expand in larger increments to also cover potential future additions (to make it faster instead of expanding a file in small increments). If you don't need that you can compress the file at startup or by opening it in Studio and saving it again. Please try that and report the file size.

@ameue
Copy link
Author

ameue commented Jan 9, 2019

I convert the data into a JSON string and save the JSON string in a field.
After that, I saved the JSON string to sandbox first, and then saved the file path in realm. But in this way, the space occupied was reduced to several hundred KB, but it was still larger than sqlite.

@bmunkholm
Copy link
Contributor

bmunkholm commented Jan 9, 2019

@ameue Please answer my original questions 1-4 so I can better understand the issue and help you.

In your second experiment:
5. You now no longer save the strings in Realm, but only store a path to a file? And that is taking up several hundred KB? What exactly is stored in it? Please share a screendump from Realm Studio or the file itself.
Note that a realm will have a minimum size and grow in larger chunks. If you delete data from the realm it does not shrink the file unless you compact it.
6. Is it a problem for you that it is several hundred KB?
7. In comparison what is the size in sqlite? You only write that it is larger - please be specific.

Please provide a small sample project that demonstrates how you generate the string for the initial case so we can reproduce it and see the difference between the data you store in realm and the size of the file it generates.

@stennie
Copy link
Contributor

stennie commented Sep 29, 2019

Closing this issue due to no recent activity. Please comment if you have additional information that may help reproduce this issue.

@stennie stennie closed this as completed Sep 29, 2019
@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

3 participants