I have the following which is updating an element on the screen, and I can't seem to prevent it from consuming memory, it is consuming roughly 0.10% or ram every minute.
I have already tried to null all of the variables, but nothing I seem to do will stop this leak.
function TimeTick(){
var lt = new Date();
lt.setMilliseconds(lt.getMilliseconds()-g_svros);
var ch=lt.getHours(), cm=lt.getMinutes(), cs=lt.getSeconds();
if(ch==0) ch=12;
$('#clock').val((ch >12?ch-12:ch)+":"+(cm<10?"0":"")+cm+":"+(cs<10?"0":"")+cs+" "+(ch>=12?"PM":"AM"));
lt=null;ch=null;cm=null;cs=null;
}
var tick = setInterval('TimeTick()',250);
I profiled the memory usage of the browser from the command prompt by sampling the browser process.
If I disable this function, then the memory does not increas and stays perfectly stable !