openskills.info
Course Preview

Virtual Memory

Virtual memory gives each process a private address space and maps its addresses to physical memory or other backing storage. The operating system and processor cooperate to provide isolation, controlled sharing, and demand-loaded pages.

itOperating systems

Don't Panic — Virtual Memory

Virtual memory is the arrangement that lets a program use its own stable addresses while the processor and operating system decide where the data lives. It exists because handing every program a map of physical RAM would make sharing, protection, and moving data about roughly as relaxing as organizing a library during an earthquake.

The important split is between a virtual address, which a program uses, and a physical page frame, which is where a page happens to be resident. The MMU translates one into the other through page tables, with a TLB keeping recent answers nearby. The address can remain useful while its backing page is copied, discarded, loaded from a file, or restored from swap. Stability above; activity below.

A page fault is the phrase most likely to sound like a fire alarm while doing ordinary work. It is a control transfer to the kernel because the current mapping cannot finish the access. First use of anonymous memory can allocate a zero-filled page. A file mapping can fetch a page. A copy-on-write write can make a private copy. The bad version is an access the mapping or permissions cannot authorize.

The second trap is asking, “How much memory does this process use?” as though the machine had prepared one polite answer. Virtual size describes mapped or reserved address space. RSS describes pages resident for a process. PSS divides shared resident pages among their users. Commit describes promised writable backing. Each number is correct; none is a complete biography.

When physical memory tightens, the kernel reclaims pages outside the active working set. Clean file-backed pages can leave and return from their file. Anonymous pages may use swap when it is available. If the same pages are evicted and faulted back repeatedly, the system is thrashing: it has turned useful work into an elaborate courier service for its own data.

Read the intro for the translation path and backing choices. Use the slides when the distinctions between a TLB miss, page fault, and reclaim path need a compact map. Keep the cheatsheet nearby for the accounting terms and diagnostic rules. Field Notes adds the operational signals that tell you when a technically valid arrangement has become a performance problem.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources