Open Bug 1376753 Opened 3 years ago Updated 2 months ago

Firefox get +1GB of RAM if I keep it open for while specially with DevTools open

Categories

(DevTools :: General, defect, P3)

54 Branch
defect

Tracking

(Not tracked)

REOPENED

People

(Reporter: dehghani.m.c, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 8 obsolete files)

Attached image memory issue.png (obsolete) —
Hi,

I'm using Firefox with just 1 installed add-on (FlagFox), I refreshed Firefox before reporting this, btw I didn't change any config that could effect on performance.

When I start Firefox it's okay and the main process use ~200MB of RAM, but if I don't close Firefox for while (let's say +4 hours), the main process use + 1GB of RAM and all it's all processes use +1.5GB of RAM.

I test this scenario with Chrome and it doesn't happened in Chrome at all.

I think you should test Firefox in real world scenario and then post a blog about it's performance, I say that because few days ago I told to my friend that Firefox is better than ever now, but sadly this issue happens and you know rest of it.

I don't like to switch to Chrome, please fix this king of issues as soon as possible.

BTW I'm using Windows 10 64bit (latest stable version) and have 6GB of RAM.

Thanks.
Can you attach memory reports from about:memory for the initial state (right after startup) and the state when memory usage is so high? Ideally without the flagfox add-on, which might be contributing to the problem.
Component: General → Untriaged
Flags: needinfo?(dehghani.m.c)
Attached file memory-logs.rar (obsolete) —
I attached the logs. I should mention, without the FlagFox add-on the memory never hit +700MB (RAM I mean) and overall was really better that before. but still after couple of hour the memory rise up to ~650MB.

Hope the logs can help to make Firefox better.
Flags: needinfo?(dehghani.m.c)
Hi Mehdi,

From your previous comment, I understood that if you disable FlagFox add-on you can't reproduce this issue, correct? If yes I think the add-on is the one to blame here.
Flags: needinfo?(dehghani.m.c)
Hi Ovidiu,

Yes, as I said without add-on, Firefox never hit +700MB (its main process I mean, overall it takes ~1GB). without add-on its really better, actually I'm really glad to see Firefox in good status (compare to prev versions), but it is not better than Chrome in RAM usage as Mozilla says. sure when you start Firefox it takes RAM less that Chrome but after ~4 hours Firefox takes ~900MB of RAM (without any add-on), but Chrome with ~10 extension takes ~500MB (with ~10 processes).

I can see you try to make Firefox better, I wish I could help you. I report this (and other issues) to help you to make Firefox better.

If this bug is invalid, feel free to close it, but the point of this issue is this fact: Firefox is not better than Chrome in real-world usage. (I think I said that multiple time :p, I'm sorry)
Flags: needinfo?(dehghani.m.c)
Thanks for your help, from comment 4 stands out the idea that FlagFox add-on increases the RAM consumption.  I think Toolkit: Add-ons Manager component is the right one for this issue.
Component: Untriaged → Add-ons Manager
Product: Firefox → Toolkit
Component: Add-ons Manager → Extension Compatibility
Product: Toolkit → Firefox
If you think its a bug in an extension, then Firefox: Extension Compatibility is the appropriate component. Please note that FlagFox is currently not a WebExtension and will not work in Firefox 57 at this time.
@Andy, I know that, I already remove FlagFox and switch to another one that is compatible with FF+57. (thanks for your info)

As I said without add-on Firefox is much better (but it is not enough). even with new add-on is better than with FlagFox (so switch to web extension is correct decision, thanks to Mozilla and the team).

The point of this issue (and the reason that I open it) is not using FlagFox or any add-on. again as I said in my prev posts, Firefox only at startup is better than Chrome in RAM usage, after couple of hours the RAM usage is grow up, there is 3 processes and 2 of them take ~900MB (at startup time this 2 guys take ~200MB), so I think its a bug and the team should fix this behavior. (atm the only thing that makes Firefox better than Chrome or Edge as Mozilla says its RAM usage of Firefox, but sadly it is not true), so please don't close the issue and try to fix it.

Many thanks.
The developer points to this forum for bug reports: https://flagfox.net/. There's also a topic on WebExtensions in that forum that suggests the developer will look into it, though it doesn't include a timeline.

This is something that needs to be fixed in the add-on (probably a memory leak), not in Firefox. If the add-on is ported to WebExtensions and the problem persists, there might be something in the API to look into. As of now, it doesn't appear like something actionable on our side.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
Attached file memory-report.json.gz (obsolete) —
I reopened this bug because this happened again, when no add-on/extension installed on Firefox. I attached log of about:memory, the main process reached to +850MB, after ~4 hours
Reopened.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
BTW, overall ~1.2GB (the 3 processes I mean), I think the token  memory is deepened on how much I working with Dev tools. the reason of https://bugzilla.mozilla.org/show_bug.cgi?id=1376753#c2 comment was I didn't work with Dev tools that days. now I can say it's definitely Firefox's issue.
Based on comment 9, the memory usage is growing with no extensions installed. Moving to a different component as a result.
Component: Extension Compatibility → Untriaged
Hi Mike,

When you have some time can you please take a look at the memory report from comment 9. Thanks
Flags: needinfo?(mconley)
Hello Mehdi, can you please show the about:support for the profile from which you gathered this about:memory report?
Flags: needinfo?(mconley) → needinfo?(dehghani.m.c)
Hello Mike, I'm afraid but I can not provide your requested info, I recently re-installed Firefox. so, now how I can help?
Flags: needinfo?(dehghani.m.c) → needinfo?(mconley)
Resolving for now, but please reopen if you can ever reproduce in safe mode.
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → INCOMPLETE
@Panos, as I'm writing this, Firefox's RAM usage is +1.6GB (refer to attached screenshot), I faced similar almost every day, I have installed uBlock Origin, Wappalyzer and Contry Flags & IP whois add-ons.

So what do you need to find out the reason of this huge RAM usage?
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Attached image Sorry, screenshot for my prev post. (obsolete) —
(In reply to Mehdi from comment #17)
> @Panos, as I'm writing this, Firefox's RAM usage is +1.6GB (refer to
> attached screenshot), I faced similar almost every day, I have installed
> uBlock Origin, Wappalyzer and Contry Flags & IP whois add-ons.
> 
> So what do you need to find out the reason of this huge RAM usage?

Please provide a copy of about:support and a memory report, and see if you can reproduce with all of these except uBO disabled (I'm assuming the others aren't webextensions).
Flags: needinfo?(dehghani.m.c)
Still waiting on about:support from Mehdi.
Flags: needinfo?(mconley)
Resolving as incomplete due to inactivity for 3 weeks. Please reopen when you answer the request for information.
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → INCOMPLETE
Flags: needinfo?(dehghani.m.c)
I faced to this issue again in FF 57.

+1.6GB RAM usage, with just 2 open tabs.

My co-worker is Chrome guy, I asked about RAM usage of his Chrome. his browser was opens +9 hours. some info about his browser:
14 tabs open
17 extensions
console open
redux dev open (this is huge extension, draw charts and ....)

With above situation the RAM usage of Chrome is ONLY 622 MB!! (after +9 hours works, he didn't close his browser during this 9 hours)

For me (FF 57)
2 tabs open
5 extensions
console open

1.622 GB :|

I attached about:support log.
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Attached file FF 57 - RAM Usage.rar (obsolete) —
Sorry, attachment for prev post.
Summary: Firefox main process get +1GB of RAM if I keep it open for while → Firefox get +1GB of RAM if I keep it open for while
Hi Mehdi,

I don't know if you tried to open the browser in safe mode (all the add-ons are disabled), but if you didn't can you please do so and see what is the result? Here is a link to how to open FF in safe mode: https://support.mozilla.org/t5/Procedures-to-diagnose-and-fix/Troubleshoot-Firefox-issues-using-Safe-Mode/ta-p/1687#w_how-to-start-firefox-in-safe-mode
Flags: needinfo?(dehghani.m.c)
Hi Ovidiu,

I tired with brand new profile (actually I have one profile for special usecases, no extension, no logged in). the result was not too much different with main profile (that I sent the log and screenshot of that in my prev comment.)

I think the screenshot say everything, trust me this not happens just for me and it's not related to extensions. I think you can see the huge RAM usage of Firefox just by checking the task manager of your OS.

Let me know if you need more info, I'm here for help to make Firefox king again.
Flags: needinfo?(dehghani.m.c)
Mike, please take a look at Mehdi's attachment when time permits. Thanks a lot.
I'm afraid I'm not deriving anything useful from either the about:support nor the about:memory reports.

Hey erahm, anything actionable in here?
Flags: needinfo?(erahm)
Unfortunately this but seems to have morphed over time, the latest about:memory report is 4 months old. It's not clear what that issue is at this point. One thing to keep in mind is that the numbers reporter by Windows TaskManager aren't particularly useful, we want to sum the working set of the parent process and the private working set of the child processes.

Mehdi, I have a few questions:

1) Can you provide steps to reproduce? For example are there certain sites you're seeing this on?
2) Can you provide an about:memory report from your latest Firefox 57 install when you see the issue?
3) When you reproduce the issue can you try running in safe mode and see if it happens again? This will help us eliminate add-ons as the issue.

I know you've done these things at different times in this bug, but it would be helpful to do them all at once with the same installation.
Flags: needinfo?(erahm) → needinfo?(dehghani.m.c)
Hi again,

>
> 1) Can you provide steps to reproduce? For example are there certain sites
> you're seeing this on?
> 2) Can you provide an about:memory report from your latest Firefox 57
> install when you see the issue?
> 3) When you reproduce the issue can you try running in safe mode and see if
> it happens again? This will help us eliminate add-ons as the issue.
>

1) As I'm developer, I use dev tools a lot, every day I see this kind of RAM usage of Firefox. specially when I working with dev tools. so in order to answer your Q, you just need to keeping open Firefox for while (+5 hours for example), I'm sure you can see the RAM usage as I can see here.
2) Sure, I'll asap!
3) I can do that, but as I said before, Firefox is great at start up time, the RAM usage is normal and even less that Chrome, but after some hours it eat RAM like a monster. so this kind of test is hard, but I'll try.

>
> I know you've done these things at different times in this bug, but it would
> be helpful to do them all at once with the same installation.
>

Don't worry, I'll help you to fix this issue, just I ask you to fix this problem and trust me here, I love Firefox and I want to see it great as it should be.

Cheers!
Attached file memory-report.json.gz (obsolete) —
Here is the about:memory log when Firefox RAM usage was +2 GB. hope this helps.
I'll try to provide same log with clean/no add-on profile too.
I'll try to provide same log with clean/no add-on profile too.
Flags: needinfo?(dehghani.m.c)
Attached file memory-report.json.gz (obsolete) —
Here is the about:memory log when Firefox RAM usage was ~3 GB. (After ~4 hours working)

I think working with Dev tools, specially the Inspector is the main reason of Firefox's huge RAM usage.
Component: Untriaged → Developer Tools
Priority: -- → P2
Summary: Firefox get +1GB of RAM if I keep it open for while → Firefox get +1GB of RAM if I keep it open for while with DevTools open
Summary: Firefox get +1GB of RAM if I keep it open for while with DevTools open → Firefox get +1GB of RAM if I keep it open for while specially with DevTools open
Working only 2 hours on project that use ReactJS and Firefox RAM usage was became +2GB.
I have to close Firefox and its really boring. guys I don't want to use another browser, specially for develop, please fix this issue asap.

