Open Bug 1436848 Opened 8 years ago Updated 2 years ago

gpu-commited memory leak in github.com pdf viewer

Categories

(Core :: Graphics, defect, P3)

58 Branch
x86_64
Windows 10
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jnk0le, Unassigned)

References

Details

(Keywords: memory-leak, Whiteboard: [gfx-noted])

Attachments

(2 files)

462.41 KB, application/x-zip-compressed
Details
181.55 KB, application/x-gzip
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0 Build ID: 20180206200532 Steps to reproduce: using i5-2410M (attached about_support.txt), in case if it is driver related. 1. Push any pdf into github repository, or use the one that I have provided with 3 typical files, of different sizes and behaviours. https://github.com/jnk0le/firefox_memory_leak_test 2. Go to github webpanel and just open pdf through their javascript pdf viewer (do not use browser's builtin viewer) 3. Mess with this up. (refreshing, multiple "open in new tab", going back and forth, and loading more than 50 pages of long datasheets). 4. Kill "affected" tabs. Actual results: Enormous memory usage in all of the tested browsers with folowing differencies; Edge: - always releases memory except when I use "go back" button. - majfriend_watermarked.pdf mostly crashes (page unresponsive, memory released after killing tab) Chropera: -Releases memory only when I kill "affected tab". -Leak doesn't stack while refreshing. FF: - Doesn't release memory automatically (especially when using 12GB out of 6GB physical memory) - 3 to 10 minutes after killing "affected" tabs I can get back to normal usage by doing "Minimize memory usage" button in about:memory. - also majfriend_watermarked.pdf rendering is rendered extremly long (single thread 100% usage, just scroll down to last page and wait). attached: memory-report_before.json.gz - long.pdf opened up to page 600 in one tab. memory-report_after.json.gz - few minutes after closing tab. memory-report_after_minimize_memory.json.gz - after doing "Minimize memory usage" button in about:memory. Expected results: 1. Memory should be released after tab kill. 2. 2 megabyte PDF should not make 2+ gigabyte of memory usage.
I have managed to get auto kill of leaking firefox.exe process by not opening/activating more than one tab in addition to the leaking one.
Starting firefox on gt520M: - at first time, some pages were hung in a "blank page loading" state for a few minutes. - Visible stuttering while scrolling.(absolutely random - stutters for first 5 minutes and gets normal for another 3 minutes) - didn't fix the leak.
Keywords: memory-leak
OS: Unspecified → Windows 10
Hardware: Unspecified → x86
Hardware: x86 → x86_64
Component: Untriaged → PDF Viewer
It's not about FF pdf.js
Component: PDF Viewer → Graphics
Product: Firefox → Core
After updating nvidia driver from 390.65 to 390.77, I noticed that when tab playing YT videos, somehow assigned to leaking process, autoplays another video, it clears leak in this exact process.
See Also: → 1432086
Andrew, can you take a quick look as to where the memory is going? If this is eventually getting released, it sounds more like caching than leaking?
Flags: needinfo?(aosmond)
Priority: -- → P3
Whiteboard: [gfx-noted]
Bug 1432086 might be similar bug.
On Linux it all goes to heap-unclassified, and gets freed a short period (< 30 seconds) after closing the tabs. I tested setting dom.ipc.processCount to 1 to ensure it wasn't simply just tearing down the process. On Windows, it is all in gpu-commited memory, which is gotten via D3DKMTQueryStatistics. That API isn't documented, so it isn't clear to me what the caveats are. Since the memory minimize has an impact, it is probably the font cache, the texture cache/pools, or the gradient cache causing the problem. The texture pools should automatically clear themselves after 5 seconds of inactivity (short of the timer failing to arm due to OOM), and I'd be surprised if the fonts took this much. So perhaps Sotaro is right, since bug 1432086 has gradient related issues.
Flags: needinfo?(aosmond)
The leak seems to happen with DrawTargetD2D1 backed 2d Canvas. When I changed gfx.canvas.azure.backends to "skia,cairo", I did not saw the high gpu-commited memory.
Ah, Bug 1432086 seems like a different bug. In Bug 1432086, memory did not decrease even with "Minimize memory usage" button in about:memory.
Flags: needinfo?(sotaro.ikeda.g)
Attached file memory-report.json.gz
This time I was able to "minimize" only part of memory (and generate crashes). The rest in this file is a hard leak.
Comment on attachment 8985468 [details] memory-report.json.gz I didn't "minimized" but closed all tabs except a one or two. It was not able to minimize anything more than 100MB.
Nightly 62.0a1 seems to properly deallocate that memory.
(In reply to jan from comment #14) > Nightly 62.0a1 seems to properly deallocate that memory. Unless leak is large enough to start swapping, then it will not auto release.
Severity: normal → S3
Flags: needinfo?(sotaro.ikeda.g)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: