0

I wrote a Firefox extension where I open one window at a time, and close it after processing the web page in that window. However, I need to do this many times repeatedly. And after I ran my extension, Firefox was consuming way to much memory too quickly.

Here's a brief overview of how it's done

  • window A open
  • (processing in window A)
  • window B open
  • window A closed
  • (precessing in window B)
  • window A open
  • window B closed
  • (processing in window A)
  • ...

And at each time point there are only at most 4 windows open.

The way I'm doing it is using JS events to open and close windows.

Is this some issue with Firefox's memory management and garbage collection for Firefox's JS engine?

Tianyang Li
  • 1,755
  • 5
  • 26
  • 42

1 Answers1

1

It sounds like normal GC operation and would likely also happen in any browser.

Does the situation improve if you call Components.utils.forceGC() after closing each window.

Mike Ratcliffe
  • 989
  • 6
  • 10
  • Thanks a lot! I also had to remove Firebug as suggested [here](http://stackoverflow.com/questions/200822/how-do-i-track-and-debug-javascript-memory-leaks-in-firefox). Now it doesn't eat all of my memory. – Tianyang Li Oct 19 '13 at 23:19