OpenBSD Virtual Memory

Today, we answer the following questions about OpenBSD’s virtual memory system: How are contiguous regions of memory managed? How is memory freed? What happens when the kernel runs out of memory? Is there any special code for Non-Uniform Memory Access (NUMA) architectures? How is physical memory managed? Does it assume more virtual than physical memory? What are its data structures which store information about memory? Along the way, I’ll show the relevant parts of the...

RadixVM

So far this blog has investigated the virtual memory interface in POSIX, and dived into some of the details of how it’s implemented in BSD. Today, we’ll look at the state of the art in academic virtual memory design, in particular a design called RadixVM by Austin T. Clements, M. Frans Kaashoek, Nickolai Zeldovich at MIT’s CSAIL. Background Recall that virtual memory allows us to pretend that each process has exclusive access to a huge...

BSD Virtual Memory

After the article on POSIX memory management, we have a good grasp of the high-level memory allocation functions specified in POSIX.1. We learned how malloc is a C library function which can be implemented using mmap. Now it’s time to dive into the details about how mmap is implemented. Under the hood, mmap touches a fundamental concept in operating systems. Specifically, it must interface with the kernel’s implementation of virtual memory. Virtual memory is the...