title: jQuery.remove(), detach DOM elements, but I still can access the elements from code. How to avoid leaks?
body: <p>I'm aware that it's not easy to correctly manage memory inside an application with lot of UI elements and completely based on Ajax (in my app the pages are never reloaded). But I would like to understand the following behaviour:</p>
  
  <p>I have a root element to which a single child element at a time must be attached (think it as the root element being the app container and the childs the single pages).
  Whenever I switch between child contents, I remove the previous content with jQuery.remove(), but I see that the content is actually detached from the DOM but it remains in memory. </p>
  
  <ol>
  <li>root and two child contents (child1 and child2)</li>
  <li>from child1 I switch to child2, asking my app manager to remove child1 before attaching child2</li>
  <li>child2 is being attached (I can see it) but I still can use child1 elements from the code that manages child1</li>
  </ol>
  
  <p>child1 code (which holds references to child1 DOM):</p>
  
  <pre><code>function testaccess(){
     load_and_remove(child2);
     var child1DOM = get_this_dom();
  }
  </code></pre>
  
  <hr>
  
  <p>child1DOM is still there, and I can manipulate it as if it was still attached to the DOM.</p>
  
  <p>Ok, I suppose that jQuery.remove() and the GC won't be able to release memory until I have code that will access it, but even if I don't call get_this_dom(), even after exiting testaccess(), I see that FF memory doesn't decrease...</p>
  
  <p>I wonder how to make GC release all the memory, when I exit child1.</p>