-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
Description
After upgrading to 10.20.0-beta.3 I've been receiving some crashes related to memory warnings and eventual app termination.
I've been trying to debug the issue, and there's really no obvious culprit. However, there seems to be a very slow memory leak when listening to collections and/or querying/updating data for long periods of time.
I'm also not able to get the exact location of the memory leak, as XCode is not giving me that information, which also hints at some low level C allocation.
The following capture shows the app doing nothing besides the reproduction steps highlighted below. Basically, have a collection listener, and perform actions that fire events on the listener.
In fact, simply adding a collection listener immediately fires a memory leak, which then continues to creep up as the listener fires.
iPhone 7 - iOS 15.4
iPhone 12 - iOS 15.4
The Malloc 160 bytes is the leak that keeps growing as the listeners get added/fire.
On a screen that constantly performs update operations (against the same collection that has a listener), the Malloc 32 bytes also starts to creep up quickly.
Note: Although I'm using the Hermes branch, I'm not using Hermes on iOS, but rather the JSC implementation (:hermes_enabled => false)
Also note that this may be a false positive, and the memory leak could come from RN itself, but I thought it would be a good idea to review this either way.
Stacktrace & log output
No stack traces, please see screenshots.
Can you reproduce a bug?
Yes, sometimes
Reproduction Steps
- Start the application and add collection listeners that are persistent throughout the app's life cycle.
- Perform actions that add/remove items from the collections that have listeners
- The listener callbacks should also perform queries against the listened collections.
- Monitor the app using XCode memory profiler, and observe leaks ramping up.
Version
10.20.0-beta.3
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
iOS 15.x
- is related to
-
RJS-1700 Meta-ticket: Memory Corruption
- Closed