-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Realm file size #709
Comments
|
This one is interesting... I was able to reproduce the issue. The strange part is that it doesn't double in size on every launch, which leads me to think there must be a race condition somewhere. Also note that no content is duplicated to cause this increase in file size, as there are no duplicate entries visible in the Realm Browser. Hopefully someone from the core team can look into why these two realm files (with the same entries) are different sizes: http://static.realm.io/debug/small_realm.zip |
My guess is that we somewhere in the binding is holding on to a read On Wed, Jul 30, 2014 at 11:36 AM, JP Simard notifications@github.com
|
Each Realm file does contain a "map" of what it thinks is free space inside On Wed, Jul 30, 2014 at 8:45 PM, astigsen notifications@github.com wrote:
|
Any possible fixes or workarounds? I'm really keen to use Realm in a production app. |
This might not be an error at all. As soon as multiple realms are in use in the app, timing differences Fragmentation may occur and cause a file size which is significantly larger Retained versions hold data for realms which are older than the most recent. Even though the application exits and the lock file is removed, different So filesize depends very much on the exact operation of the app. Especially Core limits the number of retained versions to 100 if I remember correctly. /Finn On Wed, Jul 30, 2014 at 8:45 PM, astigsen notifications@github.com wrote:
|
I didn't remember correctly. There are no limit to the number of retained On Thu, Jul 31, 2014 at 10:30 AM, Finn Schiermer Andersen fsa@realm.io
|
Is there a possibility that the binding might be holding on to old versions, On Thu, Jul 31, 2014 at 10:30 AM, Finn Schiermer Andersen fsa@realm.io
|
I'm not that deep into the objective-C binding so I might be asking a really stupid question here: Where in the source code do I find the begin and end write transactions? And a does the block executed after the GET operation happen on the main thread or in another thread? |
The begin and end transactions are in the category method. And yes the GET happens on a background thread. Does [RLMRealm defaultRealm] cache the default realm across threads? On Thu, Jul 31, 2014 at 7:36 PM, Finn Schiermer Andersen
|
I tried updating on the main thread and still see the same issue. On Thu, Jul 31, 2014 at 7:39 PM, Matthew Cheok cheok.jz@gmail.com wrote:
|
I must agree that 700Mb+ cannot be considered small. You're right, It does look like a bug. wrt caching Realm objects, it is my understanding that the objective-c binding uses thread-specific |
Is the growth in size dependent upon the presence of the .lock file..... |
@finnschiermer the same issue occurs even when deleting |
Thanks, JP On Thu, Jul 31, 2014 at 10:39 PM, JP Simard notifications@github.com
|
Seeing this issue and kinda glad I'm not the only one. It grows so big that eventually it crashes on launch, no memory. |
Seeing it too ! File is growing a lot, and finally cause my app crash on start (at the Realm creation, no memory) |
Same issue as @justjimmy and @philippeauriach. Eventually my app just crashes on realm creation and I have to delete the file. |
We are having the same issue the file just keeps growing and eventually it crashes because there is no memory. |
As noted on the mailing-list, a fix for this was pushed to master earlier this morning! An official release will be live on our site later today, but you can build from source in the meantime to confirm. |
This should now be resolved with the latest release. |
Great stuff! Thanks heaps. Just installed it and after some initial quick tests, it seems to be fixed. |
Fixed for me as well. |
It seems the realm file has a chance of doubling in file size on each app launch. What gives?
Edit: demo project at https://github.com/matthewcheok/Realm-JSON
The text was updated successfully, but these errors were encountered: