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

Issue 808912 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
OOO until 2019-01-24
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

GPU process big memory leak

Reported by lih...@gmail.com, Feb 5 2018

Issue description

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

Steps to reproduce the problem:
Open the attached sample code in Chrome, and see the GPU process memory keeps increasing in task manager.

What is the expected behavior?

What went wrong?
It is a bug about memory leak caused by WebGL 1.0. Simply open this attached file which contains a very simple WebGL sample in Chrome, one will see the GPU process CPU memory keeps increasing at each time the program calls gl.bufferData. This webgl function is to upload data from CPU to GPU. Chrome will first copy memory from user thread to GPU thread, and then transfer to GPU. But GPU process doesn't release its version after uploading, and cause a big chunk of memory leak.  

Here is the code snippet that causes the suspicious memory leak.

var ab = new ArrayBuffer(1024 * 512);
var buffers = new Array(10000);
for (var i = 0; i < 10000; i++) {
buffers[i] = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, buffers[i]);
gl.bufferData(buffers[i], ab, gl.STATIC_DRAW); // This line will make memory leak in GPU process.
}

Crashed report ID: 

How much crashed? Just one tab

Is it a problem with a plugin? No 

Did this work before? N/A 

Chrome version: 64.0.3282.140  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
memoryleak.zip
25.2 KB Download
Labels: Needs-Triage-M64
Cc: pnangunoori@chromium.org
Components: Blink
Labels: Needs-Feedback
Tested on Chrome Stable #64.0.3282.140 on Windows 10 and not able to reproduce the issue. Attached the screenshot for reference.

Steps followed:
1. Launched Chrome.
2. Opened the sample file provided in the attachment.

Observations -- Memory value is displayed constantly and crash is not observed.

@lihw81 -- Could you please try by removing the extensions and creating a new profile to verify if the issue still persists. Also, please share the Crash ID generated in chrome://crashes.

Please let us know if we have missed anything.

Thanks in advance.

808912.PNG
47.1 KB View Download

Comment 3 by lih...@gmail.com, Feb 12 2018

@pnangunoori,

Thanks for prompt reply. The screenshot your pasted just shows the problem. The memory of GPU process goes up to 1G which is almost equal to the GPU memory. 

Is it normal? 

If we modify the attached the sample to increase the loop number, which adds more buffer allocation, the Chrome will crash easily. 
Project Member

Comment 4 by sheriffbot@chromium.org, Feb 12 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "pnangunoori@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Hi there, I think the image pnangunoori uploaded shows that the CPU memory is not well explained the problem, if you can expand the task manager to show the CPU and GPU memory, you can find that it takes 1G of the GPU memory and 1G CPU memory at the same time.So there is no CPU been released. 
Also I found that if call the deleteBuffer, it will release the memory both on CPU and GPU.
test.jpg
1.0 MB View Download

Comment 6 by rtoy@chromium.org, Feb 13 2018

Components: -Blink Blink>WebGL
Status: Untriaged (was: Unconfirmed)
Cc: jmad...@chromium.org

Comment 8 by kbr@chromium.org, Feb 13 2018

Cc: geoffl...@chromium.org
Components: Internals>GPU>ANGLE
Labels: Needs-Feedback
Submitter: what did you expect to happen? Your sample above allocates 5 GB of GPU resources. I'm not sure whether ANGLE has to shadow these allocations with CPU-side memory (geofflang@, jmadill@, can you comment on this?).

ANGLE will keep the buffer data in CPU memory until it's known how the buffers will be used and even then the CPU shadows may be kept around if they are accessed repeatedly.
It's also worth noting that on Windows the process's total memory always includes the GPU memory.
Yeah, not quite clear why this is referred to as a memory leak when the test keeps handles to the buffers, and the memory is correctly cleared on deletion.

Comment 12 by kbr@chromium.org, Feb 13 2018

Owner: kbr@chromium.org
Status: WontFix (was: Untriaged)
The submitter is probably complaining about the CPU-side shadow copies.

Submitter, I'm sorry, but this is working as intended. If you have a specific change you would like to make affecting ANGLE's policies for CPU-side shadow copies of buffers, patches are welcome.

Comment 13 by lih...@gmail.com, Feb 22 2018

Thanks for answers. We did complain about the shadow copy of buffer data. We didn't know ANGLE did that deliberately. We will head to ANGLE community for possible solutions. 

Sign in to add a comment