New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 634012 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
not on Chrome anymore
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocking:
issue 706773



Sign in to add a comment

GPU Process memory leak when video rendered onto WebGL texture

Reported by boxnumbe...@gmail.com, Aug 3 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36

Example URL:
http://threejs.org/examples/webgl_video_panorama_equirectangular.html

Steps to reproduce the problem:
1. Open URL in Chrome
2. Open Chrome task manager
3. In Chrome task manager, observe Memory value for the GPU Process task

What is the expected behavior?
In Chrome task manager, the Memory value for the GPU Process task should not increase over time.

What went wrong?
In Chrome task manager, the Memory value for the GPU Process task increases about .75 MB every minute. (Observed over 24 hours.)

Did this work before? N/A 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes 

Chrome version: 51.0.2704.106  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 22.0 r0

No memory leak was observed in Firefox. 

With 2D canvas acceleration disabled in Chrome the leak still occurs.

A second stripped-down code example which exhibits the leak can be found here: http://stackoverflow.com/questions/38621022/texture-from-video-tag-leaks-memory
 
Cc: jbau...@chromium.org
Cc: kbr@chromium.org piman@chromium.org
Components: Internals>GPU
Status: Available (was: Unconfirmed)
I think we're leaking texture mailbox mappings. ImageBuffer::copyToPlatformTexture is called every frame and creates a new mailbox, which causes MailboxManagerImpl::InsertTexture to add a map between mailbox and texture. However, we only ever delete these mappings when the texture is deleted, so the set of mappings keeps growing.

I'm not sure the best way to fix this. Maybe ProduceTexture(Direct) with a texture ID of 0 should unbind the texture from the mailbox.

Comment 3 by kbr@chromium.org, Aug 3 2016

Components: Blink>WebGL

Comment 4 by kbr@chromium.org, Aug 5 2016

Owner: kbr@chromium.org
Status: Started (was: Available)
John's got a CL up for this so assigning.

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 5 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c5fb6dd04f15201c85d37695b647c0a08d8ee053

commit c5fb6dd04f15201c85d37695b647c0a08d8ee053
Author: jbauman <jbauman@chromium.org>
Date: Fri Aug 05 23:02:41 2016

Unbind video texture from mailbox after copying to WebGL.

Every time a video is copied to WebGL a new mailbox was associated with
the texture. Since the texture is cached indefinitely the mapping
between textures and mailboxes was growing forever. We can use
glProduceTextureDirectCHROMIUM to unbind textures and mailboxes in this
case.

BUG= 634012 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2207253002
Cr-Commit-Position: refs/heads/master@{#410204}

[modify] https://crrev.com/c5fb6dd04f15201c85d37695b647c0a08d8ee053/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_texture_mailbox.txt
[modify] https://crrev.com/c5fb6dd04f15201c85d37695b647c0a08d8ee053/gpu/command_buffer/service/gles2_cmd_decoder.cc
[modify] https://crrev.com/c5fb6dd04f15201c85d37695b647c0a08d8ee053/gpu/command_buffer/service/mailbox_manager_impl.cc
[modify] https://crrev.com/c5fb6dd04f15201c85d37695b647c0a08d8ee053/gpu/command_buffer/service/mailbox_manager_sync.cc
[modify] https://crrev.com/c5fb6dd04f15201c85d37695b647c0a08d8ee053/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp

Is there an ETA when the fix will get into a Chrome release?
Thanks!

Comment 7 by kbr@chromium.org, Sep 16 2016

Owner: jbau...@chromium.org
Not sure how I accidentally assigned myself to this. John, does your CL above fix this? Thanks.

Status: Fixed (was: Started)
Yeah, this should be fixed in M54.

Comment 9 by kbr@chromium.org, Mar 30 2017

Blocking: 706773

Sign in to add a comment