3 ms·
Should the browser use all available memory?
- mastrsushi 5y ago> but also heavyweight programs like Teams You mean Skype running on top of chrome?
- hulitu 5y agoTeams is not heavyweight. It is overweight. Teams is so bad as an example that it shall be skipped in any discussion about computers.
- DoctorOW 5y agoand that's the problem I really expected to be explored in this article. They briefly touch on it but anyone who has Teams, Discord, Adobe, or any other of the growing number of programs based on Electron. Then there is literally multiple Chromes running at once.
- drdo 5y agoI never quite understood why there is no way to ask the kernel for "weak memory" that can be deallocated at the kernel's whim.
- zozbot234 5y agoIsn't MADV_FREE supposed to do that?
- skywal_l 5y agoBut this is for mapped (or shared) memory. Not reserved memory I think. No suitable to the OP's purpose: have reserved "optional" memory you could use for caching.
- skywal_l 5y agoI Should have RTFM: "The MADV_FREE operation can be applied only to private anonymous pages (see mmap(2)). In Linux before version 4.12, when freeing pages on a swapless system, the pages in the given range are freed instantly, regardless of memory pressure."
- rakoo 5y ago> If applications leveraged files instead of anonymous memory to implement their caches, then the system’s file buffer cache would do the right thing I've always thought this should be the standard way of doing caching. It's also explained at length in this article by the author of Varnish: https://varnish-cache.org/docs/trunk/phk/notes.html https://varnish-cache.org/docs/trunk/phk/notes.html. Contrary to what TFA is saying, performance under "normal" use would be the same: the data is in RAM. It doesn't change that it is backed by a file or not.
- jmmv 5y agoOh thanks. I wasn't aware of that article nor that Varnish did exactly this :) Updated the text of my post to incorporate it. And when I said performance would suffer, I was not implying it'd be terrible. I was trying to say that the extra open/close system calls are overhead that you don't directly pay with direct memory accesses. But... the overall impact of those on system performance would likely be invisible. Also clarified this.
- ogurechny 5y agoPeople in commercial web development simply don't care about websites they make, and no smart memory management can help it. After the silent deprecation of 32 bit systems and 32 bit browsers, some websites manage to munch gigabyte(s) of memory without even doing anything, simply because they won't have any repercussions from doing that in 64 bit virtual memory space. If I were making the rules, I would use some conservative browser with a lot of non-standard settings, like Palemoon, and limit it to a gigabyte of real memory. If the website survives, then we can talk.