title: Unexplained growth in chrome private memory
body: <p>I am in the process of profiling a javascript library I wrote, looking for memory leaks.  The library provides an API and service to a back-end.  It does not do any html or dom manipulation.  It does not load any resources (images, etc). The only thing it does is make xhr requests (using jquery), including one long poll, and it passes and receives data to and from the UI via events (using a Backbone event bus).</p>
  
  <p>I have tested this library running it overnight for 16 hours.  The page that loads it does nothing but load the library and sends a login request to start the service.  There were no html, css, or other dom changes over the course of the test.</p>
  
  <p>All that happened over the course of the test was the library sent a heartbeat (xhr request) to the server every 15 seconds, and received a heartbeat via the long poll every 30 seconds.</p>
  
  <p>I ran the test with the chrome task manager open, and with the chrome debugger open, in order to force GCs from the timeline.</p>
  
  <p>At the start of the tests, after I forced an initial GC - these were the stats from the chrome task manager:
  Memory - 11.7mb</p>
  
  <p>Javascript memory -  6.9 mb / 2.6mb live</p>
  
  <p>Shared memory - 21.4 mb</p>
  
  <p>Private memory 19mb</p>
  
  <p>After 16hrs I forced a GC - these were the new stats:
  Memory - 53.8mb</p>
  
  <p>Javascript memory -  6.9 mb / 2.8mb live</p>
  
  <p>Shared memory - 21.7 mb</p>
  
  <p>Private memory 60.9mb</p>
  
  <p>As you can see the JS heap grew by only 200k.</p>
  
  <p>Private memory grew by 42mb!</p>
  
  <p>Can anyone provide possible explanations of what caused the private memory growth?  Does having the chrome debugger open cause or affect the memory growth?</p>
  
  <p>One other thought I had is that forcing the GC from the timeline debugger only reclaimed memory from the JS heap - so other memory was not reclaimed.  Therefore this may not be a 'leak' per se, as it may eventually be collected - though I'm not sure how to confirm this.  Especially without knowing what this memory represents.</p>
  
  <p>Lastly, I did read that xhr results are also stored in private memory.  Does anyone know if this is true?  If so, the app did perform approx 5700 xhr requests over this timeframe. If most of the 42mb was due to this, that would mean approx 7k was allocated - which seems high, considering the payloads were very small.  If this is the case; when would this memory be released, is there anything I can do to cause it to be released, and would having the chrome debugger open impact this?</p>