On 15/12/17 10:39 AM, Wols Lists wrote:
For most of its history, the twice ram rule has been a "needed for optimum performance", not a hard and fast "needed or it won't work" rule, but it is solidly based in historical fact.
For traditional Unix, and pre-2.4 linux, even if it wasn't a hard requirement it also had a real performance impact thanks to the optimisations required to deal with "too small" swap spaces.
*Sigh* The moment we mention 'traditional UNIX' my hackles go up. Are we talking post 4.2 Berkeley on the VAX with hardware (even if inadequate) support for paging? Are we talking pre-4.2 with pre-paging aka swap-in/swap-out? Are we talking the mess that Bell Systems Group did with SYSIII and SYSV (let's not even think about SYSIV!) UNIX? So much of this talk is of swap space but it not being used for swap, it's being used for EITHER demand paging memory overflow ==> call this 'page-out space' OR hibernation The latter DOES require AT LEAST as much disk space as memory space, plus any additional that might be needed for any page overflow. If you are NOT hibernating then you may not need page-out space. Why would you need 'page-out- space? That's the issue. I have ideas about that and they are based on experience rather than theory, but for most non-public-server applications I can see the 2G being all that's required for initialization. Traffic analysis might show you need more, but it is easy enough to add more as a partition or as a 'swap file'. Real world =/= Theory But PLEASE DIFFERENTIATE: Swapping and demand page overflow page-out space are not the same thing. If you have a virtual memory system that is 'paging', that is, it is swapping out the whole of the working set of a process to make room for the working set of another process, then you are 'thrashing'. You are in dire straits and something is wrong. It is usually an indication that your system is memory starved, and on a modern system that should not happen -- unless you are running a web browser with lots-and-lots of open tabs. As I see it, lots-and-lots of open tabs means lots-and-lots of open file descriptors in the kernel. The kernel can malloc(), it's internal tables can grow. See 'kmalloc()' and 'vmalloc()'. One such is dynamically loading kernel modules using "modprobe(8)". You might want to think, 'does the kernel free up that space when you remove one with "modprobe -r"?' And what about the other kernel tables, for example the open file and open network and the buffers needed for the network connections as they are opened? Does the kernel VM do page-out? I don't think so. So as the kernel grow the user space decreases and that does the page-out or the amount of memory for the working sets decreases and perhaps to a point where there is thrashing. So when I map my 80+ tabs of Firefox, of which only 4 are actually open, to Chromium, where there is a process for each tab and a each has an open network connection, no wonder my machine freezes! All of a sudden it is so busy thrashing it can't do any useful work. THAT is the point where I need to SWAP. Swap out whole processes, wholesale, rather than treating them as sets of pages and trying to maintain them all. But Linux doesn't swap? -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org