Open Bug 1141242 Opened 5 years ago Updated 8 days ago
[escalate] Continuously refreshing a tab after an interval leads to high memory consumption
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0) Gecko/20100101 Firefox/36.0 Build ID: 20150222232811 Steps to reproduce: Environment: MAC OSX 10.10.2 Firefox 36 Firefox keeps consuming lot of memory when you keep refreshing a tab at some interval. - Start the firefox browser - Visited gmail.com and logged into my account - Monitored firefox memory consumption rate in the "activity monitor" application of MAC. - Refreshed the page couple of times and notice the increase in the memory consumption rate. - I work at Splunk and i found the similar behavior when the Splunk dashboards (with or without charts) were refreshed at specific interval. The memory consumption rate was really high and this happens only in Firefox browser. Actual results: For the gmail testing: Initially, memory consumption was about 400MB. I refreshed the page after 10 seconds and it went to 580MB. Again i refreshed after 10 seconds and this time it was 690MB. Finally, when i refreshed 3rd time after 10 seconds, it was showing as 800MB. For the splunk dashboards testing: i had three 3 dashboards open in 3 different firefox tabs and these tabs were refreshed at 30 secs interval. Eventually, the firefox crashed after the high memory consumption (around 2GB). It's not a memory leak because at a point even if the memory consumption is really high, it would stay at that rate (neither increase nor decrease) Expected results: Even if firefox consumes lots of memory, the memory should go down after some time which never happens. Even if you close the tab and open a new blank tab, you would see that the memory consumption rates is still not reduced quickly.
- I tried playing with memory profiling and about:memory configurations but that didn't help. - I also tried building firefox nightly with dtrace configuration to see if i get something but unfortunately that also didn't help.
Severity: normal → critical
OS: Mac OS X → All
Priority: -- → P2
Hardware: x86 → All
@Firefox support: I work in San Francisco and i know that you have office here too. If you want, i can also come to your office and show the issue. It would be great if you can help me with this problem because right now we have to tell our clients to use any other browser except Firefox. Thanks.
Thanks for the report. Before somebody does something with it (https://wiki.mozilla.org/Performance/MemShrink), maybe https://developer.mozilla.org/en-US/docs/Zombie_compartments is helpful.
Priority: P2 → --
(In reply to mpawar.splunk from comment #1) > - I tried playing with memory profiling and about:memory configurations but > that didn't help. Could you upload an about:memory memory report here? That way we can at least see what is using the memory. It's a starting point.
Timothy Nikkel, Here is the memory report of firefox where the memory consumption rate was 1.07GB with three tabs open on which same splunk dashboard was getting refreshed after every 30 seconds.
Most memory seems to be used by js related things. Nick, can you provide any insight?
What do you mean by "refresh"? Do you mean hit the reload button (circle-shaped arrow) in the address bar? When I reload gmail repeatedly (with that button) I get an up-and-down pattern -- memory increases on each reload, and then eventually drops again once the GC kicks in. I would expect similar behaviour from other sites.
Like Nick says, refreshing a page is expected to increase the memory usage some, but it should level off shortly. Can you load up whatever tabs, save a memory report, and then let them refresh until the memory use gets ridiculous and then save another memory report? Then we can diff them to see whats going on.
Memory report of when the 3 tabs with splunk dashboard were loaded for the first time. The memory consumed by firefox at this time was around 650MB.
Memory report of when the 3 tabs with splunk dashboard were refreshed at every 30 seconds for around 5 minutes. At this time, the memory consumed by firefox at this time was around 1.35GB.
If you want, you can go to http://www.splunk.com/page/previous_releases and download a free version of any release starting from 6.0 version and reproduce the issue. You just have to create a simple dashboard in Splunk which will reload at every 30 seconds and open that dashboard in 3 tabs. Let me know if you need more help on how to create dashboard in Splunk and reproduce the issue. Thanks for all the help.
What happens if you leave it running for longer than five minutes? Does it just keep growing forever? Does it plateau?
No, it does not keep growing forever. For e.g. after 5 minutes if the memory consumption rate is 1.5gb then it would stay around that. Something like 1.45gb/1.5gb/1.55gb, but won't keep increasing forever. Its not a memory leak.
Any update on this? Thanks.
Maybe Nick can see if we are using more memory then needed here.
How much memory do the other browsers use on this workload for comparison?
This is how memory is used by other browsers. Google chrome: - Initial load: 446MB - After 5 mins: 630MB Safari: - Initial load: 270MB - After 5 mins: 280MB Internet explorer 11: - Initial load: 150MB - After 5 mins: 350MB
Severity: critical → blocker
Priority: -- → P1
Summary: Continuously refreshing a tab after an interval leads to high memory consumption → [escalate] Continuously refreshing a tab after an interval leads to high memory consumption
Can i get an update on this please? I want to escalate the issue and i am not sure whether adding "escalate" in the problem statement would do that. Our clients are not able to use firefox browser due to this issue. Thanks.
Nick appears to be on PTO until the end of the month, adding :mccr8 instead.
Looking at the diff between the before and after report, there's another 200MB of explicit memory. The resident increased by about 470MB. I don't know why that is so much more, or if that's normal or not. Of the explicit difference, 55MB is unused-gc-things, and 26MB is strings. (In terms of strings, in the before there are 10's of thousands of copies of various strings like "[object Number]".) There's another 32MB of heap-overhead, and about 20MB of network/cache2. There's also 62MB of various JS things, like objects, arrays and functions. So, about half of the increase is kind of heap fragmentation stuff probably caused by a lot of churn of things in memory. I'll try to reproduce locally to see if I can figure out why the JS stuff is alive.
This does not seem related to the Memory developer tool.
Component: Developer Tools: Memory → Untriaged
Andrew, is there anything we can do about this as currently filed and/or do we need more information?
Component: General → Untriaged
Product: Firefox → Core
The GC is not triggering enough to reduce memory usage, it sounds like. For the Gmail scenario in comment 0, it is isn't too surprising that a page wouldn't get cleaned up after 10 seconds. Somebody would have to look at the splunk dashboards thing to see if they are allocating something that isn't reported to the GC or whatever.
Hi I can easily trigger this using Zabbix page autorefresh and also Jira Reindex page. My firefox page is eating about 1Gb RAM and forcing me to restart browser or wait until it will crash itself. Regards, Areg
I have tested on Mac OS X 10.10 with FF 47 and FF Nightly 50.0a1 (2016-07-25) and I have about 240-270 MB of RAM consumption. I used the link from comment 29. Areg do you have add-ons? Can you please test this with new profile or in safe mode?
I have tested this with and without Add-Ons in FF. Atlassian Support was able to reproduce this with smaller instance that mine one. Reindex on my side takes couple of hours to complete and periodical refresh accumulates too much RAM during refresh.
Forgot to mention that I am using FF 48.0b9 64bit Beta channel one.
Priority: P3 → --
You need to log in before you can comment on or make changes to this bug.