0

I have noticed that my application is causing a substantial memory leak in firefox (and only firefox for some reason).

I imagine this would be caused by my jQuery code. Of which there is a huge amount.

My understanding is that Firebug, with which I am quite familiar with, can be used to pinpoint memory leeks in your code.

However I have done quite a bit of reading on this subject across the last week and while I see that by profiling the memory heap you can identify a leak I am still completely unclear as to how I would actually pinpoint the function or functions in my code that are causing the issue.

Can anyone give me any advice or provide me with some good resources on the issue as it relates to jQuery. Also are there any good tools out there other than firebug to make this kind of debugging easier.

Many thanks.

1 Answer 1

2

I use a tool called sieve to check for javascript memory leaks, it along with some others are talked about in this msdn article.

http://blogs.msdn.com/b/ie/archive/2007/11/29/tools-for-detecting-memory-leaks.aspx

Generally though, you need to isolate bits of scripting, cutting away working pieces until you find the section that is causing the problem, and then run a profiler, like the one in firebug.

In my jQuery I've found that mishandling dialog box's where the problem in every case.

Oh and make sure your running the latest jquery code, there might be a bug fix your missing.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks thats actually hugely useful. I'm going to leave the question open for a while as hopefully I will get some more answers/advice. Cheers!
@gordyr No problem. This issue is a huge hassle. In my project though, IE is always the issue, and FF/Chrome works fine. That's a little odd to me.
Indeed... Stupidly I hadn't thought about this before, but I wonder if the issue is related to a firefox addon? Although that doesn't explain why I don't see the problem with other commercial sites. This is going to be a long night/week. :-P
@gordyr I had an app go live, and 1 day into it a floor of slowness complaints - turns out I had a memory leak. Had it for over a year. But the update had added more forms, and made the leak 3 times worse, and able to effect browser performance. I had no idea this sort of thing was even a thing. I had to rollback the live up, and spend 2 weeks of crazy work to figure out was was happening, then rework a ton of stuff to fix it. It was a nightmare. Good luck.
Ouch! Well hopefully I can get this nailed before we go live. I really need to up my understanding of browser memory allocation and modify my coding practices accordingly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.