I am interested in obtaining (or building myself) a version of the Linux kernel that has absolutely no virtual memory and none of its attendant overhead. No swap file, no nothing.
What are my options?
I am interested in obtaining (or building myself) a version of the Linux kernel that has absolutely no virtual memory and none of its attendant overhead. No swap file, no nothing.
What are my options?
As far as I know, you cannot disable the concept of virtual memory in Linux, at least not without totally rewriting it. It's an integral part of the memory management and lots of stuff simply would cease to work if you could disable it.
The mmap
call can be used to map a file or a device to a part of an application's virtual memory (every application has 4 GB virtual memory on 32 bit, and 16 EB on 64 bit). For example, an application could mmap
several megabytes of the hard disk into its own virtual memory. It could then access this part of the hard disk just by accessing its own memory—the kernel will automatically fetch the required data from the hard disk, store it in the RAM and return this data to the application. If you could disable virtual memory, this application would now no longer work.
On the other hand, swap can be disabled very easily, just by running swapoff -a
or not setting up swap partitions in /etc/fstab
at all.
fork
nigh-impossible to implement, which puts a serious crimp in a unix system. – Gilles 'SO- stop being evil' Sep 20 '13 at 00:35