title: React Native - android - Memory is not released
body: <p>We have a production app and using 'adb shell dumpsys meminfo' to measure the memory. We see the memory is continuously growing while taking dumps in this tool. We see the Unknown category is growing and never comes down. When we attach debugger and perform JS memory snapshot we see that memory is dropping down at places where we clean. To simplify this we have created simple app  to allocate and deallocate memory in one screen. In chrome debugger we see the memory drops when we deallocate; but while running in the device/emulator without debugger the memory is shooting and does not come down even if we deallocate. T some point the app is crashing. It looks like JavaScript GC is never running. Please see the details we have posted below. As this is blocking our release we kindly request to look into this. Why is the RN app memory is always increasing and app is crashing?"</p>
  
  <p>I am running simple react native application to understand the memory usage.
  When I used chrome debugger to check the memory it's not retaining any memory. But when I use adb sysdump to check the memory, jsthread is not releasing memory.</p>
  
  <p>I am using react-navigation to do navigation between the screens. I am using createStackNavigator method.</p>
  
  <p><a href="https://i.stack.imgur.com/WVuwB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WVuwB.png" alt="enter image description here"></a></p>
  
  <p>My component name is screenOne. The component contains AddRecord method to add records. Once I press back button component will be unmounted and will be navigated to HomeScreen. </p>
  
  <p><a href="https://i.stack.imgur.com/iQvnp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iQvnp.png" alt="enter image description here"></a></p>
  
  <p>SnapShot One - initial memory - HomeScreen page </p>
  
  <p><a href="https://i.stack.imgur.com/aO7gu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aO7gu.png" alt="enter image description here"></a></p>
  
  <p>SnapShot Two  - Navigate to screenOne component.</p>
  
  <p><a href="https://i.stack.imgur.com/nD8lO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nD8lO.jpg" alt="enter image description here"></a></p>
  
  <p>SnapShot Three - pressed addRecord method multiple times to increase the memory.
  <a href="https://i.stack.imgur.com/wYjMV.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wYjMV.jpg" alt="enter image description here"></a></p>
  
  <p>SnapShot Four - Navigate back to HomeScreen, memory has been released
  <a href="https://i.stack.imgur.com/abQ3w.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/abQ3w.jpg" alt="enter image description here"></a></p>
  
  <p>But When I do adb shell dumpsys meminfo - memory is not released.</p>
  
  <p>Initial - Memory
  <a href="https://i.stack.imgur.com/jhrgy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jhrgy.jpg" alt="enter image description here"></a></p>
  
  <p>Adding Records - increasing the memory 
  <a href="https://i.stack.imgur.com/y50wy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y50wy.jpg" alt="enter image description here"></a></p>
  
  <p>Navigate Back to HomeScreen - not releasing the memory
  <a href="https://i.stack.imgur.com/PBUTC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PBUTC.jpg" alt="enter image description here"></a></p>