Skip to main content
CSOS & ConcurrencyDiagramIntermediate

Paging

KO: 페이징 (Paging)·EN: Paging·JA: ページング(Paging)

A memory management scheme splitting virtual and physical memory into fixed-size pages and frames to eliminate external fragmentation via page tables and TLBs

Table of Contents

Structure Diagram

Paging: Virtual Page → TLB / Page Table → Physical FrameTap a node
Fast pathPage walkPFN+OffsetFill TLBVirtual […TLB Cache…Multi-Lev…Physical …
ROOTVirtual [VPN | Offset]
2 links
Quick Answer

What is Paging?

A memory management scheme splitting virtual and physical memory into fixed-size pages and frames to eliminate external fragmentation via page tables and TLBs. It is a core concept in OS & Concurrency within CS.

Core Principles

Paging divides virtual address spaces into fixed-size pages (typically 4KB) and physical RAM into matching frames, allowing non-contiguous physical allocation.

  • Eliminates External Fragmentation: Any free physical frame can back any virtual page, leaving only minimal internal fragmentation on the final page.
  • Multi-Level Page Tables & TLB: Modern 64-bit CPUs use 4–5 level radix page tables to stay compact, accelerated by the hardware TLB (Translation Lookaside Buffer) cache.

Practical Takeaways

  • Enable Huge Pages (2MB/1GB) for large heaps: Databases (PostgreSQL) and large JVMs reduce TLB misses and page-table overhead dramatically with explicit huge pages.
  • Be cautious with Transparent Huge Pages (THP): Background page compaction can trigger latency spikes in Redis or MongoDB, so many ops guides disable THP.
  • Minor vs Major Page Faults: Minor faults wire already-cached RAM pages quickly; Major faults block on disk I/O.

Notable Examples

  • x86-64 (4KB) & Apple Silicon (16KB) Hardware Paging.
  • OS Page Replacement: Linux active/inactive LRU lists and Clock algorithms evicting cold pages.