-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
2 - S (<= 1 week)
-
2378
Goals
Use Results/List Object listeners during development of a React Native app. This requires restarting the simulator or force-closing the app on device after a certain number of reloads.
Expected Results
Reloading the app during development (DEV mode) should not leak.
Actual Results
Memory leaks when dev-reloading the app with listeners on RealmResults and List objects. It does not leak on listeners on the Realm instance.
Steps to Reproduce
- Call addListener on either a RealmResults object or a List object.
- Reload the app (CMD+R)
- See that memory climb
Code Sample
I created a fresh React Native app to demonstrate the issue at https://github.com/dkpalmer/realm-rn-reload-leak/. Inside App.js there are 3 cases within componentWillMount:
Does not leak when reloading: (1) Realm listener
Does leak when reloading: (2) Results listener and (3) List object listener
Assuming you have the RN CLI and Xcode installed, app can be run by cloning, installing dependencies, and running react-native run-ios.
Version of Realm and Tooling
- Realm JS SDK Version: 2.27.0 and 2.28.0
- Node or React Native: RN 0.59
- Client OS & Version: iOS
- Which debugger for React Native: DEV Perf Monitor
- is related to
-
RJS-1700 Meta-ticket: Memory Corruption
- Closed