LooPer
LooPer

Reputation: 1479

Firefox content script memory consumption

I am developing one extension for Firefox using addon-sdk. That extension opens one tab and load one web page which is updated each N minutes. This web page is processed using one content script. The problem is that memory grows each time the content script gets executed. Do you know why? Is there any way to call any garbage collector in order to maintain memory consuption stable?

EDIT: The web page contains bank account details and the Content Scripts look for new movements on in. It is a framed page and one of its frames (which contains movements list) is reloaded to see if any change occured. I use jquery to proccess the list. When new movements appear, those are sent to the extension using port and the extension saves them in a remote web server using Response.

Upvotes: 0

Views: 328

Answers (1)

StiveKnx
StiveKnx

Reputation: 320

Trying check this instructions by mozilla:

https://developer.mozilla.org/en/XUL_School/JavaScript_Object_Management https://developer.mozilla.org/en/Zombie_Compartments#Proactive_checking_of_add-ons

Depends on what are you using on your add-on... If you're using some oberserver for example, you need to unregister this observer so it won't leak... Can you give more descriptions about your addon? The code or exactly what it does... Maybe you're not declaring variabled and you're using globals all the time, try also unset the variable after use it.

Are you using jquery?

Upvotes: 0

Related Questions