Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to find a memory leak and debug a jquery/javascript application?

I'm trying to degub a fairly large application written in jquery mobile and am struggling to pin down a suspected memory leak. 

I have been criss-crossing through the app running all functions up and down. all the while server memory usage is ok and all but one page are working fine.

On the page in question (widget heavy product search  & order page, using JQM photoswipe, multiview plus a bunch of other plugins) all works well for a while until most of the buttons stop working. 

Buttons not reacting tells me I need to check my jquery app manager, which also handles all event bindings. problem is, it's about 90k and I don't really know where to start, so

Question:   are there any tools that can check Jquery/Javascript for potential memory leaks? What else could I do to try and pin down the problem?

Thanks for some insights

like image 758
frequent Avatar asked Sep 26 '12 23:09

frequent


1 Answers

You might want to check out some of what the Chrome Developer Tools has to offer. I've done memory profiling and identified some memory leaks that way:

  • https://developers.google.com/chrome-developer-tools/docs/heap-profiling
  • https://developers.google.com/chrome-developer-tools/docs/heap-profiling-dom-leaks
like image 76
Alex Bain Avatar answered Sep 18 '22 13:09

Alex Bain