...

View Full Version : Why does this function leak???



jaywhy13
04-30-2008, 12:11 AM
Does this "leak"?



function touched() {
/*var args = touched.arguments;
for(var i = 0; i < args.length; i++){
var obj = args[i];
if(!obj) continue;
if(!obj.id)
obj.id = getRandomId(); // give it an id
obj = null;
}
args = null;*/
}

I suspect you will get your "leak" from this since your return version did. If you do, I would conjecture that it is not a leak, or that you have tracked down the wrong function.

oesxyl
04-30-2008, 01:38 AM
Btw.. I know it leaks since on page reload... memory isn't released. The app I'm building is a mapping one, it jumps by about 20-30 MB's on load up but on refresh stays in the same range (since it cuts by 20-30 then jumps up back by 2-30)... but once I dare pass a dom element in, it leaks!!!!
that could be the cache not a leak sign, or something else.

maybe this link will help:

http://www.javascriptkit.com/javatutors/closuresleak/index.shtml

regards

A1ien51
04-30-2008, 02:22 PM
Have you used Drip or sIEve to monitor the memory?

Eric

jaywhy13
04-30-2008, 06:40 PM
Have you used Drip or sIEve to monitor the memory?

Eric

Hmmm... never heard of these... gonna ask Google... brb.

A1ien51
04-30-2008, 07:07 PM
http://home.wanadoo.nl/jsrosman/

Eric

jaywhy13
04-30-2008, 11:42 PM
Welll... according to Sieve... I leak NOT!!!!!!!!!! :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum