ECC

On this page 7

ECC, short for error-correcting code, is a memory protection technique in which extra check bits are stored alongside each data word so that the memory controller can detect and automatically correct bit errors in RAM. In computer memory, the term usually refers to ECC memory: modules, controllers and platforms that together implement this protection.

Bit errors happen in every DRAM system, caused by particle strikes, electrical noise, weak cells and aging. Most are harmless in a home computer, but in servers, workstations and storage systems a single silent error can corrupt data, crash a system or spread into backups. ECC is the standard defense in such hardware.

How ECC detects and corrects memory errors

Classic ECC memory uses a SECDED code, meaning single-error correction and double-error detection, derived from Hamming codes. For every 64 bits of data, the controller computes 8 check bits, so the memory bus becomes 72 bits wide. On each read, the controller recomputes the check bits and compares them with the stored ones; the difference, called the syndrome, identifies which bit flipped.

A single flipped bit is corrected transparently and logged as a correctable error. Two flipped bits are detected but cannot be corrected, which produces an uncorrectable error and usually a machine check that halts the affected process or the whole system. Halting is deliberate: stopping is safer than continuing with corrupted data.

Server platforms add memory scrubbing, in which the controller periodically reads and rewrites every location. This repairs single-bit errors before a second error in the same word turns them into an uncorrectable one.

Every corrected and uncorrected event is reported to firmware and the operating system, for example through the machine check architecture on x86-64 systems. Administrators read these counters with platform tools, and a steadily rising count on one module is a reliable early warning of hardware failure.

Types of ECC protection

ECC is not one fixed feature. Protection levels range from simple SECDED to schemes that survive the failure of an entire memory chip, and DDR5 introduced a form of ECC that is often confused with the real thing.

TypeWhat it protectsCorrectsTypical use
ParityData word on the busNothing, detection onlyOlder systems
SECDED side-band ECCData from DIMM to controllerSingle-bit errors per wordWorkstations and entry servers
Chipkill or SDDCData across several DRAM chipsFailure of a whole chipMission-critical servers
DDR5 on-die ECCData inside each DRAM chipSingle-bit errors in the arrayAll DDR5 modules
Link ECCData on the interfaceTransmission errorsLPDDR5 and some GDDR memory
Common forms of memory error correction

DDR5 on-die ECC is not ECC memory in the traditional sense. It corrects errors inside the chip to compensate for the high density of DDR5 cells, but it does not protect data on the bus and does not report errors to the operating system. Full protection still requires ECC DIMMs with extra chips and a controller that uses them.

ECC across memory generations

The way ECC is wired changed with DDR5, which splits each module into two independent 32-bit subchannels. The table compares how standard memory types handle error correction.

Memory typeBus width with ECCOn-die ECCNotes
DDR472 bits (64 data + 8 check)NoECC only on dedicated modules
DDR52 × 40 bits (2 × 32 data + 2 × 8 check)Yes, alwaysSide-band ECC needs ECC DIMMs
LPDDR5No separate ECC busVaries by deviceSoldered memory, link ECC optional
HBMVaries by generationCommon in recent generationsUsed in accelerators and data center GPUs
ECC in common memory types

ECC adds bits but does not meaningfully change memory bandwidth or memory latency in most workloads. The controller’s check typically costs a cycle or two, which is usually lost in noise compared with DRAM access times.

Choosing ECC memory and checking platform support

ECC only works when the module, the memory controller and the motherboard firmware all support it. Installing ECC modules on a platform without support either fails to boot or runs them without correction.

SituationRecommendationReason
Servers and virtualization hostsRegistered ECC, chipkill where availableLarge memory, long uptime, many users
File servers and NASECC strongly recommendedPrevents corrupted data entering storage and backups
Engineering and scientific workstationsECC unbuffered or registeredLong computations must be trustworthy
Gaming and home PCsOptionalErrors are rare and consequences usually minor
Laptops with soldered LPDDR5Usually not availablePlatform does not offer side-band ECC
When ECC is worth choosing

Unbuffered ECC (ECC UDIMM) and registered ECC (RDIMM) are not interchangeable. Workstation and entry server boards often take unbuffered modules, while larger servers need registered ones; the platform specification decides.

Limits and common misunderstandings

ECC greatly improves reliability, but it reduces risk rather than removing it. Its value also depends on whether anyone watches the error logs.

  • Multi-bit errors beyond the code’s ability can still corrupt data or force a crash.
  • Rising correctable error counts usually signal a failing module and should trigger replacement.
  • ECC does not protect caches, storage or network transfers; those use their own error correction.
  • Rowhammer attacks can sometimes defeat SECDED by flipping several bits in one word.
  • Unmonitored ECC hides degrading hardware until an uncorrectable error occurs.

Another misunderstanding concerns cost. ECC modules carry extra DRAM chips for the check bits, typically one for every four to eight data chips, so they cost somewhat more, and platforms that support ECC are often priced higher. For systems that store or compute important data, that premium is usually small compared with the cost of silent corruption.

A non-technical view

Computer memory occasionally flips a tiny piece of information by accident. Usually nobody notices. ECC memory adds a few extra checking digits to every piece of data, a bit like the check digit on a bank account number.

When something flips, the computer spots it and quietly fixes it. If the damage is too big to fix, the computer stops instead of continuing with wrong data. The key idea is that ECC turns silent mistakes into corrected or reported ones.

A concrete example

A small architecture firm runs a file server with 64 GB of DDR4 registered ECC memory that stores project drawings for 25 employees. The monitoring dashboard shows that one module reports a few correctable errors per week, rising to dozens per day over a month.

The administrator replaces the module during a planned maintenance window. Without ECC, those flipped bits could have been written silently into drawings and then copied into nightly backups. With ECC, every error was corrected, logged and visible, so the firm avoided both data corruption and unplanned downtime.