Virtual memory is an OS abstraction managed by the MMU (Memory Management Unit) that maps process address spaces to physical RAM. Each process gets its own isolated address space via page tables swapped on context switches. The kernel exposes this via syscalls like mmap, which libc uses to implement malloc. Key uses include process memory isolation, shared memory, memory-mapped I/O (files, hardware registers), swap space, and executable page mapping for JITs and program loaders. Security mechanisms like W^X (writable XOR executable) help reduce risk from writable executable pages.

4m read timeFrom drewdevault.com
Post cover image

Sort: