-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 1/8/11 7:28 PM, Garrett Smith wrote: > On 1/8/11, Bryan Forbes <[email protected]> wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> On 1/8/11 2:47 AM, Garrett Smith wrote: >>> On 1/7/11, Bryan Forbes <[email protected]> wrote: >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> On 1/6/11 5:04 PM, Garrett Smith wrote: >>>>> AFAIK MSIE closure based memory leaks was addressed in IE6 sp2. >>>> >>>> Except that IE8 can still leak with ActiveXObjects: >>>> >>>> http://www.reigndropsfall.net/demos/ie_leak/leak_activexobject.html >>>> >>> You are using a meta refresh as a test to see if more memory is >>> consumed on each refresh? A test for a memory leak must navigate >>> between two or more pages. >> >> If that is true, how do you explain memory consumption increasing as the >> page refreshes and it only being freed when the browser (not the tab) is >> closed (closing the tab doesn't free the memory)? To me, that >> constitutes a memory leak. >> > Closing the tab does not free up memory? Oh that's no good. > > The user continuously reloading the page over and over again sounds > like a really uncommon use case.
I agree and admit that I hadn't thought of that. I had adapted my tests from https://gist.github.com/43245cbb7db4eab2ad8c and thought that since the tests leaked in an unpatched IE6 that they were sufficient. In reality, they should probably navigate back and forth between two or three pages that have the same script on them. Do you think setting `window.location` would be sufficient enough? Here is what I'm thinking: Page1.html: (function(global){ // set up potentially leaky handlers here setTimeout(function(){ window.location = "Page2.html"; }, 2000); })(this); Page2.html: (function(global){ // set up potentially leaky handlers here setTimeout(function(){ window.location = "Page3.html"; }, 2000); })(this); Page3.html: (function(global){ // set up potentially leaky handlers here // add text to the page to close tab if applicable (but // not the window) and check memory consumption })(this); > One or two refreshes is plausible and > closing a tab is definitely a common case. These should not create > problems. I agree. > > [...] >> >> This site also says: > > [...] >> and: >> >> "In Internet Explorer 8, the JScript garbage collector treats DOM >> objects referenced by JScript objects as JScript objects. Rather than >> wait until page navigation as in Internet Explorer 7 or process >> termination as in Internet Explorer 6, the garbage collector manages the >> lifetime of these DOM objects and breaks circular references whenever >> possible throughout the lifetime of the site." >> >> So, it would seem that the IE8 GC should be cleaning up DOM objects all >> the time; this is proven by my DOM leak tests that only leak in an >> unpatched IE6. However, the MSDN article says nothing about >> ActiveXObjects, which is what the link I gave you is testing. It also >> shouldn't matter whether the page is navigated away from or refreshed: >> there should be no leak. Remember, I'm referring only to IE8. >> > > OK, right. > >>> Though if I'm not mistaken, that patch landed in IE6 sp2: >>> http://novemberborn.net/2007/06/javascriptmemory-leaks-gone-115 >> >> That patch may have landed, but has everyone upgraded to SP2? The MSDN >> article you linked earlier clearly states: >> > Pirated versions of Windows might not have SP2. Unless they're > disconnected from the net, wouldn't most others have that update? I'm thinking about corporate environments that restrict updates to users. And really, we can't trust users to have upgraded their browser: if we trusted users to listen to advice (whether it be from web developers or the little yellow shield in their system tray), they would have stopped using IE a long time ago ;). - -- Bryan Forbes http://www.reigndropsfall.net GPG Fingerprint 3D7D B728 713A BB7B B8B1 5B61 3888 17E0 70CA 0F3D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0puaQACgkQOIgX4HDKDz1NzQCfRnUF1385M3vb69aYPnUnRejq D7IAoKMJZ1SJ9PkPYZwWYNUUfzzgYF5z =1Kno -----END PGP SIGNATURE----- -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
