[Webkit-unassigned] [Bug 97020] New: [V8] HTMLMediaElement isn't garbage collected between document reloads

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 18 07:55:53 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=97020

           Summary: [V8] HTMLMediaElement isn't garbage collected between
                    document reloads
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Media Elements
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: scherkus at chromium.org
                CC: eric.carlson at apple.com, haraken at chromium.org


Copied from http://code.google.com/p/chromium/issues/detail?id=148451

Regression introduced in http://trac.webkit.org/changeset/100307

<snip>
Summary: It looks like this is not a bug of GC; this is a bug of Audio.

(1) In http://www.playescapegoat.com/, two HTMLAudioElements are created, say X and Y.
(2) Reload the page.
(3) The major GC tries to reclaim X and Y, and calls hasPendingActivity() for X and Y (c.f. http://code.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/bindings/v8/V8GCController.cpp&exact_package=chromium&q=v8gccontroller.cpp&type=cs&l=138).
(4) X->hasPendingActivity() returns false but Y->hasPendingActivity() returns true. So the GC cannot reclaim Y.
(5) Consequently, all Nodes in the DOM tree which Y belongs to are kept alive. The DOM tree contains canvas elements which hold a lot of memory behind it. I think this is the memory leak we are observing.

Thus, the problem is that Y->hasPendingActivity() returns true even after the page reload. I investigated why Y->hasPendingActivity() returns true, and observed the following behavior:

[In normal cases like WebKit/LayoutTests/media/audio-garbage-collection.html]

(1) HTMLMediaElement::potentiallyPlaying() returns true while Y is playing.
(2) When the page is reloaded, HTMLMediaElement::potentiallyPlaying() becomes false. Thus, HTMLMediaElement::m_playing becomes false (i.e. http://code.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/html/HTMLMediaElement.cpp&exact_package=chromium&q=htmlmediaelement.cpp&type=cs&l=3579).
(3) Because HTMLMediaElement::m_playing is false, Y->hasPendingActivity() returns false.

[In http://www.playescapegoat.com/]

(1) HTMLMediaElement::potentiallyPlaying() returns true while Y is playing.
(2) When the page is reloaded, HTMLMediaElement::potentiallyPlaying() does not become false for some reason. Thus, HTMLMediaElement::m_playing does not become false.
(3) Because HTMLMediaElement::m_playing is true, Y->hasPendingActivity() returns true.

I think that we need to fix HTMLMediaElement so that HTMLMediaElement::m_playing becomes false when the page is reloaded. (It doesn't make sense that HTMLMediaElement::m_playing keeps being true even after the page reload.)
</snip>

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list