Very high virtual memory usage in the WebExtensions process on Linux
Categories
(Core :: Javascript: WebAssembly, defect, P3)
Tracking
()
People
(Reporter: eleius, Unassigned)
References
Details
(Whiteboard: [MemShrink])
Attachments
(1 file)
|
65.08 KB,
application/gzip
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Steps to reproduce:
As soon I start Firefox v73 64bit on my Linux system, the htop utility reports 32.4 GB VIRTUAL memory usage and 221 RES. After a couple of seconds, usage is "lowered" to 26.4 GB VIRT and 158 MB RES.
This is with no tabs open, but I have a dozen extensions installed, each of which only uses between 0.4 to 1.4 mb according to about:performance
This issue has been reported years ago by other users at https://bugzilla.redhat.com/show_bug.cgi?id=1288888 but no solution has been given.
Also note, as reported above, that not all instances report high virtual memory usage (only those with the "-childID 2" parameter, but not other childIDs).
| Reporter | ||
Comment 1•1 year ago
|
||
(Please disregard the User Agent reported above, I'm using a different pc for this bug report.)
Comment 2•1 year ago
|
||
Please enter the address
about:memory?verbose
in the address bar and attach (using the "Attach File" link above) the output here.
| Reporter | ||
Comment 3•1 year ago
|
||
| Reporter | ||
Comment 4•1 year ago
|
||
Let me know if you need other information.
Comment 5•1 year ago
|
||
Hi Daniel,
You mention you can reproduce this issue even with no tabs opened (but mention you have several add-ons installed), have you tried safe mode? (add-ons disabled). Here is a link that can help you do that:
https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode
Also, try this on the latest version of nightly. You can download it from here: https://nightly.mozilla.org/
I will move this over to a component so developers can take a look over it. If is not the correct component please feel free to change it to an appropriate one.
Thanks for the report.
Best regards, Clara.
| Reporter | ||
Comment 6•1 year ago
|
||
Ok, with safe mode (latest Firefox version) I have much better values: 2589 MB VIRT, 236 MB RES, 120 MB SHR. I have also tried disabling (and reenabling) my addons one by one but VIRT stays around 26-30 GB.
Updated•1 year ago
|
Comment 7•1 year ago
|
||
Maybe an extensions bug?
Comment 8•1 year ago
|
||
Daniel did you start to have this problem with Firefox v73 onwards?
You can capture a performance profile using the Cleopatra add-on. You can get more info on how to install and use the Cleopatra add-on (that helps you get the performance profile) by going to:
https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler
https://perf-html.io/
Please also note that this add-on works only on FF Nightly.
Best,
Clara
| Reporter | ||
Comment 9•1 year ago
|
||
Clara, I can't remember when I first noticed this, but I still have this issue with Firefox v75 (on Linux). Judging from the other bug report I linked in my first comment, the problem is there at least from 2015.
I'll see if i can capture a performance profile with my current Firefox, as I don't have time for a new install and readding the extensions.
Comment 10•1 year ago
|
||
I think VIRT memory on linux is not actually "committed" memory, so this is not actually "using" anything outrageous. Andrew, can you please explain the numbers we're looking at here?
Comment 11•1 year ago
|
||
I'm seeing this in the memory report: 2,697.16 MB ── vsize
I think this includes a lot of memory that is shared between processes, but I don't know how much exactly it is on Linux. The resident numbers look pretty low.
Eric, do you know anything about super high vsize numbers on Linux and whether they're an issue or not?
Comment 12•1 year ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #11)
I'm seeing this in the memory report: 2,697.16 MB ── vsize
I think this includes a lot of memory that is shared between processes, but I don't know how much exactly it is on Linux. The resident numbers look pretty low.
Eric, do you know anything about super high vsize numbers on Linux and whether they're an issue or not?
2.7GB for the main process isn't outrageous. The main concern here is the 27GB in the web extension process:
27,051.25 MB ── vsize
My nightly on Ubuntu 18.04 is seeing similar behavior.
On a 64-bit build it's not a huge issue, but it probably indicates we're doing something bad in the web extension process. It could cause issues for anyone who is enforcing commit limits or trying to support suspend/resume. It could also indicate we're leaking mappings which will eventually cause ooms. A linux expert might know more about the expectations here and how to dig into this further. Maybe jld or kmag?
Comment 13•1 year ago
•
|
||
Looking locally I'm seeing 4 x 6GB anon mappings with no permissions:
erahm@shetland:/var/dev/erahm/mozilla-unified$ pmap 10493 | grep '62.*K'
00007fa3f3220000 6291328K ----- [ anon ]
00007fa57357e000 6289792K ----- [ anon ]
00007fa6f345f000 6291008K ----- [ anon ]
00007fa873510000 6290368K ----- [ anon ]
Seems likely these are wasm guard pages, it's odd they're not being reported. For example loading wasm by example I see:
6,441,402,368 B ── wasm-guard-pages
6,441,402,368 / 1024 = 6290432K which looks about right.
Comment 14•1 year ago
|
||
Nice! Maybe the extension process runs wasm at some point, then stops running it, and we end up with the pages still mapped, but whatever the memory reporter is has gone away, so nothing reports it?
Comment 15•1 year ago
|
||
It looks like the wasm guard page size is only reported if there are WASM ArrayBufferObjects.
Comment 16•1 year ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #14)
Nice! Maybe the extension process runs wasm at some point, then stops running it, and we end up with the pages still mapped, but whatever the memory reporter is has gone away, so nothing reports it?
Is that a leak then, or to be expected? And if so, is it memory reporter bug?
Comment 17•1 year ago
|
||
(In reply to Tomislav Jovanovic :zombie from comment #16)
Is that a leak then, or to be expected? And if so, is it memory reporter bug?
It seems like maybe the WASM ArrayBufferObjects are going away without removing the guard pages. I wouldn't think that would be the way it is supposed to work, but I don't know. Maybe we could find a WASM person to investigate this a bit.
Comment 18•1 year ago
|
||
This looks like a WASM issue, please forward if there's a more appropriate place.
| Reporter | ||
Updated•1 year ago
|
Updated•1 year ago
|
The severity field is not set for this bug.
:lth, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•1 year ago
|
Comment 20•1 year ago
|
||
For something that dates to 2015, it predates most wasm work: js/src/wasm was created in November 2016, and experimental wasm implementations started appearing in browsers in 2016 according to WebAssembly.org (https://webassembly.org/roadmap/, bottom).
So more likely than not this is an asm.js problem. Of course, as we compile asm.js to wasm it's also a wasm problem, but there are some distinct code paths in the engine for asm.js still.
Updated•11 months ago
|
Comment 21•9 months ago
|
||
I'm having this "issue?" on firefox 79, 27.1g of virt memory use by WebExtensions. Fedora 32, kernel 5.7
Comment 22•5 months ago
|
||
(In reply to Eric Rahm [:erahm] from comment #13)
Looking locally I'm seeing 4 x 6GB anon mappings with no permissions:
erahm@shetland:/var/dev/erahm/mozilla-unified$ pmap 10493 | grep '62.*K' 00007fa3f3220000 6291328K ----- [ anon ] 00007fa57357e000 6289792K ----- [ anon ] 00007fa6f345f000 6291008K ----- [ anon ] 00007fa873510000 6290368K ----- [ anon ]Seems likely these are wasm guard pages, it's odd they're not being reported. For example loading wasm by example I see:
6,441,402,368 B ── wasm-guard-pages
6,441,402,368 / 1024 = 6290432K which looks about right.
Yup, can confirm these anon wasm mappings. Here: Ubuntu 18.04, FF 83.0
Description
•