I wrote an extension it's mainly JS with with C++ XPCOM Object. It is fairly complex and long and I believe I have lots of memory leaks (using tools it shows leaks)
I'm lost.. :(
I just cannot find an easy, strait forward tool that can show me where my leaks generate from.
I did the following: read - https://wiki.mozilla.org/Performance:Leak_Tools read various other articles on memory leaks. used - leak monitor plugin and leak guague (both show leaks).
How can I trace what causes the leaks in my js code? Is there some tool that can do this easily? Is there an article that explains how to do it very strait forward? Do I need to run FireFox Debug build? do I need to re-build firefox?
Please direct me as I'm completely l开发者_C百科ost :(
Thanks! D.
The Firefox Memory Leak addon should tell you where it's leaking memory, no debug-build required.
I haven't worked with C++ in Firefox addons, but you might check your code with valgrind or another memory leak detector. Javascript can also cause memory problems, for example, using registerListener for a Firefox window without adding window.addEventListener("unload", function() {unregisterListener}) will cause a memory leak.
精彩评论