ArticleslgStudy

computer science

Memory scrubbing

Memory scrubbing is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Memory scrubbing rather than just read about it. In short: Memory scrubbing consists of reading from each computer memory location, correcting bit errors (if any) with an error-correcting code (ECC), and writing the corrected data back to the same location. Due to the high integration density of modern computer memory chips, the individual memory cell structures became small enough to be vulnerable to cosmic rays and/or alpha particle emission.

Key takeaways

  • Memory scrubbing belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Memory scrubbing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Memory scrubbing from memory before moving on to harder problems.

Reference excerpt

Memory scrubbing consists of reading from each computer memory location, correcting bit errors (if any) with an error-correcting code (ECC), and writing the corrected data back to the same location. Due to the high integration density of modern computer memory chips, the individual memory cell structures became small enough to be vulnerable to cosmic rays and/or alpha particle emission. The errors caused by these phenomena are called soft errors. Over 8% of dual in-line memory modules (DIMMs) experience at least one correctable error per year. This can be a problem for DRAM and SRAM based memories. The probability of a soft error at any individual memory bit is very small. However, together with the large amount of memory modern computers‍—‌especially servers‍—‌are equipped with, and together with extended periods of uptime, the probability of soft errors in the total memory installed is significant. The information in an ECC memory is stored redundantly enough to correct a single bit error per memory word. Hence, an ECC memory can support the scrubbing of the memory content. Namely, if the memory controller scans systematically through the memory, the single bit errors can be detected, the erroneous bit can be determined using the ECC checksum, and the corrected data can be written back to the memory.

Overview Each word of memory must be checked frequently enough that having multiple erroneous bits in a single word is unlikely. As a typical ECC memory mechanism can only correct 1-bit errors. In order not to disturb regular memory requests from the CPU and thus prevent decreasing performance, scrubbing is usually only done during idle periods. As the scrubbing consists of normal read and write operations, it may increase power consumption for the memory compared to non-scrubbing operation. Therefore, scrubbing is not performed continuously but periodically. For many servers, the scrub period can be configured in the BIOS setup program. The normal memory reads issued by the CPU or DMA devices are checked for ECC errors, but due to data locality reasons they can be confined to a small range of addresses, leaving other memory locations untouched for a very long time. These locations can become vulnerable to more than one soft error, while scrubbing ensures the checking of the whole memory within a guaranteed time. On some systems, not only the main memory (DRAM-based) can be scrubbed but also the CPU caches (SRAM-based). On most systems the scrubbing rates for both can be set independently. Because cache is much smaller than the main memory, the scrubbing for caches does not need to happen as frequently. Memory scrubbing increases reliability, therefore it can be classified as a reliability, availability and serviceability (RAS) feature.

Variants There are usually two variants, known as patrol scrubbing and demand scrubbing. While they both essentially perform memory scrubbing and associated error correction (if it is doable), the main difference is how these two variants are initiated and executed. Patrol scrubbing runs in an automated manner when the system is idle, while demand scrubbing performs the error correction when the data is actually requested from main memory.

See also

Data scrubbing, a general category containing memory scrubbing Soft error, an important reason for doing memory scrubbing Error detection and correction, a general theory used for memory scrubbing Memory refresh, which preserves information stored in memory

References

Worked examples

Example 1 — a first encounter with Memory scrubbing

Start with the simplest possible case. Write down what Memory scrubbing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Memory scrubbing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Memory scrubbing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Memory scrubbing

In research
Memory scrubbing appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Memory scrubbing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Memory scrubbing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer memory, so understanding it makes those chapters shorter.
In everyday life
Look for Memory scrubbing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Memory scrubbing” →

How to study Memory scrubbing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Memory scrubbing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Memory scrubbing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Memory scrubbing in simple terms?

Memory scrubbing consists of reading from each computer memory location, correcting bit errors (if any) with an error-correcting code (ECC), and writing the corrected data back to the same location. Due to the high integration density of modern computer memory chips, the individual memory cell stru…

Why does Memory scrubbing matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Memory scrubbing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Memory scrubbing.

Tags

  • Computer memory

Keep exploring