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 free
Event 1: program A is loaded and needs one area
Event 2: program B is loaded and needs two areas
Event 3: A, now running, asks for more space for its data
Event 4: A tries to write into Area 3
Event 5: B is closed
Event 6: program C is loaded and needs two areas
Area 1Area 2Area 3Area 4Area 5
OSfreefreefreefree

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.

Step 1 of 7Called right: 0 of 6

Computer Science · Main memory

What happens when you open a game?

You double-click a game. A moment later it’s running.

Which is closest to what you think happened?
How sure are you?

Memory protection

?

Reason it through

Why does the operating system keep each program’s memory separate?

Link 1 of 4

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?

2
Locked — reveal the link above first
3
Locked — reveal the link above first
4
Locked — reveal the link above first

Computer Science · Freeing memory

Rebuild the life of a memory area, then break it

2 stages are missing. Use the rest of the loop to work out which goes where.

  1. Stage 1: Free and available

    The OS’s record shows no program owns this area.

  2. Stage 3: In use by that program

    The program’s instructions or data sit in the area.

  3. Stage 5: Freed (deallocated) by the OS

    The OS gives the area back, so it can be allocated again.

…and stage 5 leads back to stage 1.

Computer Science · Write it, then mark it

Write your own answer, then mark it

Describe how the operating system manages main memory, and explain why it matters that memory no longer needed is freed. [5 marks]

0 words · your answer stays on this page and is not sent anywhere.

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

1Load, then allocate: a program and its data go into an area of main memory that the operating system allocates.
2Keep a record: the operating system tracks which areas are in use, which program owns each, and which are free.
3Share and separate: many programs share main memory, but each is kept to its own area (memory protection).
4Free it up: memory a program no longer needs is deallocated so it can be allocated to others.
5Why freeing matters: RAM is limited, so memory never freed leaves less for other programs.

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?
One of the operating system’s jobs: controlling how main memory (RAM) is used by the programs running on the computer.
Why must a program be loaded into main memory before it runs?
The CPU fetches instructions and data from main memory, so the program and its data must be there.
What does it mean to allocate memory?
The OS assigns an area of main memory to a program and its data.
When can the OS allocate extra memory to a program that is already running?
When the program requests more space for its data.
What three things does the OS keep track of about main memory?
Which areas are in use, which program each in-use area belongs to, and which areas are free.
Several programs are in main memory at once. What does the OS do with the memory?
It shares the available main memory between them.
What is memory protection?
The OS keeps each program’s memory separate, so one program cannot read or overwrite the memory allocated to another.
Why does keeping memory separate matter?
An error in one program can’t corrupt the instructions or data of other programs or of the OS, and one program can’t access another’s data.
What does it mean to free (deallocate) memory?
When a program closes or no longer needs some of its memory, the OS gives it back so it can be allocated to other programs.
Why does freeing memory matter?
Main memory is limited in size, so memory that is never freed reduces what is available. Other programs may then run slowly or be unable to load.
When a program closes, what happens to the program and to its memory?
Its area of main memory is freed for other programs. Closing the program does not delete it.

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 posted

More Eduqas GCSE Computer Science topics

See the full Eduqas Computer Science curriculum →

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.