Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are some of the best Javascript memory detecting tools?

Our team is faced with slow but serious Javascript memory leak. We have read up on the normal causes for memory leaks in Javascript (eg. closures and circular references).

We tried to avoid those pitfalls in the code but it likely we still have unknown mistakes left.

I started my search for available tools but would like input from people with actual experience with these tools.

Some of the tools I found so far (but have no idea how good and useful they would be for our problem):

  • Sieve
  • Drip
  • JavaScript Memory Leak Detector

Our search is not limited to free tools, it will be a bonus, but more importantly something that will get the job done.

We do the following in our Javascript code:

  • AJAX calls to a .NET WCF back-end that send back JSON data
  • Manipulate the DOM
  • Keep a fairly sized object model in the Javascript to store current state
like image 686
Philip Fourie Avatar asked Mar 08 '10 06:03

Philip Fourie


3 Answers

sIEve is for memory leaks in IE specifically. What I like about it is that you can reliably reproduce the steps used and capture action-able data. See the following:

How to use IE7 Javascript memory leak detectors?

like image 190
Dexygen Avatar answered Nov 08 '22 10:11

Dexygen


Another tool for you: JavaScript Memory Validator.

Shows allocations, objects, hotspots, generations, snapshots, etc.

Works with Firefox 1.0 through 3.6.

like image 34
Stephen Kellett Avatar answered Nov 08 '22 09:11

Stephen Kellett


I have used the JavaScript Memory Leak Detector and I can tell you it works great.

What dynamic engine are you using? Based on the mention of a .Net web service, I'm guessing that you are using ASP.Net. Is that correct? You may want to look at the ASP.Net AJAX JavaScript library. It was built in a way that helps this situation. All components have a dispose() method that allows you to remove references to DOM objects. When I switched to ASP.Net AJAX, my page became much more responsive.

like image 31
Gabriel McAdams Avatar answered Nov 08 '22 08:11

Gabriel McAdams