What is the acceptable amount of ram a browser should be using? Is there a way of knowing how much is “wasted”? Is it even possible to waste ram, like what is wasted, time? Electricity?
It’s only a problem if it doesn’t give it up when other apps need it and there’s not enough. Browsers just cache a bunch of shit in memory for speed and convenience, but they should unallocate it back to the pool if something else calls for it. The internet complaining about this for years and years are mostly doing so from a place of ignorance.
The issue is that browsers don’t release much memory back to the system when it’s needed. I wish they’d work more like the Linux kernel’s VFS caching later, but they don’t (and might not be able to. For example, I do don’t think the Linux kernel has good APIs for such a use case).
You can write limits to and then poll files in /proc/pressure/ to be notified of resource pressure. Systemd will also set an environment variable for similar files for your cgroup.
The issue is that browsers don’t release much memory back to the system when it’s needed. I wish they’d work more like the Linux kernel’s VFS caching later, but they don’t (and might not be able to. For example, I do don’t think the Linux kernel has good APIs for such a use case).
It does release it back to the system. It only doesn’t if you actively have a ton of windows/tabs open, in my experience. Even then, it’ll cache stuff to disk after awhile. Like on my phone, I’ve easily had over 20 tabs open in Firefox (Android) and it doesn’t suck up all of my phone’s ram (which only has 12GB). If your system is running less than 16GB, then that’s another matter and you really should add more, as 16GB is pretty much the baseline on computers these days.
What is the acceptable amount of ram a browser should be using? Is there a way of knowing how much is “wasted”? Is it even possible to waste ram, like what is wasted, time? Electricity?
Its being wasted if a memory leak causes it to use all 32 gigs of ram and crash
It’s only a problem if it doesn’t give it up when other apps need it and there’s not enough. Browsers just cache a bunch of shit in memory for speed and convenience, but they should unallocate it back to the pool if something else calls for it. The internet complaining about this for years and years are mostly doing so from a place of ignorance.
The issue is that browsers don’t release much memory back to the system when it’s needed. I wish they’d work more like the Linux kernel’s VFS caching later, but they don’t (and might not be able to. For example, I do don’t think the Linux kernel has good APIs for such a use case).
You can write limits to and then poll files in
/proc/pressure/
to be notified of resource pressure. Systemd will also set an environment variable for similar files for your cgroup.The issue is that browsers don’t release much memory back to the system when it’s needed. I wish they’d work more like the Linux kernel’s VFS caching later, but they don’t (and might not be able to. For example, I do don’t think the Linux kernel has good APIs for such a use case).
It does release it back to the system. It only doesn’t if you actively have a ton of windows/tabs open, in my experience. Even then, it’ll cache stuff to disk after awhile. Like on my phone, I’ve easily had over 20 tabs open in Firefox (Android) and it doesn’t suck up all of my phone’s ram (which only has 12GB). If your system is running less than 16GB, then that’s another matter and you really should add more, as 16GB is pretty much the baseline on computers these days.
Empty ram is wasted ram. In theory the system should use whatever is available to cache and streamline.