473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

circular memory leaks: cleanup in all browsers beneficial

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
Feb 18 '08 #1
6 1833
On Feb 18, 10:33 am, Peter Michaux <petermich...@gmail.comwrote:
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
Feb 18 '08 #2
Ed
On Feb 18, 12:58 pm, Peter Michaux <petermich...@gmail.comwrote:
On Feb 18, 10:33 am, Peter Michaux <petermich...@gmail.comwrote:


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
I think this is explained here:

http://developer.mozilla.org/en/docs...indow.onunload

It says, "using this event handler in your page prevents Firefox 1.5
from caching the page in the in-memory bfcache".
Feb 18 '08 #3
On Feb 18, 11:42 am, Ed <e...@siliconforks.comwrote:
On Feb 18, 12:58 pm, Peter Michaux <petermich...@gmail.comwrote:
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

I think this is explained here:

http://developer.mozilla.org/en/docs...indow.onunload

It says, "using this event handler in your page prevents Firefox 1.5
from caching the page in the in-memory bfcache".
Ed, thank you. That seems like a reasonable explanation.

Peter
Feb 18 '08 #4
On Feb 18, 3:33*pm, Peter Michaux <petermich...@gmail.comwrote:
On Feb 18, 11:42 am, Ed <e...@siliconforks.comwrote:


On Feb 18, 12:58 pm, Peter Michaux <petermich...@gmail.comwrote:
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
I think this is explained here:
*http://developer.mozilla.org/en/docs...indow.onunload
It says, "using this event handler in your page prevents Firefox 1.5
from caching the page in the in-memory bfcache".
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?
Feb 18 '08 #5
On Feb 18, 2:32 pm, David Mark <dmark.cins...@gmail.comwrote:
On Feb 18, 3:33 pm, Peter Michaux <petermich...@gmail.comwrote:
On Feb 18, 11:42 am, Ed <e...@siliconforks.comwrote:
On Feb 18, 12:58 pm, Peter Michaux <petermich...@gmail.comwrote:
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
I think this is explained here:
http://developer.mozilla.org/en/docs...indow.onunload
It says, "using this event handler in your page prevents Firefox 1.5
from caching the page in the in-memory bfcache".

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?
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
Feb 18 '08 #6
On Feb 18, 2:32 pm, David Mark <dmark.cins...@gmail.comwrote:
On Feb 18, 3:33 pm, Peter Michaux <petermich...@gmail.comwrote:
On Feb 18, 11:42 am, Ed <e...@siliconforks.comwrote:
On Feb 18, 12:58 pm, Peter Michaux <petermich...@gmail.comwrote:
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
I think this is explained here:
http://developer.mozilla.org/en/docs...indow.onunload
It says, "using this event handler in your page prevents Firefox 1.5
from caching the page in the in-memory bfcache".

Which also prevents fast history navigation.
Ed, thank you. That seems like a reasonable explanation.
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.
Feb 19 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Maurice | last post by:
Hi there, I'm experiencing big memory problems on my webserver. First on an old RedHat 7.2 system, now on an other fresh installed Suse 8.2 system: Linux version 2.4.20-4GB...
14
by: J. Campbell | last post by:
what happens to allocated memory when a program terminates before the memory is released. For example: int main(){ int* array; int a_size = 1000; array = new int; for(int i = 0; i < a_size;...
2
by: Generic Usenet Account | last post by:
I have been using STL for a long time now, without any problems. Recently we generated a purification report on our software using Rational Purify, and we found some memory leaks. My colleague...
0
by: Frank Lopez | last post by:
Does anyone know if Microsoft generated a whitepaper on this topic? Does anyone know what the solution is? (meaning, eliminate the leak problem -- I am seeing three memory leaks from...
4
by: ali.jan | last post by:
Hi, It is trivial to load an assembly in a new Application Domain. Is there any way of loading an assembly in a new process? I tried using the Process class like this: Process p = new...
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
2
by: Robert | last post by:
Hello javascript group readers, I have a question regarding how to prevent memory leaks in Internet Explorer when using closures. I already knew about the circular reference problem, and until...
1
by: Joe Peterson | last post by:
I've been doing a lot of searching on the topic of one of Python's more disturbing issues (at least to me): the fact that if a __del__ finalizer is defined and a cyclic (circular) reference is...
6
by: nmehring | last post by:
I have an MFC app with 2000 users. I have one user that experiences a crash in our software anywhere from 1 to 5 times a week when opening a particular module. No other users have reported this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.