Closed Bug 762875 Opened 13 years ago Closed 13 years ago

https-everywhere strange memory usage

Categories

(WebExtensions :: General, defect)

x86
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: wanderpost, Unassigned)

Details

(Whiteboard: [MemShrink:P3])

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/16.0 Firefox/16.0a1 Build ID: 20120607025755 Steps to reproduce: 1. Created an empty profile 2. Installed HTTPS-everywhere 3 (dev 3) 3. Opened up about:memory Actual results: It shows about 43%(!!! == 33,39MB) of all js memory in use by https-everywhere about half of which is gc-heap -> arena -> unused Expected results: I don't think https-everywhere should use anywhere near this amount of memory. And surely the amount of unused memory in arena is suspicious.
Whiteboard: [MemShrink]
I just confirmed that it is the same albeit with a smaller footprint in the current stable version of HTTPS-everywhere. (see second attachment) The size of the compartment seems to be about half, but of that size is still about half claimed to be in unused arena space.
Component: Untriaged → Extension Compatibility
QA Contact: untriaged → extension.compatibility
On my home PC https-everywhere enabled causes Firefox to use close to 400mb according to task manager, before first draw! With it disabled its normally around 240-260mbs. About:memory loading as an app tab tells me its using 45+ Mb, with most of it unused as well. This is on the latest dev version.
On my home PC https-everywhere enabled causes Firefox to use close to 400mb according to task manager, before first draw! And takes 10+ seconds to load first draw at times. With it disabled its normally around 240-260mbs and noticeably faster at loading. About:memory loading as an app tab tells me its using 45+ Mb, with most of it unused as well. This is on the latest dev version. I will post an about:memory and do testing when I get home.
Component: Extension Compatibility → Add-ons
Product: Firefox → Tech Evangelism
QA Contact: extension.compatibility → addons
Whiteboard: [MemShrink] → [MemShrink:P3]
Version: 16 Branch → unspecified
Heres my about:memory shortly after startup - it is the biggest compartment at all times. 35,191,824 B (15.72%) -- compartment([System Principal], file:///C:/Users/xxxxxxx/AppData/Roaming/Mozilla/Firefox/Profiles/xxxxxxx.default/extensions/https-everywhere@eff.org/components/https-everywhere.js) │ │ ├──34,349,056 B (15.34%) -- gc-heap │ │ │ ├──18,582,160 B (08.30%) -- arena │ │ │ │ ├──18,325,072 B (08.19%) ── unused │ │ │ │ ├─────134,176 B (00.06%) ── headers │ │ │ │ └─────122,912 B (00.05%) ── padding │ │ │ ├───7,683,328 B (03.43%) -- objects │ │ │ │ ├──7,657,648 B (03.42%) ── non-function │ │ │ │ └─────25,680 B (00.01%) ── function │ │ │ ├───7,509,112 B (03.35%) ── xml │ │ │ ├─────449,608 B (00.20%) -- shapes │ │ │ │ ├──408,120 B (00.18%) ── dict │ │ │ │ ├───32,112 B (00.01%) ── tree │ │ │ │ └────9,376 B (00.00%) ── base │ │ │ ├─────104,272 B (00.05%) ── strings │ │ │ ├──────18,432 B (00.01%) ── scripts │ │ │ └───────2,144 B (00.00%) ── sundries │ │ ├─────483,392 B (00.22%) -- objects │ │ │ ├──416,128 B (00.19%) ── slots │ │ │ └───67,264 B (00.03%) ── elements │ │ ├─────147,328 B (00.07%) -- shapes-extra │ │ │ ├──134,016 B (00.06%) ── dict-tables │ │ │ └───13,312 B (00.01%) ── compartment-tables │ │ ├─────131,072 B (00.06%) ── analysis-temporary │ │ ├──────62,592 B (00.03%) ── script-data │ │ └──────18,384 B (00.01%) ── other-sundries
And this is my about:memory set to load on startup as app tab (sorry for the spam guys, I had to restart browser to get this one): 323,654,762 B (100.0%) -- explicit ├──224,650,722 B (69.41%) -- js │ ├───47,584,128 B (14.70%) -- compartment([System Principal], file:///C:/Users/xxxxxx/AppData/Roaming/Mozilla/Firefox/Profiles/xxxxxxxxx.default/extensions/https-everywhere@eff.org/components/https-everywhere.js) │ │ ├──36,560,896 B (11.30%) -- gc-heap │ │ │ ├──18,009,784 B (05.56%) ── xml │ │ │ ├──15,795,536 B (04.88%) -- objects │ │ │ │ ├──15,760,416 B (04.87%) ── non-function │ │ │ │ └──────35,120 B (00.01%) ── function │ │ │ ├───1,939,920 B (00.60%) ── strings │ │ │ ├─────486,656 B (00.15%) -- shapes │ │ │ │ ├──410,712 B (00.13%) ── dict │ │ │ │ ├───57,288 B (00.02%) ── tree │ │ │ │ └───18,656 B (00.01%) ── base │ │ │ ├─────304,168 B (00.09%) -- arena │ │ │ │ ├──142,816 B (00.04%) ── headers │ │ │ │ ├──125,624 B (00.04%) ── padding │ │ │ │ └───35,728 B (00.01%) ── unused │ │ │ ├──────19,392 B (00.01%) ── scripts │ │ │ └───────5,440 B (00.00%) ── sundries │ │ ├───9,895,168 B (03.06%) ── string-chars │ │ ├─────485,888 B (00.15%) -- objects │ │ │ ├──418,624 B (00.13%) ── slots │ │ │ └───67,264 B (00.02%) ── elements │ │ ├─────393,216 B (00.12%) ── analysis-temporary │ │ ├─────156,640 B (00.05%) -- shapes-extra │ │ │ ├──134,112 B (00.04%) ── dict-tables │ │ │ └───22,528 B (00.01%) ── compartment-tables │ │ ├──────73,648 B (00.02%) ── script-data │ │ └──────18,672 B (00.01%) ── other-sundries Disabled, I don't get much on startup: 219,432,632 B (100.0%) -- explicit ├──169,330,378 B (77.17%) -- js
For me, the difference between explicit allocations between a clean start with HTTPS Everywhere and without is about 7MB: 67.15 MB (100.0%) -- explicit ├──33.85 MB (50.42%) -- js ├──20.64 MB (30.74%) ── heap-unclassified ├───4.96 MB (07.39%) -- storage ├───4.86 MB (07.24%) -- window-objects ├───1.23 MB (01.83%) ── xpti-working-set └───0.69 MB (01.03%) -- startup-cache 74.65 MB (100.0%) -- explicit ├──53.46 MB (71.61%) -- js ├──13.26 MB (17.76%) ── heap-unclassified ├───3.31 MB (04.44%) -- window-objects ├───2.25 MB (03.02%) -- storage ├───1.23 MB (01.65%) ── xpti-working-set └───1.14 MB (01.53%) ++ (6 tiny) Though the smaller heap-unclassified in the second test probably means it's closer to 14MB. After some usage, that unfortunately becomes a more dramatic 50MB more of explicit allocations, but it doesn't seem to grow much once it hits that point: Main Process Explicit Allocations 116.01 MB (100.0%) -- explicit ├───72.94 MB (62.88%) -- js │ ├──36.38 MB (31.36%) -- compartment([System Principal], 0x2aabdaa15000) │ │ ├──29.59 MB (25.51%) -- gc-heap │ │ │ ├──13.27 MB (11.44%) -- arena │ │ │ │ ├──12.70 MB (10.95%) ── unused │ │ │ │ └───0.56 MB (00.49%) ++ (2 tiny) │ │ │ ├───6.74 MB (05.81%) -- objects │ │ │ │ ├──4.44 MB (03.83%) ── non-function │ │ │ │ └──2.30 MB (01.98%) ── function │ │ │ ├───4.12 MB (03.55%) ── xml │ │ │ ├───3.44 MB (02.96%) -- shapes │ │ │ │ ├──1.76 MB (01.51%) ── tree │ │ │ │ └──1.68 MB (01.45%) ++ (2 tiny) │ │ │ ├───1.52 MB (01.31%) ── scripts │ │ │ └───0.51 MB (00.44%) ++ (2 tiny) │ │ ├───2.47 MB (02.13%) ++ shapes-extra │ │ ├───2.46 MB (02.12%) ── script-data │ │ └───1.86 MB (01.61%) ++ (5 tiny) │ ├──23.53 MB (20.28%) ── gc-heap-decommitted │ ├───6.77 MB (05.84%) -- runtime │ │ ├──4.00 MB (03.45%) ── stack-committed │ │ ├──2.00 MB (01.72%) ── atoms-table │ │ └──0.77 MB (00.67%) ++ (6 tiny) │ ├───3.63 MB (03.13%) -- compartment(atoms) │ │ ├──2.43 MB (02.09%) -- gc-heap │ │ │ ├──2.22 MB (01.91%) ── strings │ │ │ └──0.21 MB (00.18%) ++ arena │ │ └──1.20 MB (01.04%) ── string-chars │ └───2.63 MB (02.27%) ++ (9 tiny) ├───29.88 MB (25.76%) ── heap-unclassified ├────6.19 MB (05.33%) -- storage │ ├──5.83 MB (05.03%) -- sqlite │ │ ├──2.47 MB (02.13%) -- places.sqlite │ │ │ ├──2.18 MB (01.88%) ── cache-used [3] │ │ │ └──0.30 MB (00.26%) ++ (2 tiny) │ │ ├──2.05 MB (01.77%) ++ (10 tiny) │ │ └──1.31 MB (01.12%) ── other │ └──0.36 MB (00.31%) ++ prefixset ├────4.32 MB (03.73%) -- window-objects │ └──4.32 MB (03.73%) -- active │ ├──2.17 MB (01.87%) -- top=1 (inner=2) │ │ ├──2.16 MB (01.86%) -- inner-window(id=2, uri=chrome://browser/content/browser.xul) │ │ │ ├──1.28 MB (01.10%) ++ layout │ │ │ └──0.88 MB (00.76%) ++ (2 tiny) │ │ └──0.01 MB (00.01%) ++ (2 tiny) │ └──2.15 MB (01.86%) ++ (7 tiny) ├────1.45 MB (01.25%) ++ (8 tiny) └────1.23 MB (01.06%) ── xpti-working-set Other Measurements 0.00 MB ── canvas-2d-pixel-bytes 116.02 MB ── explicit 0.08 MB ── gfx-surface-image 0.29 MB ── gfx-surface-xlib 54.11 MB ── heap-allocated 69.56 MB ── heap-committed 22.22% ── heap-committed-fragmentation 3.03 MB ── heap-dirty 45.89 MB ── heap-unallocated 0.00 MB ── images-content-used-uncompressed 5 ── js-compartments-system 5 ── js-compartments-user 57.00 MB ── js-gc-heap 0.13 MB ── js-main-runtime-analysis-temporary 13.18 MB ── js-main-runtime-gc-heap-arena-unused 0.00 MB ── js-main-runtime-gc-heap-chunk-clean-unused 0.00 MB ── js-main-runtime-gc-heap-chunk-dirty-unused 23.53 MB ── js-main-runtime-gc-heap-decommitted 64.41% ── js-main-runtime-gc-heap-unused-fraction 0.33 MB ── js-main-runtime-mjit 7.96 MB ── js-main-runtime-objects 4.00 MB ── js-main-runtime-scripts 5.88 MB ── js-main-runtime-shapes 4.12 MB ── js-main-runtime-strings 0.14 MB ── js-main-runtime-type-inference 12 ── page-faults-hard 347,140 ── page-faults-soft 146.00 MB ── resident 5.83 MB ── storage-sqlite 697.67 MB ── vsize 0.54 MB ── window-objects-dom 1.60 MB ── window-objects-layout-arenas 1.53 MB ── window-objects-layout-style-sets 0.00 MB ── window-objects-layout-text-runs 0.65 MB ── window-objects-style-sheets Main Process Explicit Allocations 64.29 MB (100.0%) -- explicit ├──30.27 MB (47.09%) -- js │ ├──14.12 MB (21.97%) -- compartment([System Principal], 0x2b3372215000) │ │ ├───8.95 MB (13.92%) -- gc-heap │ │ │ ├──2.56 MB (03.97%) -- objects │ │ │ │ ├──1.89 MB (02.94%) ── function │ │ │ │ └──0.66 MB (01.03%) ── non-function │ │ │ ├──2.47 MB (03.84%) -- arena │ │ │ │ ├──2.31 MB (03.59%) ── unused │ │ │ │ └──0.16 MB (00.25%) ++ (2 tiny) │ │ │ ├──2.40 MB (03.73%) -- shapes │ │ │ │ ├──1.47 MB (02.29%) ── tree │ │ │ │ └──0.92 MB (01.44%) ++ (2 tiny) │ │ │ ├──1.28 MB (01.98%) ── scripts │ │ │ └──0.26 MB (00.40%) ++ (3 tiny) │ │ ├───2.10 MB (03.27%) ── script-data │ │ ├───1.89 MB (02.94%) -- shapes-extra │ │ │ ├──0.78 MB (01.22%) ── tree-tables │ │ │ ├──0.75 MB (01.17%) ── compartment-tables │ │ │ └──0.35 MB (00.55%) ++ (2 tiny) │ │ └───1.18 MB (01.84%) ++ (5 tiny) │ ├───6.73 MB (10.47%) ── gc-heap-decommitted │ ├───5.76 MB (08.95%) -- runtime │ │ ├──4.00 MB (06.22%) ── stack-committed │ │ ├──1.00 MB (01.56%) ── atoms-table │ │ └──0.76 MB (01.18%) ++ (6 tiny) │ ├───1.87 MB (02.91%) -- compartment(atoms) │ │ ├──1.54 MB (02.39%) -- gc-heap │ │ │ ├──1.30 MB (02.02%) ── strings │ │ │ └──0.24 MB (00.37%) ++ arena │ │ └──0.34 MB (00.53%) ── string-chars │ ├───0.90 MB (01.40%) ── xpconnect │ └───0.89 MB (01.38%) ++ (8 tiny) ├──21.69 MB (33.74%) ── heap-unclassified ├───6.13 MB (09.54%) -- storage │ ├──5.78 MB (08.99%) -- sqlite │ │ ├──2.41 MB (03.75%) -- places.sqlite │ │ │ ├──2.11 MB (03.29%) ── cache-used [3] │ │ │ └──0.30 MB (00.46%) ++ (2 tiny) │ │ ├──2.03 MB (03.16%) ++ (10 tiny) │ │ └──1.34 MB (02.08%) ── other │ └──0.36 MB (00.55%) ++ prefixset ├───3.25 MB (05.06%) -- window-objects │ └──3.25 MB (05.06%) -- active │ ├──2.10 MB (03.27%) -- top=1 (inner=2) │ │ ├──2.10 MB (03.26%) -- inner-window(id=2, uri=chrome://browser/content/browser.xul) │ │ │ ├──1.24 MB (01.93%) -- layout │ │ │ │ ├──0.79 MB (01.23%) ── arenas │ │ │ │ └──0.45 MB (00.71%) ── style-sets │ │ │ └──0.86 MB (01.33%) ++ (2 tiny) │ │ └──0.01 MB (00.01%) ++ (2 tiny) │ └──1.15 MB (01.78%) ++ (6 tiny) ├───1.23 MB (01.91%) ── xpti-working-set ├───1.00 MB (01.56%) ++ (7 tiny) └───0.71 MB (01.10%) -- startup-cache ├──0.71 MB (01.10%) ── data └──0.00 MB (00.00%) ── mapping Other Measurements 0.00 MB ── canvas-2d-pixel-bytes 64.29 MB ── explicit 0.05 MB ── gfx-surface-image 0.16 MB ── gfx-surface-xlib 41.73 MB ── heap-allocated 56.73 MB ── heap-committed 26.43% ── heap-committed-fragmentation 3.36 MB ── heap-dirty 53.27 MB ── heap-unallocated 0.00 MB ── images-content-used-uncompressed 5 ── js-compartments-system 4 ── js-compartments-user 18.00 MB ── js-gc-heap 0.13 MB ── js-main-runtime-analysis-temporary 2.79 MB ── js-main-runtime-gc-heap-arena-unused 0.00 MB ── js-main-runtime-gc-heap-chunk-clean-unused 0.00 MB ── js-main-runtime-gc-heap-chunk-dirty-unused 6.73 MB ── js-main-runtime-gc-heap-decommitted 52.91% ── js-main-runtime-gc-heap-unused-fraction 0.33 MB ── js-main-runtime-mjit 3.29 MB ── js-main-runtime-objects 3.40 MB ── js-main-runtime-scripts 4.26 MB ── js-main-runtime-shapes 1.77 MB ── js-main-runtime-strings 0.12 MB ── js-main-runtime-type-inference 15 ── page-faults-hard 450,410 ── page-faults-soft 110.96 MB ── resident 5.78 MB ── storage-sqlite 668.33 MB ── vsize 0.42 MB ── window-objects-dom 1.16 MB ── window-objects-layout-arenas 1.18 MB ── window-objects-layout-style-sets 0.00 MB ── window-objects-layout-text-runs 0.49 MB ── window-objects-style-sheets That's more than I'd like it to be given the nature of the add-on, but it's not entirely out of order, so I'm closing this as worksforme.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
Just one more question before this disappears: from your log (After usage): │ ├──36.38 MB (31.36%) -- compartment([System Principal], 0x2aabdaa15000) │ │ ├──29.59 MB (25.51%) -- gc-heap │ │ │ ├──13.27 MB (11.44%) -- arena │ │ │ │ ├──12.70 MB (10.95%) ── unused And you don't think that that is a little bit peculiar? I'm not blaming the add-on only, ie the fact that (a little more than) one third of all the memory used by the add-on is in arena->unused (>12MB) which is about 10% of overal (explicit/RSS) memory usage in that instance is not a bit over the top? Its just not ok for me, I like the functionality it brings and I have already looked at the source and maybe a pointer into for example of an improved allocation or load scheme for HTTPS-everywhere would be very useful. (Info the add-on loads rules from a load of xml-files (about one for every rule I believe))
It's 10% of a relatively small Firefox process. It isn't consistently 10% as the Firefox process grows. And we're talking about unused heap space here. It's not lost memory, there's not a lot the add-on can do about it, and there's already work (quite a lot of work) underway to reduce heap fragmentation Spidermonkey-side. If someone wants to work on HTTPS Everywhere to try to improve this, I think it's great, but I don't consider it a significant enough issue to merit a bug here.
Ok thanks for the reasoning! I will move the discussing to the HTTPS-Everywhere bug tracker (https://trac.torproject.org/projects/tor/ticket/4804 and https://trac.torproject.org/projects/tor/ticket/6118)
This is fixed on HTTPS-everywhere 3.0dev4. its using around 6mb rather then the 50-60odd.
Excellent. Do you know what changes resulted in the reduced memory usage?
Component: Add-ons → General
Product: Tech Evangelism → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: