IntermediateTopic 60 of 104Software & Computing

Virtual memory

Paging provides isolated large address spaces.

In depth

Virtual memory gives each process a private address space mapped to physical frames by page tables; pages not in RAM are swapped from disk on demand (page faults). TLBs cache translations; replacement policies include LRU. Enables isolation, over-commit and memory-mapped files.

Key points

  • Paging and segmentation
  • Thrashing
  • Copy-on-write
Example

A 32-bit process sees 4 GB of virtual addresses regardless of installed RAM.

Why it matters

Virtual memory gives each program its own large address space and protects processes from each other, which is central to modern systems.

Where this is used

  • Running a program that needs more memory than physically available by paging to disk.
  • Keeping one application from reading another's memory.
  • Mapping a file into memory so it can be accessed like an array.

Frequently asked questions

What is Virtual memory?

Paging provides isolated large address spaces.

Why is it important to understand virtual memory?

Virtual memory gives each program its own large address space and protects processes from each other, which is central to modern systems.

What is paging?

Dividing memory into fixed-size pages and mapping them to physical frames, so pages can be stored on disk when not in use.

What is a page fault?

An access to a page not currently in RAM, which the operating system handles by loading the page, sometimes slowly.

How is Virtual memory used in practice?

Typical applications include running a program that needs more memory than physically available by paging to disk, keeping one application from reading another's memory and mapping a file into memory so it can be accessed like an array.

What should I learn before Virtual memory?

Study "Processes and scheduling" first (topic 59 of 104 in Software & Computing). It covers the groundwork this topic builds on.

What are the key points of Virtual memory?

Paging and segmentation. Thrashing. Copy-on-write.

Can you give an example of Virtual memory?

A 32-bit process sees 4 GB of virtual addresses regardless of installed RAM.

What comes after Virtual memory?

The next topic is "File systems", which builds directly on this one.

How difficult is Virtual memory?

It is classed as Intermediate in Software & Computing (topic 60 of 104). It is an intermediate topic. Work through the beginner topics in Software & Computing first.

Learning path

Want to practise? Open the interactive course for quick checks, quizzes, simulations and progress tracking.

Related topics