This site is only a doorway

Everything here is gathered from things other people actually researched, thought through, and built: books, papers, historical records, and the people behind them. If something here catches your interest, go look at the original sources listed at the bottom of the page. They carry more depth than a page like this ever can.

How Does Computer Memory Work, and Why Must It Be Rewritten Constantly to Remember?

Category: Technology

The contents of a computer's memory slowly disappear if left alone. This is because 0s and 1s are represented by electricity stored in tiny parts, and that electricity leaks out. So why can a system that loses information remember anything at all? In standard DDR4 memory, the data is rewritten at a pace of about 15 times per second. Understanding this mechanism also explains why computers get slow when memory is full.

1. How Tiny Parts in a Memory Chip Store 0s and 1s with Electricity

Inside a memory chip, there are countless tiny containers arranged in rows. Each container can hold only one piece of information: either a 0 or a 1. This single piece of information is called a bit. In this type of memory, known as DRAM (Dynamic Random Access Memory), each bit uses one small component called a capacitor to store electricity. If electricity is stored, it represents a 1. If no electricity is stored, it represents a 0 [1].

Each bit has one capacitor and one transistor, which acts like a switch. This transistor connects the capacitor to the data path only when data is being put in or taken out [5]. Because there is one capacitor for every single bit, the number of parts is enormous. For example, an 8 GiB (gibibyte) memory chip contains 8 × 230 × 8 = 68,719,476,736 bits. That is approximately 68.7 billion containers. If you count using decimal 8 GB (gigabytes), it is about 64 billion. Both numbers are calculated from the capacity, so they may differ slightly from actual chips.

2. Why Stored Electricity Leaks and Must Be Rewritten About 15 Times a Second

The electricity stored in a capacitor naturally leaks away over time [2][4]. If the electricity meant to represent a 1 decreases, it becomes impossible to distinguish it from a 0. To prevent this, DRAM reads the contents at set intervals and rewrites the same data. This process is called refreshing. Explanatory articles often describe this cycle as happening every few tens of milliseconds [2].

In standard DDR4 memory, at normal temperatures, each row is refreshed once within 64 milliseconds. Since this is divided into 8,192 steps, the system sends a refresh command about every 7.8 microseconds [3]. Because 64 milliseconds is about 1/15.6 of a second, it means that some row somewhere in the memory is being rewritten about 15.6 times every second. However, this is a standard value. If the temperature rises, the interval becomes shorter, and actual devices may vary [3].

Because the electricity leaks and the rewriting stops when the power is turned off, the contents of DRAM disappear when the power is cut. Memory with this property is called volatile memory [4].

3. Why DRAM Uses a Leaky Part Instead of the Older Magnetic Cores

Why use a component that leaks electricity? Before DRAM, the main memory was made differently. It used small magnetic rings called magnetic cores. Each ring held one bit, using the direction of the magnet to distinguish between 0 and 1 [1].

According to the story, in the autumn of 1966, Robert Dennard of IBM came up with the idea of storing 1 bit by accumulating electricity. This happened one night after he heard research presentations on magnetic core memory and other storage technologies [6]. At the time, some semiconductor memories used 6 transistors for 1 bit. Dennard’s idea reduced this to just 1 transistor and 1 capacitor [5]. His patent was granted in 1968, but records vary by about a year, so it is safe to think of this as happening in the late 1960s [5].

In 1970, Intel released a semiconductor memory chip priced at 1 cent per bit. It was the first semiconductor memory to seriously compete with magnetic cores, and it eventually replaced them in main memory [7]. However, this specific product did not use Dennard’s 1-transistor design. Chips using the 1-transistor design, specifically 4-kilobit chips, were produced by multiple companies in the mid-1970s [5].

4. What the Computer Does When Its Memory Is Full: Using Storage

When memory runs low, the operating system (OS) moves some data to storage devices like HDDs (hard disk drives) and reads it back when needed. This makes the computer feel slow. Normally, data you want to use is stored in auxiliary memory, such as HDDs or SSDs (solid-state drives). Data is usually loaded into main memory (RAM) when it is used for processing [9]. Auxiliary memory has large capacity but is slow, and it keeps data even when the power is off.

Main memory has a limited capacity. When it runs out, the OS may move less frequently used data to a page file (also called a swap file) on the HDD to free up space. This system is called virtual memory. Virtual memory is slower than physical memory. As the amount of data using virtual memory increases, users are more likely to notice a drop in performance [8]. It is thought that having more memory feels comfortable because it reduces the need for this moving of data.

5. How to Estimate the Number of Bits in Your Device's Memory

The settings screen of a computer or smartphone often shows the memory (RAM) capacity. If it says "8 GB," you can estimate the number of bits by treating 1 GB as about 8 billion bytes, then multiplying by 8. This gives about 64 billion bits. This differs from the 68.7 billion bits calculated for 8 GiB in this article by about 7%, due to the difference between decimal and binary counting systems.

The location of this information varies by device. If you cannot find it, check the user manual or the manufacturer's website. You can also search for terms like "refresh" or "virtual memory" to find explanatory articles.

Sources

  1. IEEE Spectrum "Thanks for the Memories" https://spectrum.ieee.org/thanks-for-the-memories (Supports the use of 1 capacitor per bit and the history of magnetic cores.)
  2. Mynavi News "Semiconductor Explanation: DRAM" https://news.mynavi.jp/techplus/article/dram-3/ (Supports the refresh cycle being in tens of milliseconds.)
  3. Mukundan et al. (arXiv 1712.08304) https://arxiv.org/pdf/1712.08304 (Supports DDR4 refresh timing of 64ms and 7.8 microseconds.)
  4. jisaku.com "How DRAM Works" https://jisaku.com/posts/how-dram-memory-works (Supports electricity leakage and volatile memory properties.)
  5. Lemelson-MIT "Robert Dennard" https://lemelson.mit.edu/resources/robert-dennard (Supports the invention and spread of the 1-transistor cell.)
  6. IBM Research "Bob Dennard in memoriam" https://research.ibm.com/blog/bob-dennard-in-memoriam (Supports the anecdote about the idea's origin.)
  7. Computer History Museum "1970 MOS Dynamic RAM" https://www.computerhistory.org/siliconengine/mos-dynamic-ram-competes-with-magnetic-core-memory-on-price/ (Supports price competition and replacement of magnetic cores.)
  8. IBM Think "Virtual Memory" https://www.ibm.com/jp-ja/think/topics/virtual-memory (Supports swapping and speed reduction details.)
  9. Wikibooks "Junior System Administrator: Computer Systems" https://ja.wikibooks.org/wiki/%E5%88%9D%E7%B4%9A%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%82%A2%E3%83%89%E3%83%9F%E3%83%8B%E3%82%B9%E3%83%88%E3%83%AC%E3%83%BC%E3%82%BF/%E3%82%B3%E3%83%B3%E3%83%94%E3%83%A5%E3%83%BC%E3%82%BF%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0 (Supports the roles of main and auxiliary memory.)