Closed Bug 1799376 Opened 3 years ago Closed 2 years ago

Memory leak after change network connection

Categories

(DevTools :: Netmonitor, defect)

Firefox 107
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: dxzlabs, Unassigned)

Details

Attachments

(2 files)

Attached image Screenshot_120.png

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101 Firefox/107.0

Steps to reproduce:

Play something on site, for example https://rezka.ag/series/drama/7769-luchshe-zvonite-solu-2015.html#t:1-s:3-e:5
Change connection, connect to wireguard vpn
Playback will be interrupted, open developer console, in Network tab there will be connection errors
Firefox will endlessly try to connect until it eats up all the memory

Actual results:

There will be no free memory left, the system will hang, or the systemd OOM killer will not terminate the process

Expected results:

Firefox should not eat up all available memory

It looks like all the memory is being eaten up due to an infinite number of connection errors

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

Do you mind to use Firefox profiler to capture this issue?

Eg.

  1. Go Firefox profiler and enable that
  2. Click the profiler icon, and choose media in the drop down menu
  3. Start recording via the profiler
  4. Start reproducing what you said in the comment0
  5. After the issue happens, stop capturing (which will pop out a new result page)
  6. In the result page, click upload the local result and make sure all "Include xxx" are clicked.

Thanks!

Flags: needinfo?(dxzlabs)

Also, would you mind to use about:memory to measure the memory usage when the issue is happening? Thanks!

Attached file memory-report.json.gz

I tried to record with firefox profiler, but firefox was eating up memory so fast that my pc crashed for a moment and profiler.firefox.com wrote "Tab crashed". When trying to restore, he loaded the report again, but the tab also fell. It looks like 16 GB is not enough, I will increase the swap to 32 GB and try again.

about:memory attach memory-report.json.gz

This doesn't look like a media issue, it didn't look like any media was playing at that time, and the RDD process was using very few memory.

In the process of pid 23037, I see the memory peak usage is 7,656.57 MB. In the explicit allocation, most of them are in js-non-window. It seems many memory were eaten by JS runtime, but I am not sure how to do a further investigation.

Nika, do you know who is the right person to take this issue a look? Thank you.

Component: Audio/Video: Playback → DOM: Networking
Flags: needinfo?(nika)

From a quick scan of the report, a significant fraction of the js-non-window memory usage seems to be coming from devtools globals, such as the devtools toolbox or devtools module loader. This might be one of the devtools issues where things like network activity effectively cause memory leaks when devtools is open, as we track all network activity, keeping around the buffers indefinitely. The large devtools globals continues in the first content process as well, making this seem likely.

Redirecting to devtools (I'm guessing specifically netmonitor, given that this is caused by observing failed connections in the devtools toolbox until memory is exhausted) in case they can comment more.

Component: DOM: Networking → Netmonitor
Flags: needinfo?(nika)
Product: Core → DevTools

A needinfo is requested from the reporter, however, the reporter is inactive on Bugzilla. Given that the bug is still UNCONFIRMED, closing the bug as incomplete.

For more information, please visit BugBot documentation.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(dxzlabs)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: