3 ms·
Firefox seems to never return any memory if you close tabs. My workaround for Firefox is using cgroups and limit memory for Firefox there, then it will not swap
by hawski 6y ago
Firefox seems to never return any memory if you close tabs. My workaround for Firefox is using cgroups and limit memory for Firefox there, then it will not swap trash on my 24GB RAM system. Also every couple of weeks I restart it to reclaim the memory, or faster if needed.
- geokon 6y agoOh this is an interesting workaround. Didn't know you can limit memory to processes. Ubuntu doesn't handle out of memory at all. The whole system just locks up and freezes (at least on 20.04) Like you say, it doesn't release memory so I need to restart periodically. If I forget then I need to do a hard restart when the system locks up (sometimes loosing work :/) It seems strange.. it used to handle hundred of open tabs just fine and now it's completely crippled. My guess is that in making the browser faster they cache more and more - and Firefox devs prolly run on fancy machines with tons of RAM.
- hawski 6y agoI think Firefox devs restart it many times a day during development, so they are not as affected. I think with 24GB of RAM I am at least on the edge of tons of memory qualifier and it still seems not enough after few weeks or intensive usage. Nevertheless it's baffling for me not to return the memory, but it's the default with small (roughly less than a page) allocations, because of how brk/sbrk work, Firefox should strive to do better.
- unnouinceput 6y agoI don't know what kind of PC and/or Firefox you have. I just test it by opening 20 more tabs on different heavy image sites (amazon, 9gag, reddit, twitter, instagram), with some having infinite scrolling and scrolled quite long. The memory jumped from 3.7 GB to 4.7 GB then closed them all. Task manager showed me the memory dropped down back to the original 3.7 GB. I can record a video if you don't believe it.
- hawski 6y agoWhat OS do you run? I'll try to replicate the issue on my side. I run Linux.
- unnouinceput 6y agoI thought it's obvious is Windows, since I dropped Task Manager as a name there. Or to be absolutely purist, my main OS is Windows under VMWare's hypervisor ESXi, but I have all of them (MacOS, Linux, Android, BSD) as guests on different HDD's/partitions.