views:

66

answers:

2

I've written a lot of code for a website I'm developing and only just now realised it has a memory leak. I noticed Firefox getting rather slow over the day and checked my task manager to find it idling at 600,000 K.

Seemed odd and so I killed it/restarted it. Then realised that, while watching the task manager, the more I played around with my website the higher the memory usage got in Firefox.

Now, I have a lot of code... I don't want to have to recode it and try do it better this time around. So how can I look over my code and identify memory leaks? It's pretty much all jQuery stuff (binding clicks, changes, etc...) and AJAX (using jQuery UI tabs).

How can I fix this? >.<

+1  A: 

This article from IBM's technical library has some good advice on how to avoid Memory leak patterns in JavaScript.

Raul Agrait
I'll take a look. Cheers.
Robert
A: 

You need to use a JavaScript profiler, like this addon for Firefox. It will help you find the memory leak(s) and you will have to fix it.

Strelok