circular memory leaks: cleanup in all browsers beneficial

P

Peter Michaux

I just ran some circular memory leak tests in IE6, O9, S3, FF2 and it
seems to me they all benefit from doing the same kind of circular
memory leak cleanup that IE requires.

My tests were very similar to Richard Cornford's which are very easy
to set up and watch run.

<URL: http://groups.google.com/group/comp.lang.javascript/msg/e723d3324aaa4127>

On my machine, O, S, and FF all level off at around 38MB of RAM while
the pages load and unload. If I am using the cleanup. If I don't use
cleanup they seem to level off at about 180MB.

I've always been using the onunload cleanup for all browsers and was
considering stopping doing that for all but Internet Explorerer. I
won't be stopping on any browser. It seems all the garbage collectors
can use the help.

Peter
 
P

Peter Michaux

I just ran some circular memory leak tests in IE6, O9, S3, FF2 and it
seems to me they all benefit from doing the same kind of circular
memory leak cleanup that IE requires.

My tests were very similar to Richard Cornford's which are very easy
to set up and watch run.

<URL:http://groups.google.com/group/comp.lang.javascript/msg/e723d3324aaa4127>

On my machine, O, S, and FF all level off at around 38MB of RAM while
the pages load and unload. If I am using the cleanup. If I don't use
cleanup they seem to level off at about 180MB.

I've always been using the onunload cleanup for all browsers and was
considering stopping doing that for all but Internet Explorerer. I
won't be stopping on any browser. It seems all the garbage collectors
can use the help.

Oddly enough it seems that just the following in the non-IE browsers
is enough to trigger garbage collection onunload

global.addEventListener(
'unload',
function() {},
false);

Peter
 
D

David Mark

Which also prevents fast history navigation.
Ed, thank you. That seems like a reasonable explanation.

So perhaps those were false positives in the other browsers?
 
P

Peter Michaux

Which also prevents fast history navigation.


So perhaps those were false positives in the other browsers?

They do seem to level off at about 180MB of RAM use so I can imagine
the cache is full at that point and just killing the oldest stuff. If
it was a leak it would just keep building, I would think.

Peter
 
D

dhtml

Which also prevents fast history navigation.
Not only that, it's a good reason to want to not have an onunload
handler in a lot of cases.
So perhaps those were false positives in the other browsers?
It would be nice there were a good way to detect memory leaks, so you
could conditionally add an onlunload handler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top