What Is Virtual Memory on Linux? How to Manage It
Virtual memory is a way of representing your memory that's abstracted from the physical memory on your machine. It makes use of both your RAM and your storage space, whether that's on a traditional hard drive or an SSD.
In Linux, this is done at the kernel and hardware levels. The CPU has a piece of hardware called a Memory Management Unit (MMU) that translates physical memory addresses into virtual ones. These addresses are independent of where they physically reside on the machine. These address spaces are known as "pages" and they could be in RAM or on your hard drive or SSD. The OS sees these addresses as one big pool of memory, known as an "address space."
Virtual memory takes advantage of the fact that not all of the memory that's being used in theory is being used all of the time. Programs in memory are broken down into pages and the parts that the kernel deems as unnecessary are "swapped out," or moved to the hard drive. When they're needed, they can be "swapped in," or brought back into RAM.
The space used for virtual memory on a drive is known as "backing store," or "swap space." In the Windows world, it's usually implemented as a file, known as a "swap file." It's also possible to do this in Linux, but it's much more common to use a dedicated disk partition.
- Login or register to post comments
- Printer-friendly version
- 516 reads
- PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
today's howtos
| Open Hardware: XON/XOFF and Raspberry Pi Pico
|
Security Leftovers
| How to Apply Accent Colour in Ubuntu Desktop
A step-by-step tutorial on how to apply accent colour in Ubuntu desktop (GNOME) with tips for Kubuntu and others. |
Recent comments
2 days 1 hour ago
2 days 5 hours ago
2 days 5 hours ago
3 days 12 hours ago
3 days 13 hours ago
3 days 14 hours ago
3 days 14 hours ago
3 days 15 hours ago
3 days 17 hours ago
3 days 19 hours ago