title: When should I call realm.close()?
body: <p>I'm using Realm for my React Native app. I'm making Realm instances available to my components like this, as shown in the official <a href="https://github.com/realm/realm-js/blob/master/examples/ReactExample/components/realm.js" rel="noreferrer" title="React Native and Realm example">example app</a>:</p>
  
  <p><code>export default new Realm({schema: [Todo, TodoList]});</code>.</p>
  
  <p>When I subsequently ran tests with Jest, I realized that the process didn't finish as long as I wouldn't call</p>
  
  <p><code>afterAll(() =&gt; {
    realm.close();
  });
  </code></p>
  
  <p>at the end of the test suite.</p>
  
  <p>This made me think about if and when I should call <code>realm.close()</code> in the production code. What are the consequences of not calling close? If recommended, what would be the best way to close Realm instances?</p>