GCSE · Computer Science · Eduqas · Spec C500QS
Memory inspector
Your program runs, prints an answer, and the answer is wrong. No error, no clue. Freeze it half-way and look inside its memory.
Computer Science · Software tools
Pause the program. What will the inspector show?
A made-up shop program should work out the cost of 3 items at 4 each, plus 2 for delivery. Each step is the program paused after one line. The three columns are three memory locations (the labels A1 to A3 are invented for this example). Call each marked value before the inspector shows it.
price = 4qty = 3total = price + qtytotal = total + 2print(total)
| A1 price | A2 qty | A3 total |
|---|---|---|
| 4 |
Step 1. Paused after line 1. The inspector shows A1 holding 4, which is what the program should have stored. This first reading is shown for you.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Freeze a running program and read what its memory is really holding.
What you need to know
- A memory inspector is a software tool in a development environment (an IDE) that helps a programmer test and debug a program.
- It lets you view the memory the program is using: the memory locations (addresses) it occupies and the values stored in them.
Have a goThe inspector shows this line: A2 → 15. Which part is the memory location and which part is the value stored in it?
A2 is the memory location (its address). 15 is the value stored in it.
The inspector shows both halves: where in memory the program is storing something, and what is stored there.
- You usually use it while the program is paused part-way through, so you see the values held in memory at that exact point.
Have a goKai's program prints a wrong total. Kai says: 'I'll run it to the very end, THEN open the memory inspector.' Is that how it's usually done?
No. It is usually used while the program is paused part-way through.
Pausing freezes memory at one exact point, so you see the values held at that moment. Waiting until the end only leaves you with the final result.
- It only shows what memory holds. It does not find or fix the fault, so spotting the fault is still your job.
- To track down a fault, compare the values actually held in memory with the values the program should have produced.
- Where the two disagree, data has been stored incorrectly or changed unexpectedly.
Have a goA program should have stored 10 in a location called B1, but the paused inspector shows 100 there. What does that tell you?
Data has been stored incorrectly (or changed unexpectedly) at B1.
The inspector only shows 100. It is your comparison with the expected 10 that turns that reading into a clue.
- The first mismatch points you to the part of the code that causes the error.
- Values after that may be wrong only because they were worked out from the first wrong value.
The big picture
A memory inspector is a tool in a development environment that shows the memory locations a program is using and the values stored in them, usually while the program is paused. Comparing those values with the values the program should have produced shows where data has gone wrong, and so which part of the code to check.
Key points
Worked example
Problem
Rectangle: width 6, height 4. Pausing the code after its last line, the inspector lists width = 6, height = 4, area = 36. Where is the fault?
⚠ Watch out
Thinking the memory inspector finds or fixes the bug for you. It only shows the locations and values at the pause. You compare them with what they should be and decide where the fault is.
Memory hook
Freeze, look, compare. Freeze the program, look at what memory holds, compare it with what it should hold. The first mismatch tells you where to look.
Check yourself
Paused, the inspector shows total = 9 where you expected 14. What is your next move? Answer: check the code that wrote total.
Flashcards
(7)What is a memory inspector?
What two things does a memory inspector show?
When is memory usually inspected?
Which two things do you compare to find a fault?
What does a mismatch tell you?
Does a memory inspector fix the fault?
A later value is wrong too. Is the fault there?
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.