PDA

View Full Version : Tool or strategy for finding memory leaks



david_kw
Mar 27th, 2007, 06:33 PM
I know IE has memory leaks from circular references and such. And I often see posts about memory leaks. So I'm wondering if there is a tool or strategy people are using to find out if their own site has a memory leak in a browser.

In other words, what is the best way to test if you have a memory leak?

david_kw

shyam
Mar 27th, 2007, 09:13 PM
i've tried this (https://addons.mozilla.org/en-US/firefox/addon/2490) but din't make much out of it

david_kw
Mar 27th, 2007, 09:53 PM
Hmm, my use is really for webapps and not for extensions to FF.

Thanks though,
David

jkd
Mar 28th, 2007, 12:00 AM
This has helped me with IE leaks before:
http://www.outofhanwell.com/ieleak/index.php?title=Main_Page

liorean
Mar 28th, 2007, 12:49 AM
Yeah, DRIP is quite a good tool for finding iew memory leaks. It's not perfect however, it sometimes generates both false positives and false negatives.

For Opera, there is a couple of tools called MemGuard (http://people.opera.com/axel/memguard.htm) and Inspector IIXII (http://www.opera.com/support/search/view/432/). I think memguard has some memory leak detection, though I'm pretty sure it only covers application memory leaks and not pure JavaScript/BOM pseudo-leaks*. Other than that, watch the task manager for constantly increasing memory consumption.

For Mozilla I believe there are several solutions. However, the most common memory leaks in moz are related to Flash or other plugins, to Firebug** or other add-ons. For true leak testing, use safe mode or uninstall all add-ons and plug-ins.

As for WebKit/Safari, I haven't got Tiger so I don't know the latest tools. Maybe Drosera can do something to monitor internal memory leaks?


* By which I mean that if you get the memory back after closing the tab, then it's not a true leak and won't be caught by memguard.

** A terribly broken script, or a maliciously coded page, can make moz consume unbounded growing memory even after closing the offending tab (given the application remains so responsive that you can do this...) if firebug is installed.

david_kw
Mar 28th, 2007, 01:45 AM
Great! Thanks for the options. I'll definitely look in to those.

david_kw