Javascript closure and memory issues
<pre><code>//Following function add new table entry to table
//and return interface which has function which uses closure to access and update the table
var _newRow  = (function(){
    var _interface = {
        updateName: null,
        updateProgress: null,
        actionLinkButton : null,//&lt;a&gt; tag used for user aciton to perform on UI like delete, hide, show etc.
        ..
        ..
        ..
    };
    var tr = createTr();    
    var tdName = createTd();
    _inteface.updateName = function(newName){
        tdName.innerHTML = newName;
    }
    ..
    ..
    ..
    ..
    ..  
    return _interface;
})(tblObject);

//maintaining the array of all the rows as per row number
rowArray[rowNo] = _newRow;
..
..
//using the row array to update the entries
rowArray[rowNo].updateProgress('read');
</code></pre>

<p>Above is the pattern i have used to update the dynamically added rows on the client end. What i do is to while adding row to the table create _interface, return it and store it as per row number. </p>

<p>However for this i have used closure means many alive objects. I would like to know is this correct way ? Is there better approach that this ? What profiling tools i can use to know how much memeory this code is using ? How can i ensure that closures are cleared properly when they are not needed ?</p>
