Dev01
Dev01

Reputation: 14149

How can I find memory leaks in React Native iOS?

I'm working on a react native app and I think it might have a memory leak. Sometimes if I leave the simulator running for a few hours unattended it will use 1.5 gigabytes of memory. I'm not sure the problem is in my code, it could be xcode or react native.

I'm trying to figure out if maybe I have a function that is unintentionally being called over and over or something similar. Anyone know if there is a way for me to figure out my code is causing the memory issue?

Upvotes: 4

Views: 2875

Answers (1)

Ben Clayton
Ben Clayton

Reputation: 82219

There has been a major memory leak while iOS debugging for a while now. Sometimes, you can watch the Xcode memory usage meter just creeping up while you're app is just sitting there.

I've had a simple app use 5GB!

It's probably not a mistake at your end.

This may by fixed in 22-rc, but I haven't tried that myself yet.

Fix Exponential WebSocket Growth from DevTools - d0a26a7

https://github.com/facebook/react-native/releases/tag/v0.22.0-rc

Upvotes: 1

Related Questions