GCSE · Computer Science · Eduqas · Spec C500QS
OS memory management
A browser, a music app and a game all want main memory. Who decides who gets what, and what stops them trampling each other?
Computer Science · Operating systems
You are the operating system: call the memory record
Five areas of RAM, three programs, six events. Say what the OS’s record will show before it appears.
Step through the run and call each marked step before the table shows it. In this made-up run the OS always hands out the lowest-numbered free area first.
Start: the OS sits in Area 1, and Areas 2 to 5 are freeEvent 1: program A is loaded and needs one areaEvent 2: program B is loaded and needs two areasEvent 3: A, now running, asks for more space for its dataEvent 4: A tries to write into Area 3Event 5: B is closedEvent 6: program C is loaded and needs two areas
| Area 1 | Area 2 | Area 3 | Area 4 | Area 5 |
|---|---|---|---|---|
| OS | free | free | free | free |
Step 1. This first row is worked for you. The OS keeps a record of main memory, and right now it says: Area 1 belongs to the OS, everything else is free.
Memory protection
Reason it through
Why does the operating system keep each program’s memory separate?
First link · your turn
A program has an error and writes data to the wrong place in main memory. Where could the wrong place be?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
How the operating system hands out, tracks, protects and takes back main memory.
What you need to know
- Memory management is one of the operating system’s jobs: it controls how main memory (RAM) is used by the running programs.
- The CPU fetches instructions and data from main memory, so a program and its data must be loaded there before it can run.
Have a goMaya says, ‘I double-click a game and the CPU runs it straight off the drive.’ Where does Maya’s version go wrong?
The game and its data have to be loaded into main memory first.
The CPU only fetches instructions and data from main memory, so being stored on the drive is not enough to run it.
- When a program is loaded, the operating system allocates it an area of main memory for the program and its data.
- A running program can ask for more space for its data, and the operating system can allocate further memory to it.
- The operating system keeps track of which areas are in use, which program owns each one, and which are free.
Have a goA new program is about to be loaded. What does the OS look at in its record to find somewhere to put it?
Which areas of main memory are free.
The record of in use, owner and free is how the OS hands out an area that no other program already owns.
- Several programs can be held in main memory at once, so the operating system shares the available memory between them.
- Memory protection means the operating system keeps each program’s memory separate, so one program cannot read or overwrite another’s.
- Separation matters because an error in one program can’t corrupt other programs or the operating system, and data stays private.
- When a program closes or no longer needs some memory, the operating system frees (deallocates) it so other programs can use it.
Have a goRavi’s program closes. Does the OS delete the program or free the memory it was using?
It frees the memory. Closing doesn’t delete the program.
Freeing gives the area back for other programs to use; it is about the main memory the program was using, not about removing the program.
- RAM is limited, so memory that is never freed leaves less for other programs, which may run slowly or not load.
The big picture
Main memory (RAM) is limited, so the operating system allocates areas to programs, keeps a record of what is in use, who owns it and what is free, keeps each program’s memory separate, and frees memory when it is no longer needed.
Key points
Worked example
Problem
A chat app is opened, runs for a while, then the user closes it. Write a two-mark answer to: ‘Describe what the operating system does with main memory for this app.’ Show how you build the answer.
⚠ Watch out
Thinking a program runs straight from storage and that closing it deletes it. In fact the program and its data are loaded into main memory because the CPU fetches from there, and closing the program frees that area of memory for other programs.
Memory hook
The OS is a hotel receptionist with a room list: it hands out rooms, notes who is in each, guards every room, and marks one free at check-out. It breaks down here: a program can ask for a bigger room mid-stay.
Check yourself
Program B closes while A and C stay open. Say what the OS does with B’s memory, and what could go wrong for A and C if it didn’t.
Flashcards
(11)What is memory management?
Why must a program be loaded into main memory before it runs?
What does it mean to allocate memory?
When can the OS allocate extra memory to a program that is already running?
What three things does the OS keep track of about main memory?
Several programs are in main memory at once. What does the OS do with the memory?
What is memory protection?
Why does keeping memory separate matter?
What does it mean to free (deallocate) memory?
Why does freeing memory matter?
When a program closes, what happens to the program and to its memory?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore Eduqas GCSE Computer Science topics
How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 16 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.