Running a video claims 1-2 MiB/s into heap-unclassified without ever releasing it
Categories
(Core :: Audio/Video: Playback, defect)
Tracking
()
People
(Reporter: sworddragon2, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: regression)
| Reporter | ||
Updated•7 years ago
|
Comment 1•7 years ago
|
||
| Reporter | ||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
| Reporter | ||
Comment 4•5 years ago
|
||
Over the past after my last post I saw this issue still very often. As I also switched to Windows 10 in this time this issue is not limited to Linux.
There are also some reports about memory leaks on Twitch here but none that I have found seem to be really the issue I'm seeing experiencing or the tickets are mainly focussing on CPU issues and just mentioning memory issues slightly. But here is the behavior I have observed so far (might be very slightly off from my memory or changes in Firefox over the course of time):
- Closing all tabs and leaving Firefox alone for a while (hours up to the next day) after accumulating several GiB of memory via this issue causes Firefox to keep the memory for usually several hours but it might be released after several hours later (like the next day).
- Going to about:memory and minimizing the memory usage does free the several GiB of memory.
- This troublesome memory accumulation of Firefox has a very good chance triggering Windows's Resource Exhaustion Detector (which happened here already several times) which then usually kills multiple processes causing potential data loss (even out of Firefox).
- There are many people blaming on this issue on the internet (like reddit) and some information hints that the memory accumulating here might actually come from the chat instead of the video.
The first 2 points imply that this issue is not a hard memory leak as Firefox still can reach the allocated memory at any time. It might be some sort of cache or something similar that is just not being released in a sane manner. Eventually this hint makes this issue much easier to fix.
The last point implies that this issue might also affect many other websites (but just on a very much lower level as they do usually not accumulate information on idle like a Twitch stream does). If this is the case it might be even more worth investigating this issue as it might significantly improve Firefox's overall memory usage.
| Reporter | ||
Comment 5•5 years ago
|
||
On Firefox 73.0.1 I did now test this on a new profile to figure more out:
- With a new profile without changing anything the issue doesn't reproduce.
- I figured out that the combined settings of enabling private browsing mode and setting privacy.resistFingerprinting to true causes this issue to reproduce (but only with a chance of 10%-20% on opening a stream). I did also test a while against each of both settings individually but could never reproduce the issue this way.
- In private browsing mode one of the Firefox processes increased its memory usage continuously when watching a stream on Twitch. It started at around ~130 MiB and increased at a rate of ~1 MiB/sec until ~180+ MiB where it did reset to its initial value of ~130 MiB when the issue did not reproduce. As a note the actual rate of memory increasement was dependent on the video quality. The rate of 1 MiB/sec was achieved on 1080p (which is the source quality for most streams) which utilized on average 8 Mibit/sec network traffic.
- The above implies the increasement of memory could be actually the caching of the stream in memory since the memory increasement matches the network traffic. Disabling permanent private browsing mode causes the related Firefox process to not increase its memory and thus stalling at ~150 MiB. However, permanent disk activities occur at this time possibly due to caching the stream on disk instead of memory and thus supporting the above theory that the increase in memory is from caching the stream into memory. Additionally once the issue appears going to about:memory and clicking GC and CC do not significantly decrease the memory usage (only around a few MiB) but only minimizing the memory usage will.
- Setting privacy.resistFingerprinting to true has now a good chance to prevent the process of resetting the memory (assumingly flushing the cache). If this issue does not occur on a stream simply reloading the site can change this (the already mentioned 10%-20% chance).
Also here are the new STR based on the above information:
- On a new profile enable permanent private browsing mode and set privacy.resistFingerprinting to true and restart the browser.
1.1 If Firefox asks you at any time now if you want to request the english version of websites answer No (however, the choice here probably doesn't matter). - Go to https://www.twitch.tv and open any stream.
2.1. If the stream notifies you that the content is being targeted at adults click that you still want to watch it. - In the Twitch video player set the video quality to the highest possible value (recommended 1080p).
- Open the task manager and go to the Details register. Look for a Firefox process that increases constantly its commited memory. It starts on around 130 MiB and increases about 1 MiB/sec (if 1080p have been chosen previously).
- If this Firefox process does increase its memory to only around ~180-200 MiB and then resets to ~130-150 MiB or if you see many drops of just a few MiB the bug did not trigger. In this case simply click the reload button to reload the site. Repeat this step until you don't see those memory drops anymore (might need 5-10 tries (or more if very unlucky)) and the Firefox process accumulates 500 MiB of memory as safety.
- Close all tabs and wait some minutes and then check the memory usage of this Firefox process again.
- Go to about:memory, click "Minimize memory usage" and check the memory usage of this Firefox process again.
After step 6 the memory is still not being freed but after step 7 it is.
Comment 6•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•3 years ago
|
Description
•