Firefox 17.0.2esr playing youtube video in html5 starts to leak serious amount of memory

VERIFIED FIXED

Status

()

Core
Audio/Video
VERIFIED FIXED
4 years ago
3 years ago

People

(Reporter: Zdenek Kraus, Assigned: kinetik)

Tracking

({regression})

17 Branch
x86_64
Linux
regression
Points:
---
Dependency tree / graph
Bug Flags:
in-qa-testsuite +

Firefox Tracking Flags

(firefox-esr1719+ verified)

Details

(Whiteboard: [MemShrink:P2])

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
Build ID: 20130125094555

Steps to reproduce:

1. enable HTML5 on http://youtube.com/html5
2. open this video https://www.youtube.com/watch?v=jTMxKUYrgJ4
3. skip onto 31:00
4. watch memory consumption grow very quickly


Actual results:

Firefox consume very large amount of memory, about 10GB in few seconds


Expected results:

no memory consumtion/leak, video continue playing.
(Reporter)

Comment 1

4 years ago
I additionally found an SUSE forum, that discovered same issue http://forums.opensuse.org/english/get-technical-help-here/applications/482276-serious-memory-leak-firefox-17-0-2esr.html
(Reporter)

Updated

4 years ago
Summary: Firefox 17.0.2ers playing youtube video in html5 starts to leak serious amount of memory → Firefox 17.0.2esr playing youtube video in html5 starts to leak serious amount of memory
(Reporter)

Comment 2

4 years ago
Reproduced successfully on Windows 7.

Comment 3

4 years ago
Could you try to reproduce the issue:

1) In safe mode: https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode

2) With a new profile: https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles

Same leak?
Flags: needinfo?(zdenek.kraus)
(Reporter)

Comment 4

4 years ago
In both cases (safe mode, new profile) it still leaking, also with new profile and safe mode.

Additionally on windows 7 after firefox consumed about 3GB of memory, it crashed. On gentoo it continues to cosume memory and forcing system to swap, without ulimits. With ulimits it just crashed with segmentation fault.
Flags: needinfo?(zdenek.kraus)

Comment 5

4 years ago
Thanks. Could you type about:memory?verbose during the leak and copy/paste the memory log here (just reuse the fresh profile with only one tab displaying the YT html5 video).
Flags: needinfo?(zdenek.kraus)
(Reporter)

Comment 6

4 years ago
Created attachment 706450 [details]
log about:memory?verbose during leak on fresh profile

It's about 3 seconds before crash. Only YT and about:memory tabs open.
Flags: needinfo?(zdenek.kraus)

Comment 7

4 years ago
1,976,995,531 B (100.0%) -- explicit
├──1,892,440,576 B (95.72%) -- media
│  ├──1,892,436,480 B (95.72%) ── decoded-video
│  └──────────4,096 B (00.00%) ── decoded-audio
Whiteboard: [MemShrink]
Component: Untriaged → Video/Audio
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
That's bad!
(Assignee)

Comment 9

4 years ago
Easily reproducible in 17.0.2esr, not reproducible in nightly, 18, or 17.0.1.  That narrows the regression range significantly.
(Assignee)

Comment 10

4 years ago
2013-01-03-03-45-01-mozilla-esr17 GOOD
2013-01-06-03-45-05-mozilla-esr17 BAD

The only change to content/media in that range is bug 794426.
Blocks: 794426

Updated

4 years ago
Keywords: regression
(Assignee)

Updated

4 years ago
Assignee: nobody → kinetik
Status: NEW → ASSIGNED
(Assignee)

Comment 11

4 years ago
I've confirmed that this is a regression from bug 794426 by testing that changeset and its parent.

This is fixed (or at least hidden) by Paul's fix in bug 792274.

What happens is: after seeking, RecreateDecodedStream is called, causing the decoder to gain a DecodedStream it did not previously have (this is what's is fixed by Paul's patch).  That stream causes HaveEnoughDecodedVideo to perpetually return false because stream->mStream->HaveEnoughBuffered(TRACK_VIDEO) always returns false.  This causes the decoder's video queue to grow without bound, resulting in rapid memory consumption.

Before the patch in bug 794426, stream->mStream->HaveEnoughBuffered(TRACK_VIDEO) alternates between true and false.  The video queue grows above AMPLE_VIDEO_FRAMES, but not without bound.
(Assignee)

Comment 12

4 years ago
And the final part of the puzzle is that https://hg.mozilla.org/releases/mozilla-esr17/rev/15b8772620ec#l1.24 from 794426 causes SendStreamData to bail early when there's an audio thread, which there is when we're playing back normally.  The DecodedStream is set up after seeking via RecreateDecodedStream but isn't fed any data after playback resumes (which recreates the audio thread), leaving the DecodeStream in a perpetually starved state, causing HaveEnoughDecodedVideo to return false.
Depends on: 792274
(Assignee)

Comment 13

4 years ago
Requesting esr17 approval for the patch in bug 792274.
Whiteboard: [MemShrink] → [MemShrink:P2]
(Assignee)

Comment 14

4 years ago
https://hg.mozilla.org/releases/mozilla-esr17/rev/7606a3baed96
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED

Updated

4 years ago
status-firefox-esr17: --- → fixed
tracking-firefox-esr17: --- → ?

Updated

4 years ago
Duplicate of this bug: 839493
Tracking esr for 19+ as the patch in 792274 is uplifted in Fx19 cycle targeting esr 17.0.3
tracking-firefox-esr17: ? → 19+

Updated

4 years ago
Keywords: verifyme
Sorry bajaj for missing this verification. I just confirmed this does not reproduce for me with the latest 17esr. Zdenek, please reopen this bug if you can still reproduce.
Status: RESOLVED → VERIFIED
status-firefox-esr17: fixed → verified
Keywords: verifyme
Dave, I'm wondering if we could have a Mozmill Endurance test created for this regression?
Flags: in-qa-testsuite?(dave.hunt)
(Reporter)

Comment 19

4 years ago
Antony, fix works great with 17.0.3, thanks
(In reply to Zdenek Kraus from comment #19)
> Antony, fix works great with 17.0.3, thanks

Thanks Zdenek.
(In reply to Anthony Hughes, Mozilla QA (:ashughes) from comment #18)
> Dave, I'm wondering if we could have a Mozmill Endurance test created for
> this regression?

If we can reduce the test case down and use a video served from localhost then that sounds good to me. We already have tests for playing flash video content.
Blocks: 851502
Thanks Dave, I've gone ahead and filed bug 851502 to develop the test.

Updated

4 years ago
Flags: in-qa-testsuite?(dave.hunt) → in-qa-testsuite?
The automated test for this was tracked in bug 851502. Marking in-qa-testsuite+
Flags: in-qa-testsuite? → in-qa-testsuite+
You need to log in before you can comment on or make changes to this bug.