Closed Bug 1598309 Opened 5 years ago Closed 4 years ago

Memory usage only grows over time

Categories

(DevTools :: Debugger, defect, P3)

70 Branch
defect

Tracking

(firefox77 fixed)

RESOLVED FIXED
Firefox 77
Tracking Status
firefox77 --- fixed

People

(Reporter: guillaume1.gomez, Assigned: loganfsmyth)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Attached file memory-report.json.gz

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

Steps to reproduce:

Nothing particular really. I keep the same tabs open and open one from time to time to make a google search but the number remains under 30. The issue is that firefox's memory usage keeps growing over time and the memory cleanup (about:memory tools) doesn't change it.

The surprising thing is that about:performance is telling me that my tabs are using less than 1Go of RAM whereas htop is telling me that firefox is using 40% (~8Go). The only way to clean the ram usage is to restart firefox.

Actual results:

Memory usage only growing over time.

Expected results:

The memory usage should remain around the same or at least getting reduced when memory clean is performed.

Worth noting that the reporter is using the devtools to work on qwant maps locally.

In the first report there is a 2Go ArrayBuffer in the parent process that looks like the wasm heap of source-map handler.
There's also quite a large number of fairly big strings coming from dev tools that seem to be the source code of what the reporter was working on (qwant maps). Some of these strings are reportedly copied a lot of times, amounting to 1.2 Go of strings if I read the report correctly.

I don't know if these are reasonable numbers (depends on the size of the code that is being loaded I suppose) but they amount to about 4Go of RAM allocated by the devtools so it's worth taking a look.

Hi guillaume1.gomez,

Thanks for submitting this bug to us. I wasn't able to reproduce it using Firefox Nightly 72.0a1 (2019-11-28) (64-bit) on Ubuntu 18.04

Can you please download Firefox Nightly from here: https://nightly.mozilla.org/ and retest the problem and see if the issue still occurs there as well?

Thanks!

Sebas

Flags: needinfo?(guillaume1.gomez)

No, still present. Just reloading the Qwant maps page makes the memory usage grow by 0.5% (~80 Mo).

Flags: needinfo?(guillaume1.gomez)

Thanks for the additional information.

I've set a component so that the development team reviews this issue. Thanks!

Have a great one.

Clara

Component: Untriaged → Performance
Product: Firefox → Core

Thanks for the report. I am moving this bug to DevTools because the memory report seem to indicate that maybe there could be a problem around string copy

Component: Performance → General
Product: Core → DevTools

Putting under Debugger for now, as it shows a source map array buffer.

Jason, could you help with root cause analysis or recommend somebody else?

Type: enhancement → defect
Component: General → Debugger
Flags: needinfo?(jlaster)
Priority: -- → P3
Assignee: nobody → loganfsmyth

I believe this is the issue, though I didn't spend much time trying to reproduce the specific memory reports here, this is absolutely a large leak that would reproduce in the way the memory reports are showing.

Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(jlaster)
Pushed by loganfsmyth@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/e4b82d2a2de0
Part 1: Update bundles with recent Boolean changes. r=jlast
https://hg.mozilla.org/integration/autoland/rev/9070a2b4490a
Part 2: Avoid leaking memory for sourcemap loading. r=jlast
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: