LearnViz CompSci
Home / Learn / Operating Systems / Paging

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

  1. Memory is split into fixed-size pages and frames.
  2. A virtual page number is looked up in the page table.
  3. The entry points to a physical frame.
  4. Pages not in use stay on disk.
  5. 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

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Operating Systems quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Paging?
Splitting memory into fixed-size blocks mapped on demand. It belongs to Operating Systems and is an intermediate-level topic.
Where do people use Paging?
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.
What is the most common mistake with Paging?
Internal fragmentation wastes part of the last page of each allocation.
What should I learn before this topic?
Start with Memory Management, the topic just before it in Operating Systems.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Operating Systems quiz.
Is Paging hard to learn?
It is an Intermediate topic. Be comfortable with the Beginner topics in this area first, then read the common pitfall carefully, since it is where most mistakes happen.
How long does it take to learn Paging?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Paging?
Memory Management, Segmentation, Dining Philosophers are closely connected. The full list is in the related topics section of this page.
What should I study after Paging?
Continue with Segmentation, the next topic in Operating Systems.

Related topics