Crash and High memory usage when resizing a window with a large image in background

RESOLVED FIXED

Status

()

Core
General
RESOLVED FIXED
3 years ago
8 months ago

People

(Reporter: Toady, Unassigned)

Tracking

38 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

71.76 KB, text/html
Details
2.18 MB, video/mp4
Details
(Reporter)

Description

3 years ago
Created attachment 8609740 [details]
example.7z

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0
Build ID: 20150513174244

Steps to reproduce:

Set a background-image to html element with image size 1920 x 1080p then resized the browser window.


Actual results:

memory consumption went very high and if you continually resize the browser window it reaches over 3gb then crashes. 

If you close the tab that the background image was in it releases the consumed ram.


Expected results:

The ram should not have went over 3gb causing crash.

See below attached html document and video.

Here are 2 crash reports:
https://crash-stats.mozilla.com/report/index/992152f2-498d-4a60-bce6-fbf0a2150523

https://crash-stats.mozilla.com/report/index/d6e57468-e44d-45ff-82b8-84b742150523
(Reporter)

Comment 1

3 years ago
Affects the following:
stopped testing at 36.0.4
36.0.4
37.0.1
37.0.2
38.0
38.0.1
38.0.5
39.0b1

Fixed in:
40.0a2
41.0a1
However these builds scale the CPU update 50%-80% but no large memory foot print, Same in both normal and e10s mode.
Flags: needinfo?(gijskruitbosch+bugs)

Comment 2

3 years ago
Seth, can you triage this beyond just my "this is something gfx/imglib-y" gut feeling? :-)
Component: Untriaged → Untriaged
Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(seth)
Product: Firefox → Core
Toady, thanks for the bug report! A couple of tips: for bugs involving memory usage like this one, uploading an about:memory report is very handy. Also, instead of using a tool like 7zip, please upload each file individually unless there are huge numbers of files.

I'm pretty confident that this got fixed by bug 1124084. After bug 1124084, we are using downscale-during-decode to rescale this image and not the old HQ scaling code, and downscale-during-decode is much smarter about memory management.

That's not upliftable, so we'll unfortunately have to wait for Firefox 40 for a fix for this. I'm not confident I can write a patch for Firefox 39 and below that will fix this without causing new issues.
Depends on: 1124084
Flags: needinfo?(seth)
Created attachment 8611497 [details]
Reporter's testcase
Created attachment 8611498 [details]
Reporter's video
Attachment #8609740 - Attachment is obsolete: true
Since this is fixed in Firefox 40, I'm going to go ahead and resolve this.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
It'd be ideal to reduce the CPU usage in this case as well. Bug 1169060 should help; I'm already working on that for other reasons. I'll add it to the See Also list for this bug.
See Also: → bug 1169060
(Reporter)

Comment 8

3 years ago
(In reply to Seth Fowler [:seth] from comment #3)
> Toady, thanks for the bug report! A couple of tips: for bugs involving
> memory usage like this one, uploading an about:memory report is very handy.
> Also, instead of using a tool like 7zip, please upload each file
> individually unless there are huge numbers of files.
> 
> I'm pretty confident that this got fixed by bug 1124084. After bug 1124084,
> we are using downscale-during-decode to rescale this image and not the old
> HQ scaling code, and downscale-during-decode is much smarter about memory
> management.
> 
> That's not upliftable, so we'll unfortunately have to wait for Firefox 40
> for a fix for this. I'm not confident I can write a patch for Firefox 39 and
> below that will fix this without causing new issues.

Hi Seth

Thanks for the tips and will do for next time. :)
Moving from Core::Untriaged to Core::General https://bugzilla.mozilla.org/show_bug.cgi?id=1407598
Component: Untriaged → General
You need to log in before you can comment on or make changes to this bug.