-
Notifications
You must be signed in to change notification settings - Fork 585
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
Out Of Memory crashes since upgrading to v. 10.8.0 #4016
Comments
@martinpoulsen Thank you for your report and your app for reproducing the issue. Unrelated to your issue, I would change We need to investigate (by running your app) before we can say something conclusively. Btw, we haven't changed the file format since 10.5.0, and you might want to try an earlier version. |
@kneth thanks for the quick reply and the suggested downgrade workaround. Unfortunately, I'm also seeing the issue in v. 10.5.0. Btw, thanks for the |
@martinpoulsen By using your reproduction app we have been able to identify which commit is causing the issue. We are working on a fix in #4024 |
@kneth Very glad to hear that! Thanks for moving so quickly on this 👍 |
I'm using 10.8.0 as well, but haven't seen OOM issues. What is the specific use case that will trigger this so I can review our code to make sure we are not missing this until the patch is merged? |
@martinpoulsen Thanks a lot for providing the reproduction code. @martinpoulsen @cristianoccazinsp We've released Realm-JS v10.9.1, which addresses a memory leak in the type handling code. I've profiled the fix with Martin's code, and it shows a large reduction in memory usage over time. I'll close this issue. Please feel free to re-open if this does not address your issues. |
How frequently does the bug occur?
Sometimes
Description
We are seeing a lot of "Out Of Memory" crashes in production on both iOS and Android since we upgraded realm from 10.2.0 to 10.8.0.
Stacktrace & log output
No response
Can you reproduce the bug?
Yes, always
Reproduction Steps
I have reproduced in this template app + realm 10.8.0:
https://github.com/martinpoulsen/realm-memory-issue
The app will populate "RoutePoint" entities to a "Trip" entity periodically initiated on app launch:
Schema:
Adding route points:
UNITO-UNDERSCORE!8!UNITO-UNDERSCORE!0!
If the realm version in the sample app is downgraded to 10.2.0 and the app is deleted/reinstalled, then after 10 minutes the app only takes up less than 100 MB of memory in the native layer and this amount seems relatively stable.
UNITO-UNDERSCORE!2!UNITO-UNDERSCORE!0!
I have noticed that if I don't log
JSON.stringify(trip.route)
then the problem significantly decreases and if I don't logtrip.id
then the problem almost goes away. However, in our production app we don't log or stringify the trip or route, but we must be triggering the problem some other way.We can't downgrade the realm version in our production app due to the internal realm file format version so a quick fix or ideas for a workaround would be much appreciated!
Version
10.8.0
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
iOS 14, Android 11, etc.
Build environment
Which debugger for React Native: ..
The text was updated successfully, but these errors were encountered: