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:
,
Feb 7 2018
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.
,
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.
,
Feb 12 2018
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
,
Feb 12 2018
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.
,
Feb 13 2018
,
Feb 13 2018
,
Feb 13 2018
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?).
,
Feb 13 2018
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.
,
Feb 13 2018
It's also worth noting that on Windows the process's total memory always includes the GPU memory.
,
Feb 13 2018
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.
,
Feb 13 2018
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.
,
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 |
|||||||
Comment 1 by manoranj...@chromium.org
, Feb 6 2018