inYOf4ceBook

By znerp Last update Nov 9, 2010 — Installed 138,907 times.

Memory Leak?

in
Subscribe to Memory Leak? 6 posts, 4 voices



bugmenot2009 Scriptwright
FirefoxWindows

Hi, I've been using this script for a long time but recently I have been experiencing a memory leak when I leave a tab with facebook open. If I deactivate the script and change nothing else I experience no leak.

I'm using:
-Firefox 3.5.3
-Greasemonkey 0.8.20090920.2
-AdBlock Plus 1.1.1

I have no other greasemonkey scripts for facebook.

(This is a public userscripts account from bugmenot, so don't PM me if you have any questions about my setup, just post them here and I'll check back)

 
yanksoccer117 Scriptwright
ChromeMacintosh

I am seeing this same issue. Memory usage seems to grow steadily as long as the tab is open, even without any activity. I am trying to see which part of the code is causing this and will post back if I find anything.

Edit: Commenting out the setInterval function at the bottom of the code and instead only calling process(); once seems to stop the memory leak for me. I am guessing this kills some amount of functionality, but in general for most uses the script seemed to still be working fine. Until there is an update, I'd suggest doing this.

 
bugmenot2009 Scriptwright
FirefoxWindows

Thanks yank, appreciate it.

 
Andrew Wright User
FirefoxWindows

Same problem here!

And it being called on an interval (as setInterval would suggest) also concurs with my observations that there are lots of CPU usage spikes in my Process Explorer graphs!

I love this script, so I hope it is fixed soon...

 
Andrew Wright User
FirefoxWindows

I can confirm yanksoccer117's suggestion works. The BOTTOM section of code needs commenting out like so:

// Wait for Facebook's content element to exist
if (self.location == top.location) 
  // var checker=setInterval(function(){
    // if(document.getElementById('content')) {
      // clearInterval(checker);
      process(); // Start the listener
    // }
  // }, 200);

I simple terms, comment out every line except the if statement and process() from the bottom code block!

 
znerp Script's Author
FirefoxWindows

Ok, I've had a look and I believe the change I've just made should make it much, much better to use in this way.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel