Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript memory profiler for Firefox

Is there a tool/plugin/function for Firefox that'll dump out a memory usage of Javascript objects that you create in a page/script? I know about Firebug's profiler but I'd like something more than just times. Something akin to what Yourkit has for Java profiling of memory usage.

Reason is that a co-worker is using id's for "keys" in an array and is creating 1000's of empty slots when he does this. He's of the opinion that this is harmless whereas my opinion differs. I'd like to offer some proof to prove whether I'm right or not.

like image 764
seth Avatar asked Oct 05 '08 06:10

seth


People also ask

How do I find a memory leak in Firefox?

Typing "about:memory" in Firefox's address bar will give you a comprehensive overview of the application's memory usage, including the usage of each tab and window. Additionally, entering "about:compartments" gives you a view of which Javascript compartments are in use.

Why is Firefox such a memory hog?

Extensions and themes can cause Firefox to use more system resources than it normally would. To determine if an extension or theme is causing Firefox to use too many resources, start Firefox in Troubleshoot Mode and observe its memory and CPU usage.

What is Firefox memory leak?

Firefox memory leak issues can be caused by certain plugins or browser preferences. To troubleshoot the Firefox memory problem, you should check the browser's preferences and installed extensions. The browser also has a handy memory usage option that you can use.


2 Answers

I haven't tried the Sofware verify tools, but Mozilla has tools that track overall memory consumed by firefox for the purpose of stemming leaks:

http://www.mozilla.org/performance/tools.html

and:

https://wiki.mozilla.org/Performance:Leak_Tools

There's also this guy saying to avoid large arrays in the context of closures, towards article bottom

http://ajax.sys-con.com/node/352585

like image 63
Gene T Avatar answered Oct 08 '22 04:10

Gene T


I think JavaScript Memory Validator from Software Verification Limited can help you, it has allocations view, objects view, generations view, etc. It's not free but you can use the evaluation version to check your coworker's code. They also have a Performance and Coverage Validators...

like image 31
Christian C. Salvadó Avatar answered Oct 08 '22 03:10

Christian C. Salvadó