Huge memory leak, possibly in WebGL (Windows and Linux)
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
| Performance Impact | low |
People
(Reporter: baegus, Unassigned, NeedInfo)
Details
(Keywords: perf:resource-use)
Attachments
(5 files)
Steps to reproduce:
I'm making a website that contains two games (using the Phaser.io game engine). Both are using WebGL for the rendering and one of them is loaded from an iframe. This (admittedly unusual) combination seems to eat up huge amounts of memory, even when the games are virtually doing nothing. It doesn't happen at all on Mac OS X, only on Windows and Linux builds of Firefox.
I have created a minimal reproduction page here (but you can also download the HTML files attached):
https://baegus.cz/phaser-firefox-webgl-memoryleak
- Download the attached source files and unzip them.
- Open index.html
- Scroll all the way down and then back up (to make sure both canvases started rendering).
Actual results:
The RAM usage starts skyrocketing (roughly 1% increase per second on my Windows machine).
Expected results:
The memory usage should stay the same, just like in any other current browser (tested in Chrome, Safari, mobile browsers...).
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Graphics: CanvasWebGL' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
I tested on Windows but I didn't not see any raise in memory use. I was looking at task manager. Perhaps there is something system specific here, maybe you could provide your about:support?
(In reply to Timothy Nikkel (:tnikkel) from comment #2)
I tested on Windows but I didn't not see any raise in memory use. I was looking at task manager. Perhaps there is something system specific here, maybe you could provide your about:support?
It does indeed seem like it's only happening on some systems. I tried it on three different computers (two with Windows 10 and one with Linux) and it happened on all of them, but my home computer with Windows 11 shows no signs of the memory usage increasing.
I'm attaching my about:support from the W10 laptop I initially tested this on.
Comment 5•2 years ago
|
||
Thanks for that. Any commonalities between the machines that show the problem? All AMD adaptors? All have some setting or extension in Firefox? I think I've seen Video DownloadHelper in some other reports of high memory usage.
(In reply to Timothy Nikkel (:tnikkel) from comment #5)
Thanks for that. Any commonalities between the machines that show the problem? All AMD adaptors? All have some setting or extension in Firefox? I think I've seen Video DownloadHelper in some other reports of high memory usage.
I just reproduced it on another laptop (attaching its about:support below). It's an Intel i5 machine, integrated GPU (which, I'm starting to think, might have something to do with it), fresh install of Firefox (no plug-ins).
I made two (anonymized) memory reports in about:memory, one before I opened the page and then one after it filled up a significant amount of memory. When I diff them, it does seem like there's a lot going on in the CPU section. Maybe someone can make sense of this?
(In reply to baegus from comment #8)
there's a lot going on in the CPU section.
GPU, not CPU. Sorry.
| Reporter | ||
Comment 10•2 years ago
|
||
(In reply to Timothy Nikkel (:tnikkel) from comment #2)
I tested on Windows but I didn't not see any raise in memory use. I was looking at task manager. Perhaps there is something system specific here, maybe you could provide your about:support?
So, I've made an another discovery: When you have a dedicated GPU (like my Windows 11 machine with RTX 3060), it fills up the GPU memory instead (which is why it doesn't touch the RAM and why it initially didn't seem reproducible on some computers).
I took a video of it in action:
https://youtu.be/kgdNJ0wPz0w
Updated•2 years ago
|
Comment 11•2 years ago
|
||
I can confirm this problem.
For me, the following site will trigger it reliable: https://www.bueromarkt-ag.de/ (page doesn't finish to load, loading indicator keeps spinning).
Note that memory usage will not get above 34GB on my system.
But I cannot reproduce in safe-mode :/
For me it started after the reboot for October patch day. I.e. Windows 11 CU for October 2023, NVIDIA driver update to 537.58 and Firefox 118.0.2 update.
Comment 12•2 years ago
|
||
I am not able to reproduce using the site posted by baegus.
I manually disabled all add-ons and I am still able to trigger the problem. So it must be a config change.
I have a firefox portable instance of the same version (but different config) where I cannot reproduce it yet.
Comment 13•2 years ago
|
||
I downgraded NVIDIA driver to previous version (537.42) but still have the problem.
Comment 14•2 years ago
|
||
I downgraded Firefox back to 118.0.1 but still have the problem.
I uninstalled Windows 11 CU from October and still have the problem.
Then I deleted Firefox cache and was able to access https://www.bueromarkt-ag.de/ for the first time and thought "problem solved, maybe an item in cache got corrupted which caused this". Then I logged into the shop and memory usage sky rocket again. Then I tried my other Firefox instances I mentioned in comment #12 where I was unable to reproduce and also logged into the shop and they are now also failing.
Comment 15•1 year ago
|
||
The Performance Impact Calculator has determined this bug's performance impact to be low. If you'd like to request re-triage, you can reset the Performance Impact flag to "?" or needinfo the triage sheriff.
Platforms: [x] Windows [x] Linux
Resource impact: Some
For more accurate tracking :Igor can you open a new bug to separate the perf issues from what :baegus is describing?
Comment 16•1 year ago
|
||
Redirect a needinfo that is pending on an inactive user to the triage owner.
:jgilbert, since the bug doesn't have a severity set, could you please set the severity or close the bug?
For more information, please visit BugBot documentation.
Description
•