Linux – Why does Linux use a swap partition when the kernel supports paging/virtual memory anyway

linuxmemoryoperating systemspagingvirtual-memory

As far as I understand paging and swapping, they're completely different concepts. While swapping means, that a process is either completely in physical memory or on the hard drive, with paging parts of a process can be in physical memory and other parts can be on the hard drive.

But why does linux need a swap partition then? If the physical memory is full, some processes will be outsourced to the hard drive and a new process will be mapped from virtual memory to physical memory.

I just don't get why one needs a swap partition (or swapping in general) then?

Or is this just a matter of terminology and swap partition == virtual memory?

Best Answer

Yes it is just a matter of terminology, in many cases a swap partition is used as virtual memory.

The reason UNIX and UNIX-like systems prefer swap partitions to page-files is that they can be contiguous which results in lower seek times compared to a page-file which may be fragmented.