Javascript Memory Usage
<p>In the following code: </p>

<pre><code>$(document).ready(function() {
    var content = "";
    for (var i = 0; i &lt; 1000; i++) {
        content += "&lt;div&gt;Testing...&lt;/div&gt;";
    }
    $("#Load").click(function() {
        $("#MyDiv").empty();
        $("#MyDiv").append(content);
        return false;
    });
});
</code></pre>

<p>Load is a simple link and MyDiv is a simple div. In each major browser I tested this in, when I click on the link multiple times, I see the memory usage go up in Task Manager. In IE, it goes up slightly each time and stays up. In FF, it goes up each time, but once in a while comes down (I think this means that the memory is being reclaimed or garbage collected - a good sign). In Chrome, it goes up significantly each time and stays up. </p>

<p>First, is this code cleaning up the DOM correctly? If so, why does the memory usage increase with every click? </p>

<p>Note: I tried to make the example as simple as possible, but similar to the problem I am having in my app. </p>
