Operating system memory management – RAM, paging, virtual memory and OS functions
Computer ScienceComputers & HardwareAges 16–17
Loading…
Sign in to playOpen and close programs and watch RAM fill up page by page. When RAM is full, the operating system moves little-used pages to virtual memory on disk; the page table and the page-fault counter show the computer slowing down, and heavy swapping causes thrashing. Change the RAM size, switch virtual memory off, or restart the computer to see ROM holding the BIOS/UEFI boot program. The OS functions tab links each function to what it manages: process states and the scheduler, device drivers, user accounts and permissions, files on disk, the user interface, defragmentation and backup.
Lesson: Operating systems: memory management (RAM, ROM, paging, virtual memory, page faults, thrashing), processes, device drivers, users, files, user interface and utility software
What it shows
The operating system shares main memory (RAM) between running programs. Memory is split into equal pages that fit into frames of RAM. When RAM is full, the OS moves the least recently used pages to virtual memory, a page file on secondary storage. A program that needs one of those pages causes a page fault and must wait while the page is read back from disk, which is far slower than RAM. When more pages are needed than RAM can hold, the computer spends most of its time swapping: this is thrashing. ROM is non-volatile and holds the firmware (BIOS/UEFI) that starts the computer.
How to use
In the Memory tab, click programs to open them or bring them to the front, and click × to close them. Drag the RAM slider, untick Virtual memory on disk, and read the page table, the readouts and the graph of page faults and responsiveness. Click Restart computer to step through the boot sequence. In the OS functions tab, click a function on the diagram and use its controls: Play, Send request, Try, Defragment or Back up now.
Parameters you can change
- Starting tab Memory, OS functions
- RAM size 2–8 GB
- Virtual memory on
- Programs open at the start 0–4
- Starting function in the OS tab Process management, Memory management, Devices and drivers, Users and access rights, File management, User interface, Utility: defragmentation, Utility: backup
- Drive type (defragmentation) Hard disk drive (HDD), Solid-state drive (SSD)
Questions to explore
- With 4 GB of RAM and four programs open, why does opening the Game make the page-fault rate jump?
- Why is the boot program stored in ROM rather than in RAM?
- Why does defragmenting speed up a hard disk but is not done on an SSD?