iOS Event Memory Leak #26308
Labels
Bug
Platform: iOS
iOS applications.
Ran Commands
One of our bots successfully processed a command.
Resolution: Locked
This issue was locked by the bot.
I have some Swift code that sends events to React Native via RCTEventEmitter.
It is sending events with quite large NSArrays, and there is a memory leak. Both on the simulator and on a device memory increases to roughly 1.3GB after 30 seconds and the app crashes.
This totally could be an issue with my code, but I'm pretty sure that I've done things exactly per the documentation for sending-events-to-javascript.
React Native version:
Steps To Reproduce
react-native init
Describe what you expected to happen: No memory leak
Snack, code example, screenshot, or link to a repository:
The behaviour can be seen in the following repo. The first commit is a simple
react-native init
project, and the second commit is the code using RCTEventEmitter which creates the memory leak.https://github.com/robzyb/rn-memory-leak
The memory leak can be replicated by simply `react-native run-ios'
Investigation so far
I have spent many hours on this but I haven't been able to nail it down. Javascript debug tools show a relatively constant 10/20MB usage, but Xcode shows the memory leak in action. Suggesting that the problem is with the Swift/Objective-C side.
The text was updated successfully, but these errors were encountered: