▲ | man8alexd 4 days ago | |||||||
You are both confusing swap and memory overcommit policy. You can disable swap by compiling the kernel with `CONFIG_SWAP=no`, but it won't change the memory overcommit policy, and programs would still be able to allocate more memory than available on the system. There is no problem in allocating the virtual memory - if it isn't used, it never gets mapped to the physical memory. The problem is when a program tries to use more memory than the system has, and you will get OOMs even with the swap disabled. You can disable memory overcommit, but this is only going to result in malloc() failing early while you still have tons of memory. | ||||||||
▲ | Rohansi 3 days ago | parent [-] | |||||||
Overcommit is different. We are referring to infrequently used memory - allocated, has been written to, but is not accessed often. | ||||||||
|