Thanks.
Attached image firefox eat RAM like a monter.png (obsolete) —
Second time in 5 hours!
Maybe an about:memory dump would help :)
You can look at the first paragraph in https://developer.mozilla.org/en-US/docs/Mozilla/Performance/about:memory and attach your dump to this bug. This dump will contain information from all your tabs so please be aware of this.
Mehdi, I'm sorry, I missed you already attached a bunch of dumps to this bug.
Mehdi, from your latest dump, we see the website khasbox.ir takes a lot of memory (1GB). Do you know if this is expected? Is it the website you're working on?
Otherwise could you share with us yet another dump from your latest issue?
Mehdi, me again :)

Could you share with us the way you develop? For example, how do you see the changes to your files: do you reload the page, or do you use webpack's hot reload plugin, or something else? Do you do it with the debugger open?
Can you share with us a project where you see this issue? If you can't, can you share at least your full webpack config and package.json?

Thanks!
Hi Julien,

> from your latest dump, we see the website khasbox.ir takes a lot of memory (1GB). Do you know if this is expected? Is it the website you're working on?

That was one of my projects, nothing special about that, regular ASP.Net website/project. the problem is not related to any specific site/project (trust me), one of the main reason of this huge RAM usage is dev console, and I think Inspector.

> Could you share with us the way you develop?

