-
Notifications
You must be signed in to change notification settings - Fork 61
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
Regression(?) infinitely growing active versions in 1.10.2 when using Singleton to retrieve realm instance #1478
Comments
Thank you for reporting this. We have made changes to our version tracking in between those versions, but that should not cause this issue, so I'm not aware of any regressions. But we will investigate. |
I checked different versions starting from 1.6.0 and it seems that this issue was introduced in 1.8.0. |
@cmelchior I can confirm what @ggajews found. From my tests, huge realm file size is possible as long as an app process isn't killed and realm isn't compacted. Isn't this quite worrisome since these library versions are widely spread at this point? Or are you considering this a minor bug and can we release with something like this? I understand that support for free Realm products is limited so that's why I'm asking. The setup described in my original post is one that is suggested by Realm (for example on the Kotlin Slack) and isn't uncommon I feel. |
Sorry for not responding to this issue sooner. The purpose of #1320 was actually to make the filesize growth less likely to happen, not more. And at least our internal testing showed that to be the case, but it sounds like we have missed something when running these tests. So I would consider this a bug we do want to fix. Unfortunately, we had some other issues taking priority on being able to dive into this one, but I hope to get back to it next week. |
@EdwardvanRaak The issue with the growing number of active versions is that the Yes, since #1320 the numbers reported with We are working on reporting the actual number of active versions in #1478 (comment) - Here you say that you have seen that the database size grows until it is compacted. What kind of data, and operations do you do? Could you share a sample project that shows this huge growth? |
@clementetb Yes here is a sample project https://gist.github.com/EdwardvanRaak/9097f7b642e8b13f5f901692f93c79eb for Android (Jetpack Compose) with a simple UI so you can see the file size slowly increasing over time. |
The number reported from |
Now we are hitting 20 active versions max, so the fix worked 👍, thanks. |
@EdwardvanRaak The latest release 1.12.0 fixes some memory leaks and version pinning. Would you mind testing it and seeing if it addresses your issues? |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
How frequently does the bug occur?
Always
Description
During some debugging I discovered that our app is suffering from infinitely growing active versions after realm write transactions.
This is a topic with similarities to earlier issues such as #1007 and #1081
Minimum reproducible example:
With the setup below on Android, rotate the screen about 20 times (or make a button, whatever) and observe logs.
Log output:
During rotating, I triggered several forced GCs through the Android Studio Memory profiler. However this has no effect on the number of active version.
Reverting the realm version back to 1.6.0 (because of this comment ) and running the exact same example, garbage collection does result in the number of versions decreasing.
Log output on v1.6.0
Interestingly, omitting the usage of the Singleton on version
1.10.2
such as this:Also results in GCs correctly decreasing the number of active version.
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
No response
Version
1.10.2
What Atlas App Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
Android 13
Build environment
Android Studio version: Android Studio Flamingo | 2022.2.1 Patch 2
The text was updated successfully, but these errors were encountered: