Intermediate Topic 27 of 51 Operating Systems
Paging
Splitting memory into fixed-size blocks mapped on demand.
How it works
Paging divides virtual memory into fixed-size pages, typically 4 KB, and physical memory into frames of the same size. A page table maps each virtual page to a frame, so a process's memory need not be contiguous and external fragmentation disappears. The address splits into a page number and an offset. Multi-level and inverted page tables reduce table size, and the TLB speeds up translation.
Step-by-step walkthrough
- Memory is split into fixed-size pages and frames.
- A virtual page number is looked up in the page table.
- The entry points to a physical frame.
- Pages not in use stay on disk.
- Fixed sizes avoid external fragmentation.
Where it is used
Virtually all modern general-purpose OSs use paging, enabling demand loading, shared memory, copy-on-write and per-page protection with read, write and execute bits.
Common pitfall
Internal fragmentation wastes part of the last page of each allocation. Page tables themselves consume memory, and misses in the TLB add latency. Small page sizes mean bigger tables, large pages mean more waste. Huge pages help databases but complicate allocation. Remember that the page table is per process.
Where it fits in the course
Paging is topic 27 of 51 in Operating Systems, rated Intermediate. It follows Memory Management. The next topic is Segmentation.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Operating Systems quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Operating Systems quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Paging?
Where do people use Paging?
What is the most common mistake with Paging?
What should I learn before this topic?
How can I practice it?
Is Paging hard to learn?
How long does it take to learn Paging?
Which topics are related to Paging?
What should I study after Paging?
Related topics
- Memory Management (Operating Systems)
- Segmentation (Operating Systems)
- Dining Philosophers (Operating Systems)
- Virtual Memory (Operating Systems)