Is it a leak or a pseudo-leak ?

leak -> page is being reloaded
pseudo-leak -> no reload

First you should know that firebug leaks a lot of memory, so you should
perform your memory test with firebug disabled, ideally with all ff plugins
disabled.


The first and easiest to spot source of pseudoleaks is an ever growing dom.
Use your app, for instance add/remove things and verify if the dom keeps
growing. If it is the case, the added elements should tell you where the
issue comes from.

Another easy source of instability, is people forgetting to declare their
vars with the var prefix. Under firebug, use the script tab and type
"window" in the "new watch expression" field. That should give you all the
js data of you app. Pollution of the global namespace often indicates that
the var prefix has been forgotten.

jQuery prevent certain memory leaks ofr you. but jQuery is getting fooled if
its methods are not being used. For instance the use of innerHTML = ""
instead of jQuery's remove() or empty() will produce leaked event handlers.
So do a gloabal search for that in you app.

There is a "memory profiler"  extension in firefox, it works with FF3.5+.
use it. https://addons.mozilla.org/en-US/firefox/addon/14666

In general, I'll advice you a dichotomic analysis of your app. Disable the
half of your app, and check if the leak is there. If yes, then the leaks
comes from the non-disabled part, if no, it comes from the disabled part.
With that process you can isolate the issue.

HTH

olivvv

Normally


On Sun, Dec 6, 2009 at 3:03 PM, James Gibson <james.t.gib...@gmail.com>wrote:

> I am using about 25 jquery plugins along with 1.3.2 and jquery ui 1.7.
> After using my app for a while firefox starts eating up memory and it
> can get up to 500MB and more. What tips and tricks to you guys find
> help eleminate memory leaks in your code?
>
> Thanks,
> James
>

Reply via email to