Open Bug 1453436 Opened 2 years ago Updated 6 months ago

Firefox is consuming 22 GB of Ram while using Dev Tools

Categories

(DevTools :: General, defect, P3)

59 Branch
defect

Tracking

(Not tracked)

REOPENED

People

(Reporter: cristiancehi, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

343.67 KB, application/octet-stream
Details
Attached file memory-report.json.gz (obsolete) —
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:59.0) Gecko/20100101 Firefox/59.0
Build ID: 20180323154952

Steps to reproduce:

I'm developing a React App, so I'm using the Dev Tools a lot. I don't 100% know the root cause of the memory leak, but it slows my developing time because I have to restart the system (due slow memory decompression and swap usage) twice or trice a day. I have less than 15 tabs open, and only on one I have the dev tools open.


Actual results:

I'm sharing the memory report, I don't fully understand it, the result is Huge Memory Usage, even under 12 tabs open.


Expected results:

I hope this is not the casual memory requirements for developing.
I don't know how to read memory reports, but I can see 219 instances of resource:\\\\devtools\\client\\debugger\\new\\parser-worker.js and 52 instances of resource:\\\\devtools\\client\\debugger\\new\\search-worker.js.
Seems like an awful lot of them to me.

In any case, 22GB is not normal. And having to restart Firefox either.
It certainly seems like there's a leak somewhere. Do you see memory usage going up and up as you use Firefox? It could be good to also test using Firefox without addons (I'm assuming you're using the React DevTools addon at least), for some period of times, with DevTools open, and seeing if the leak persists there.

This might be a similar bug as bug 1376753.
See Also: → 1376753
Flags: needinfo?(cristiancehi)
From the memory report, I think this is rather 2.2GB. This is still huge, but less strange.

The debugger's parser-worker Worker holds 914 MB.
I can see 140MB and 138MB for 2 debugger windows (not sure why)
193MB taken by the react addon
Some strings that seem to be javascript code, I don't know if this hold by devtools or the addon.

Also I see there's only one main process in this memory report, no content process. Do you disable our multi-process architecture ?
Product: Firefox → DevTools
Priority: -- → P3
I fixed an issue in the debugger search worker that may be related to this issue. 
https://github.com/devtools-html/debugger.html/pull/7023

When searching the contents of a source using regular expressions that could return a zero length match such as /*a/ an inifiate loop would occur in the search worker that would keep adding to an array, causing several GB memory usage as well as high CPU usage.  I think the fix has landed in the Nightly build.
Status: UNCONFIRMED → RESOLVED
Closed: 7 months ago
Flags: needinfo?(cristiancehi)
Resolution: --- → INACTIVE
Attached file memory-report.json.gz

Hi! I'm sorry I didn't update about this before. I didn't know how to do it.

But today I reproduced the bug because one year has passed and this wasn't reported by anyone. So I restored all my settings to default and the process deleted all my extensions. I proceeded to open one tab with the react app I'm doing for my job and kept reloading it (through changes in the code and webpack reload) and after 100+ iterations I ended having like 6+ GB in the Main Process and 6+ GB in a FirefoxCP Web Content Process.

This file I'm attaching I hope it's complete and useful.

I got the CC and GC logs too, but i'm reserving those to upload if they're really needed.

PS. I notice that in my laptop computer I use in my workplace (Ubuntu) there is also a memory leak. I need to restart Firefox or even worse when swap is heavily used because this I need to restart the computer.

Attachment #8967107 - Attachment is obsolete: true
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INACTIVE → ---

Sorry, I forgot to mention. The Web Developer Tools have to be open. I tested the same method I mentioned an hour ago without Web Developer Tools and no memory leak occurred.

Blocks: 1553178
No longer blocks: devtools-performance
Blocks: dt-leak
No longer blocks: 1553178
You need to log in before you can comment on or make changes to this bug.