disconnectme / disconnect

Disconnect is a browser extension that makes the web faster, more private, and more secure.
https://disconnect.me/
GNU General Public License v3.0
781 stars 136 forks source link

D. prevents collection of leaked memory on firefox popup windows #277

Open ghost opened 10 years ago

ghost commented 10 years ago

There was an issue a while back with firefox itself where gc/cc would not free memory when browsing pages which produce a lot of popup windows. This was resolved however. (https://bugzilla.mozilla.org/show_bug.cgi?id=822162)

I regularly build up on memory usage up to 1GB and most of it is detached windows and closed popups. On an empty firefox profile this memory is cleared after 15-30 seconds. As soon as I activate disconnect.me this memory is never cleared and keeps building up.

Steps to reproduce:

  1. Use fresh firefox profile and open about:memory
  2. Surf to https://bug822162.bugzilla.mozilla.org/attachment.cgi?id=692824
  3. open and close some popups, measure memory usage immediately -> 474.06 MB (100.0%) -- explicit ├──203.70 MB (42.97%) -- window-objects │ ├───60.24 MB (12.71%) -- top(none)/detached │ │ ├──59.59 MB (12.57%) -- window([system]) │ │ │ ├──59.12 MB (12.47%) -- js-compartment([System Principal], about:blank) │ │ │ │ ├──23.11 MB (04.88%) -- shapes │ │ │ │ │ ├──15.24 MB (03.22%) -- gc-heap │ │ │ │ │ │ ├───6.34 MB (01.34%) ── dict [21] │ │ │ │ │ │ ├───5.52 MB (01.16%) -- tree │ │ │ │ │ │ │ ├──4.86 MB (01.03%) ── global-parented [21] │ │ │ │ │ │ │ └──0.65 MB (00.14%) ── non-global-parented [21] │ │ │ │ │ │ └───3.38 MB (00.71%) ── base [21] │ │ │ │ │ └───7.87 MB (01.66%) ++ malloc-heap │ │ │ │ ├──19.30 MB (04.07%) -- objects │ │ │ │ │ ├──16.65 MB (03.51%) -- gc-heap │ │ │ │ │ │ ├──11.60 MB (02.45%) ── function [21] │ │ │ │ │ │ ├───4.89 MB (01.03%) ── ordinary [21] │ │ │ │ │ │ └───0.17 MB (00.03%) ── dense-array [21] │ │ │ │ │ └───2.65 MB (00.56%) ++ (2 tiny) │ │ │ │ ├──16.16 MB (03.41%) -- scripts │ │ │ │ │ ├──13.22 MB (02.79%) ── gc-heap [21] │ │ │ │ │ └───2.94 MB (00.62%) ── malloc-heap/data [21] │ │ │ │ └───0.55 MB (00.12%) ++ (2 tiny) │ │ │ └───0.47 MB (00.10%) ++ dom │ │ └───0.65 MB (00.14%) ++ (5 tiny) │ ├───43.65 MB (09.21%) ++ top(https://github.com/disconnectme/disconnect/issues/new, id=239)
  4. Wait 20-30 seconds and re-measure memory usage
  5. Memory from detached tabs is cleared

Expected behavior: see above

what happens with disconnect.me installed: only small portions of memory are cleared, the rest builds up and slows firefox ui down.

Tested on Firefox 26.0 Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0 3.12-1-amd64 #1 SMP Debian 3.12.9-1 (2014-02-01) x86_64 GNU/Linux