Dynamic table memory usage
<p>I use a dynamic table:</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;button id="button"&gt;Build table&lt;/button&gt;
&lt;div id="container"&gt;
&lt;script type="text/javascript"&gt;
window.onload=function(){
 var table = null;

 var row = "&lt;tr&gt;&lt;td&gt;111111111111111111111111111111111111111111111111111111&lt;/td&gt;" +
           "&lt;td&gt;222222222222222222222222222222222222222222222222222222&lt;/td&gt;" +
     "&lt;td&gt;333333333333333333333333333333333333333333333333333333&lt;/td&gt;&lt;/tr&gt;";
 var data = null;
 for (var i = 0; i &lt; 2000; i++){
  data += row;
 }

 var obj = document.getElementById("button");
 obj.onclick=function buildTable(){
  document.getElementById("container").innerHTML = "&lt;div&gt;&lt;table&gt;&lt;tbody&gt;" + data + "&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;";
 };
};
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Using chromes task manager, each time new data is loaded the memory usage increases considerably and doesn't go down, so after some time the app consumes a lot of memory and requires the browser to be closed. Is there any change in the code I can use to solve this or is it a browser side problem?</p>
