<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Memory is never released</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/memory-is-never-released</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/memory-is-never-released/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Roman on Memory is never released</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/memory-is-never-released#p27897</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/memory-is-never-released#p27897</guid>
        	        	<description><![CDATA[<p>Same problem here. Please, anyone?</p>
]]></description>
        	        	<pubDate>Wed, 12 Dec 2012 11:56:13 +0200</pubDate>
        </item>
        <item>
        	<title>destells on Memory is never released</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/memory-is-never-released#p27735</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/memory-is-never-released#p27735</guid>
        	        	<description><![CDATA[<p>I&#39;m testing with a simple example that create a grid when the page is loaded.</p>
<p>The HTML code:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3133' value='Select Code' data-codeid='sfcode3133' /></p>
<div class='sfcode' id='sfcode3133'>
<p>&#60;button id="createGridBtn"&#62;Create grid&#60;/button&#62;<br />&#60;div id="grids"&#62;<br />&#60;/div&#62;</p>
</div>
<p>The JS code:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6148' value='Select Code' data-codeid='sfcode6148' /></p>
<div class='sfcode' id='sfcode6148'>
<p>var createGrid = function () {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid = jQuery(&#39;&#60;table id="grid"&#62;&#60;/table&#62;&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid.appendTo(jQuery(&#39;#grids&#39;));</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid.jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: [],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;local&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 700,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: &#39;auto&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;Id&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;Type&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;Description&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;Notes&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;Main&#39;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name: &#39;contactDataId&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index: &#39;contactDataId&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 0,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sorttype: "int",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; hidden: true<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name: &#39;typeName&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index: &#39;typeName&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 4<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name: &#39;description&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index: &#39;description&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 5<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name: &#39;notes&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index: &#39;notes&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 2<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name: &#39;isMain&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index: &#39;isMain&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 2,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; align: "center"<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; multiselect: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#39;Contact data&#39;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });</p>
<p>&#160;&#160;&#160;&#160;&#160; };</p>
<p>&#160;&#160;&#160;&#160;&#160; var _destroyAndCreateGridHandler = function (event) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#grid&#39;).jqGrid(&#39;GridDestroy&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; createGrid();<br />&#160;&#160;&#160;&#160;&#160; };</p>
<p>&#160;&#160;&#160;&#160;&#160; $(document).ready(function() {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; createGrid();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#createGridBtn&#39;).on(&#39;click&#39;, _destroyAndCreateGridHandler);</p>
<p>&#160;&#160;&#160;&#160;&#160; });</p>
</div>
<p>Then, when I click in the button, the old grid is destroyed and creates a new grid.</p>
<p>I have been analyzing this test with the "Take Head Snapshot Profile" of Google Chrome:</p>
<ul>
<li>Loaded page: 3.20MB</li>
<li>Perform click on the button: 3.28MB</li>
<li>Another click: 3.35MB</li>
<li>...</li>
</ul>
<p>As I could see, the memory grows when I destroy the old grid and create the new.</p>
<p>My question is, why? The memory should be the same, because I&#39;m destroying the old grid and create the new.</p>
<p>Please, can anyone help me?</p>
]]></description>
        	        	<pubDate>Wed, 14 Nov 2012 18:47:34 +0200</pubDate>
        </item>
</channel>
</rss>