Jump to content

6.3.2 Virtual Memory

From Computer Science Knowledge Base

6.3.2 Virtual Memory

(Difficulty Note: A powerful concept, try to make the analogy clear.)

What happens if you want to run many big programs, and they all need more RAM than your computer actually has? That's where Virtual Memory comes in!

Virtual memory is a trick the OS plays. It uses a part of your slower, long-term storage (like your hard drive or SSD) as if it were extra RAM. When your computer runs low on actual RAM, the OS temporarily moves some less-used parts of programs from RAM to the hard drive. This is called "swapping" or "paging out." When those parts are needed again, the OS swaps them back into RAM.

Imagine your desk (RAM) has limited space. When you need more room, you temporarily put some books you're not using right now onto a shelf (hard drive) and bring them back when you need them. This makes it seem like you have more desk space than you actually do. Virtual memory lets your computer run more programs than your physical RAM can hold, though it can make your computer feel slower if it's doing too much swapping.

Bibliography: