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 = 4
qty = 3
total = price + qty
total = total + 2
print(total)
A1 priceA2 qtyA3 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.

Step 1 of 5Called right: 0 of 3

Computer Science · Software tools

What will the inspector do for you?

A programmer's cost calculator runs but gives the wrong answer. They open the memory inspector in their development environment.

Which is closest to what you think the memory inspector will do for them?
How sure are you?

Exam line: A memory inspector shows the memory locations a program uses and the values stored in them. You find the fault by comparing those values with what they should be.

Computer Science · Software tools

Which line first puts the wrong data in memory?

A made-up game should take one life from the player when they are hit. The programmer pauses after lines 3, 4 and 5. Readings as actual (should be): after line 3, lives 3 (3) and score 50 (50). After line 4, lives 3 (2) and score 49 (50). After line 5, lives 3 (2), score 49 (50) and bonus 98 (100). Which line first makes memory hold wrong values? Click it.

A programmer's game code — which line goes wrong?

Exam line: Find the first pause where memory disagrees with what it should hold. That is the line to blame, not a later line that only carries the wrong value on.

Computer Science · Software tools

Write it, then mark it

The student's program runs without stopping and shows an average that is wrong.

A student's program adds up five test marks and shows the average. It runs to the end without stopping, but the average it shows is wrong. Explain how a memory inspector could help the student find the fault. [5 marks]

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

Exam line: Give the whole chain: view the locations and values, while paused, compare with what they should be, spot the mismatch, then locate the code.

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

1A memory inspector shows the memory locations a program uses and the values stored in them.
2It is a tool in a development environment, used to test and debug.
3Memory is usually inspected while the program is paused part-way through.
4A mismatch between actual and expected values shows where data went wrong, and so which code to check.

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?
A software tool in a development environment (IDE) that helps a programmer test and debug a program.
What two things does a memory inspector show?
The memory locations (addresses) a program uses, and the values stored in them.
When is memory usually inspected?
While the program is paused part-way through, so you see the values at that exact point in the run.
Which two things do you compare to find a fault?
The values actually held in memory and the values the program should have produced.
What does a mismatch tell you?
Data has been stored incorrectly or changed unexpectedly, which points to the code that causes the error.
Does a memory inspector fix the fault?
No. It only shows locations and values. The programmer finds the fault by comparing them with what they should be.
A later value is wrong too. Is the fault there?
Not necessarily. It may only carry on an earlier wrong value, so look for the first mismatch.

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.