Scott,
I think there are not many people on this list working extensively with
JavaScript in such areas :) I do a lot so you're lucky ;)
IE uses a garbage collector, commonly known as mark n sweep. One aspect
of these types of garbage collectors is that they don't collect data
which has any type of unknown reference to it. Unknown reference? Yes,
references between JavaScript objects and DOM objects are unknown to the
browser, resulting in circular reference chains. These are the types of
references resulting in allocated memory being kept. For performance
reasons the DOM nodes are only freed up when closing the browser.
Don't be fooled by other browsers, Mozilla/FireFox browsers also leak,
in the case of Google Gmaps as twice as bad as IE.
To overcome this you have to do memory management yourself. Implementing
dispose methods, cleaning up all references by hand, attaching onunload
handlers, etc. etc. this requires at least intermediate knowledge of
JavaScript. When using ActiveX (MSXML) / XMLHttpRequest you will always
suffer from a small memory leak, but that isn't really an issue because
the leaks are so small they don't cause any trouble at all.
50MB for an IEXPLORE process is nothing, and if they truly like to
invest time and money in such a topic I would definitely define an
agreement with them stating that the chances on memory footprint
improvement are actually very low and you cannot held responsible for
loss of investment.
If you'd like more information, contact me of the list, I am using MSN
with [EMAIL PROTECTED]
This for example leaks 400kb per refresh here, and shows circular
reference chains.
function Car() {
var div = document.createElement('div');
div.appendChild(document.createTextNode('test'));
this.el = document.body.appendChild(div);
this.el.onmouseover = function() {
this.style.backgroundColor = '#f0f0f0';
}
this.el.onmouseout = function() {
this.style.backgroundColor = 'white';
}
}
window.onload = function() {
for(var i=0; i<200; i++) {
new Car();
}
}
Micha Schopman
Project Manager
Modern Media, Databankweg 12 M, 3821 AL Amersfoort
Tel 033-4535377, Fax 033-4535388
KvK Amersfoort 39081679, Rabo 39.48.05.380
------------------------------------------------------------------------
------------------------------------------------------------------------
-----
Modern Media, Making You Interact Smarter. Onze oplossingen verbeteren
de interactie met uw doelgroep.
Wilt u meer omzet, lagere kosten of een beter service niveau? Voor meer
informatie zie www.modernmedia.nl
------------------------------------------------------------------------
------------------------------------------------------------------------
-----
-----Original Message-----
From: Scott Barnes [mailto:[EMAIL PROTECTED]
Sent: dinsdag 8 maart 2005 7:45
To: CF-Talk
Subject: OT: Memory Leak in Browsers?
Basically, most would know about the Internet Explorer Memory leak in
terms of Garbage Collection not being able to read our Development
minds.
My question is, has anyone here actually experienced bad memory leaks?
in that have you build an application using massive amounts of DHTML -
only 3 months down the track you've had to come back and rebuild stuff
simply because it became a memory hog?
I ask this as despite the know bug in IE (argueably it could be
considered developer bad foreplay but anyway) even if an application
after an hours use steals 50mb of RAM (now that would have to be a
pretty darn big app mind you) surely that wouldn't affect todays
computers? as in most would probably fair to say have around 512mb of
Ram at minimum?
Also taking into account most Tools can ask upward to 90mb to run
anyway (ie java based ones that is).
--
Regards,
Scott Barnes
http://www.mossyblog.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197778
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54