New issue
Advanced search Search tips

Issue 897733 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 29
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug

Blocked on:
issue 898613
issue 899035



Sign in to add a comment

GPU memory leak uploading OffscreenCanvas to WebGL texture

Reported by a...@scirra.com, Oct 22

Issue description

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

Steps to reproduce the problem:
Our framework Construct 3 has started using OffscreenCanvas. We discovered a memory leak involving uploading OffscreenCanvas to a WebGL texture. Our framework renders text in a WebGL game by first drawing text on a 2D canvas, uploading the canvas to a texture, and then drawing a quad with the texture. Switching the DOM canvas to an OffscreenCanvas, and inserting a call to transferToImageBitmap() (which used to be necessary since direct upload of OffscreenCanvas was not originally supported), results in endlessly increasing GPU memory until it kills the WebGL context.

To reproduce simply open the following URL, maximise the window (to reproduce quicker), and observe GPU memory in Chrome's task manager:

https://www.scirra.com/labs/bugs/gpumemleak/offscreencanvas/index.html

What is the expected behavior?
Compare to identical code but using DOM canvas instead:

https://www.scirra.com/labs/bugs/gpumemleak/domcanvas/index.html

This does not leak.

What went wrong?
The OffscreenCanvas version leaks GPU memory.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 70.0.3538.67  Channel: stable
OS Version: 10.0
Flash Version: 

Removing the now-unnecessary call to transferToImageBitmap() also avoids the memory leak. However there should not be a memory leak even with the call to transferToImageBitmap().
 
Cc: fs...@chromium.org
Labels: -Pri-2 Pri-1
Status: Available (was: Unconfirmed)
Ash, thanks for the report! We will get to it as soon as possible. :)
Owner: fs...@chromium.org
Status: Assigned (was: Available)
Blockedon: 898613
Blockedon: 899035
Both GC issues are fixed, sending the actual ImageBitmap fix now:
https://chromium-review.googlesource.com/c/chromium/src/+/1297067

stay tuned.
Status: Fixed (was: Assigned)
Donerine! :)
Labels: TE-Verified-M72 TE-Verified-72.0.3596.0
Able to reproduce the issue on chrome reported version 67.0.3538.67
Verified the fix using Windows-10 on Chrome version #72.0.3596.0 as per the comment#0
Attaching screen cast for reference.
Observed "NO GPU memory leakage on chrome Task Manager"
Hence, the fix is working as expected.
Adding the verified label.

Thanks!


897733.mp4
2.9 MB View Download

Sign in to add a comment