title: Memory leak with AJAX requests + jQuery
body: <p>I am repeatedly fetching a JSON object from the server with AJAX calls. Over time, the memory usage of the browser grows (tried with Chrome, Safari, Firefox). Using Chrome's heap snapshots, I've discovered that the timestamp strings are being left around with no references. If I a take a sequence of snapshots, I see the number of Strings is continually increasing.</p>
  
  <pre><code>$(function() {
      var latestTimestamp = 0;
  
      function fetchData() {
          $.get("/parameter?format=json&amp;since=" + latestTimestamp, gotData)
      }   
  
      function gotData(data) {
          latestTimestamp = data['timestamp'];
          setTimeout(fetchData, 250);
      }   
  
      fetchData();
  });
  </code></pre>
  
  <p>Other notes:</p>
  
  <ul>
  <li>I'm using jQuery 1.7.1.  EDIT: Just tried with 1.6.2 and 1.4.2, same problem.</li>
  <li>The <code>timestamp</code> in the JSON object is actually an integer, not a string. So the accumulating strings might be temporary values?</li>
  <li>Removing the <code>+ latestTimestamp</code> from the AJAX request stops the leak. </li>
  <li>A faster setTimeout (20ms) causes the leak faster. I thought the fast timeout might be to blame, so I cut it back to 250ms, but that didn't help.</li>
  </ul>