Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding memory leaks in JavaScript using firebug?

Are there any add-ons for Firefox that I can use to find out with part of the JavaScript causes memory leaks?

like image 762
cometta Avatar asked Feb 17 '11 11:02

cometta


People also ask

How do you check if there are memory leaks?

The primary tools for detecting memory leaks are the C/C++ debugger and the C Run-time Library (CRT) debug heap functions. The #define statement maps a base version of the CRT heap functions to the corresponding debug version. If you leave out the #define statement, the memory leak dump will be less detailed.

Can you have memory leaks in JavaScript?

The JavaScript engine allocates memory when you create objects and variables in your application, and it is smart enough to clear out the memory when you no longer need the objects. Memory leaks are caused due to flaws in your logic, and they make way for poor performance in your application.

How do you detect memory leaks on a Web application?

Start with metrics such as page load times, HTTP request times, and Core Web Vitals – time to the first byte, first contentful paint. If you use Sematext Experience you'll see a number of other useful metrics for your web applications and websites there. However, metrics themselves are only a part of the whole picture.


1 Answers

I've got nothing for firefox, but the webkit inspector in Chrome has a profiler built in that is great for that kind of thing.

As an added bonus it also shows you all browser events such as repaints, so you can engineer your code to have the least impact on the browser.

like image 191
xzyfer Avatar answered Oct 06 '22 00:10

xzyfer