4 ms·
512MiB no mater how much RAM you have. Keep in kind this is based on "it seems to do the trick" rather than any proper reasoning. But hey, so is the article, I
by cosarara 7y ago
512MiB no mater how much RAM you have. Keep in kind this is based on "it seems to do the trick" rather than any proper reasoning. But hey, so is the article, I guess.
My reasoning is as follows (ams concludes that swap does nothing):
4GB RAM, no swap.
Firefox allocates all RAM. Linux starts taking the program code and data sections out of disk. Serious thrashing. Hang.
4GB, some swap.
Firefox allocates all RAM.
Some stuff is in swap. Firefox allocates more memory. Swap is full of firefox's stuff. RAM is full of firefox's stuff. Linux starts taking the program code and data sections out of disk. Serious thrashing. Hang.
It's the same thing, just more complicated thus harder to debug. It will behave better,
if you never get to fill RAM+swap. But today's programs simply allocate more. And the kernel says yes.
IMO the real solution, given that we overcommit, is for firefox to check that % RAM usage you see in top(1) and to try to not let it go above 95% by freeing cache, and for the kernel to do OOM killing early.
- icebraining 7y ago> IMO the real solution, given that we overcommit, is for firefox to check that % RAM usage Doesn't it to that already? I remember 3-4 years ago I use to watch in amazement how people complained that Firefox ate over 2GBs of memory, whereas I ran it on a laptop with 2GB total, and FF rarely hit 1G even with dozens of tabs open. EDIT: Mozillazine seems to confirm my experience: "These numbers will vary because Firefox is configured by default to use more memory on systems that have more memory available and less on systems with less" (http://kb.mozillazine.org/Reducing_memory_usage_-_Firefox http://kb.mozillazine.org/Reducing_memory_usage_-_Firefox)
- szatkus 7y agoThis is annoying on Android. System normally would kill (or suspend or whatever Android exactly does in those circumstances) other applications if Firefox ate too much of memory. And I would be happy with that, but unfortunately under memory pressure Firefox kills less important tabs. With memory hog in the backgrounds (these wonderful mobile games) I can jump between maybe 2 or 3 tabs before Firefox starts killing.
- dredmorbius 7y agoThere are small systems in which 512 MB (or MiB) isn't available, but in which some swap might conceivably be useful. Mostly networking gear, which still ships with absurdly low storage/memory allocations (my DLS router is 64 MB RAM, 8 MB flash, as an example). Not unviable under the stock OEM firmware, but confining when switching to, say, OpenWRT. Not that I'd know about this or anything.