Sure, I can share my secrets :D (I'm joking)
Nothing special, I don't use anything special, this is how I debug my projects:
Open the website, open the console and play with CSS, check console for JS errors/logs and Network tab for track HTTP requests. I just use Inspector, Console and Network tabs in 99% of times.

Of course today I was working with Webpack (because of React) also its hot reload option. but again, trust me, this issue not related to any specific tool, way, solution and ..., I faced to this issue many times in different situations. (it happens when I was working with AngularJS (v1), without any tools/loaders).

So I think there is no need to sharing webpack config file or package.json, because I think it put this issue in wrong way. (I promise you, I didn't use anything harmful).

I'm almost sure the main reason of this huge RAM usage is dev console, specially Inspector, without open dev tools Firefox eat RAM but not very fast, maybe after 10 hours, but with dev tools RAM usage reach to +2GB in max 3 hours.

I hope this long story help you to solving this issue.

Thanks!
Thanks Mehdi, don't worry I trust you, but we all have different habits related to coding :) That's why I ask these questions.

A few more questions for you:
* do you use the "persist logs" feature in the console (checkbox on the top right)?
* same in the netmonitor (checkbox on the top right in current nightly, it used to be in the settings)?
* is the memory freed if you clear the console (the "trash" button on the top left)?
* same for the netmonitor?

Thanks !
Hey man, it's okay, I will help as much as I can.

Here is the answers:

> * do you use the "persist logs" feature in the console (checkbox on the top right)?
No

> * same in the netmonitor (checkbox on the top right in current nightly, it used to be in the settings)?
No

> * is the memory freed if you clear the console (the "trash" button on the top left)?
No

> * same for the netmonitor?
No

Thanks!
Thank you Mehdi for being so patient and helping with answers.
This bug is really hard to investigate. Memory usage is a tough problem. We'll try our best to make progress, but this might be slow.
When memory usage climbs up as high as you said, how does Firefox perform? Is it still usable normally, like when you first opened it?
Have you also tested this: use it for a 4/5 hours, until it reaches a high level of memory usage, and then let it rest for some time, i.e. don't use it anymore, but keep it open in the background, while doing something else.
Does the memory usage go down then?
I understand that this might be very disruptive to your work, and understand if you can't do this, but I thought I'd ask anyway.
Hey Patrick, it's nothing, I wish I could write some code for Firefox, your work is great, thanks for that. Firefox is my fav. browser and I do anything for help you guys.

> When memory usage climbs up as high as you said, how does Firefox perform? Is it still usable normally, like when you first opened it?

Actually when I focused on my work I forgot to check Task Manager to see Firefox (and other running apps) status. but Firefox got very slow that I feel the RAM usage hit +2GB, so my answer is: Firefox got really slow when issue happens.

> Have you also tested this: use it for a 4/5 hours, until it reaches a high level of memory usage, and then let it rest for some time, i.e. don't use it anymore, but keep it open in the background, while doing something else.
Does the memory usage go down then?

I never did that, but I'll and report the result asap. nice idea btw.

> I understand that this might be very disruptive to your work, and understand if you can't do this, but I thought I'd ask anyway.

Yes it is :p, but I think its worse to try.

Thanks!
Hey @Patrick

> Have you also tested this: use it for a 4/5 hours, until it reaches a high level of memory usage, and then let it rest for some time, i.e. don't use it anymore, but keep it open in the background, while doing something else.

RAM usage doesn't change so much, in average ~5% of ~2GB, so actually nothing.
Any update here?
Seems like it got worse, today just one process took +3GB of RAM (in ~3 hours of work). working on my project using Firefox is really hard and I don't want to switch to Chrome, please fix this asap!
Thanks.
Hey Mehdi, again a about:memory dump from when this happens would help. The previous one is old and sadly we couldn't find anything obvious from it :(
Attached file memory-report.json.gz
Hi @Julien, here is brand new memory log (created on 4/7/2018), in ~1 hour Firefox RAM usage reached to ~3.5GB.
And the screenshot
Attachment #8881746 - Attachment is obsolete: true
Attachment #8882807 - Attachment is obsolete: true
Attachment #8887425 - Attachment is obsolete: true
Attachment #8910270 - Attachment is obsolete: true
Attachment #8929000 - Attachment is obsolete: true
Attachment #8932804 - Attachment is obsolete: true
Attachment #8938300 - Attachment is obsolete: true
Attachment #8944356 - Attachment is obsolete: true
So from the memory report, I see:

* One Web Content process uses especially a lot of memory (2GB) as we can also see in your screneshot. This memory usage seems to come from a website at http://192.168.1.210:5050. I believe this is a website you work on? Do you use something like the Webpack Hot Loader to make it possible to replace part of the website while working on it? Or maybe some leak in the app itself? Can you share more about it?

When this happens, and if you see this in about:memory, can you try to take a snapshot with the "memory" tool in the devtools ? I believe this can bring more information about what happens in this specific page.

* The Main Content process uses 800MB, I believe this is used by the devtools. I can see the sources for JS and CSS files.
(adding a needinfo flag for Mehdi)
Flags: needinfo?(dehghani.m.c)
I already answered to your question(s) bro, see https://bugzilla.mozilla.org/show_bug.cgi?id=1376753#c40

In short, this issue isn't related to tools that I use for develop, I faced to this issue, with/without react/webpack/..., but as I mentioned before (and you mentioned too), when I'm working with dev tools (again doesn't matter the tools that I use in the project that I'm working on) the memory usage increase too fast vs normal usage.

> When this happens, and if you see this in about:memory, can you try to take a snapshot with the "memory" tool in the devtools ? 
I'll try.

Is there anything else that I can do? I mean I opened this issue long time ago and since then, I'm sending memory reports, screenshots, but still nothing happens and I think this is critical bug and the time of sending evidences is over ;)
Flags: needinfo?(dehghani.m.c) → needinfo?(felash)
It's not about evidences as we believe you about the issue. It's about getting keys to solve your issue.

Thanks for pointing to comment 40, I missed it while rereading the issue...
Flags: needinfo?(felash)
For few days I have to work on some Android project, so I need time for creating snapshot with the "memory" tool in the devtools (as you requested). sorry about that.
Attached file 31284182.fxsnapshot
Here you go
Thanks !

Funnily importing to read it is broken at the moment... I filed bug 1461300...
See Also: → 1453436
Product: Firefox → DevTools
Moving this inactive P2 to the backlog (P3)
Priority: P2 → P3

Any update here? Do you planed to fix this after my death?

Thanks for keeping is honest here, Mehdi! Devtools is tracking in bug 1553178 to get on top of memory leaks like the one you are hitting.

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