Virtual Memory (OCR GCSE Computer Science): Revision Notes
Virtual Memory
Memory Types
Memory is a crucial component of any computer system, enabling it to store data, run programmes, and ensure smooth performance. Two important types of memory in modern computers are Virtual Memory and Flash Memory. They serve different purposes and work in distinct ways.
Virtual Memory
Virtual memory is a feature that allows computers to compensate for a lack of RAM (Random Access Memory) by using a portion of the hard drive as temporary storage. This helps ensure the system can continue running when RAM is fully occupied by data and programmes. However, since hard drives are much slower than RAM, virtual memory is a slower alternative, and performance can be affected.
Why Virtual Memory May Be Needed
- Virtual memory is used when the system runs out of RAM, preventing crashes or freezes by temporarily moving some data to the hard drive.
- It allows computers with limited RAM to handle large files or run multiple programs simultaneously.
How Virtual Memory Works
- When RAM is full, the system moves less frequently used data to a designated part of the hard drive, freeing up RAM for active tasks. This process is known as paging.
- The operating system automatically manages the transfer of data between RAM and the hard drive. The data stored temporarily on the hard drive is kept in a swap file.
Key Considerations
- Although virtual memory prevents system crashes, it operates more slowly than RAM due to the slower speed of hard drives.
- Increasing physical RAM can reduce the reliance on virtual memory, leading to better overall performance.
Examples of Virtual Memory in Use
- Multiple Programmes Open: Allows the system to run more applications than the available RAM can handle by storing less-used data on the hard drive.
- Large File Handling: When working with large files (e.g., video editing), virtual memory enables the system to process these files even when RAM is full.
- Gaming on Low-RAM PCs: Prevents game crashes by temporarily moving background data to virtual memory, freeing up RAM for active gameplay.
- Virtual Machines: When running virtual operating systems, virtual memory provides extra space when RAM is insufficient.
Flash Memory
Flash memory is a type of non-volatile memory (ROM) that retains its data even when the power is turned off. It can be erased and reprogrammed, making it ideal for storing files and programmes that require frequent updates. Because flash memory has no moving parts, it is faster, more reliable, and more durable than traditional mechanical hard drives.
Examples of Flash Memory in Use
- Memory Cards in Digital Cameras: Store photos and videos, allowing easy transfer to other devices.
- Mini/Micro SD Cards in Smartphones: Expand storage for apps, photos, videos, and other data on mobile devices.
- USB Memory Sticks: Portable storage used to transfer files between computers and other devices.
- Solid State Drives (SSDs): High-speed, durable storage used in computers and laptops, offering much faster data access than traditional hard drives.
Key Points to Remember
- Flash memory is fast, reliable, and non-volatile, retaining data without a power supply.
- Virtual memory is used when RAM is full, temporarily storing data on the hard drive to free up RAM for active tasks.
- Virtual memory is slower than RAM, but it helps prevent system crashes and enables multitasking.
- Increasing RAM reduces the need for virtual memory, improving performance.