EMZETT.
Login

ECC memory: Detecting and correcting errors in RAM

In short: Special memory with extra check bits that automatically corrects single flipped bits and reports larger errors.

In more detail: ECC stands for error-correcting code. Normal memory does not notice when a bit flips from 0 to 1, for example due to radiation or electrical interference. The result can be a wrong calculation, damaged data or a crash. ECC RAM stores extra check bits with every data word and detects and repairs such errors during operation.

In Depth

How it works

A SECDED code (single-error correction, double-error detection) with 8 check bits per 64 data bits (72 bits per word) is usual. When reading, the code is recomputed from the data and compared with the stored one. A single wrong bit is detected, its position determined and corrected. Two wrong bits in the same word are at least detected but not corrected, and the system reports an error instead of continuing with wrong data.

Where ECC is used

Servers, workstations and storage systems use ECC because errors are expensive there and large amounts of memory increase the probability of errors. On home computers it is rare. Studies of large data centers show that correctable errors occur more often than expected. DDR5 also has an internal “on-die ECC”, which however only handles errors within the chip and does not protect the transfer to the processor. Full ECC can be recognised by 72-bit modules and by support from processor and motherboard.

Requirements

You need ECC modules (often as “ECC UDIMM” or “registered/RDIMM”), a processor with ECC support and a suitable motherboard. AMD Ryzen processors often support ECC unofficially; with Intel desktop chips ECC exists only on certain models and chipsets. On Linux edac-util or journalctl show corrected errors.

Cost and benefit

ECC costs somewhat more (extra chip, minimally lower performance) and is rarely noticeable in games or office work. Whoever processes important data, such as a home server with a file system like ZFS, benefits from the extra safety. ECC does not replace backups.

See also: CPU structure, Memory hierarchy, Linux file systems