How to Accurately Check RAM Speed in Linux Using dmidecode and Other Tools


25 views

When you see memory speed reported as "30 ns" in dmidecode output, this actually represents the access time in nanoseconds, not the clock speed. To convert this to MHz:

Speed (MHz) = 1000 / (ns value × 2)
For 30 ns: 1000 / (30 × 2) ≈ 16.67 MHz

This shows why you're seeing a discrepancy - the ns value refers to the underlying DRAM cell access time, not the bus speed (400/533/667 MHz). Modern DDR memory uses techniques like prefetching to achieve higher effective speeds.

Here are several reliable methods to check RAM speed without opening your case:

# Method 1: Using dmidecode with proper parsing
sudo dmidecode --type 17 | grep -i speed

# Method 2: Using lshw (may require admin privileges)
sudo lshw -class memory | grep clock

# Method 3: Decoding SPD data via i2c-tools
sudo modprobe eeprom
sudo decode-dimms

# Method 4: Checking kernel messages
dmesg | grep -i memory

The most accurate method is reading the Serial Presence Detect (SPD) data from your modules:

# Install necessary tools
sudo apt-get install i2c-tools

# Detect I2C buses (may vary by system)
sudo i2cdetect -l

# Read SPD data (replace X with your bus number)
sudo i2cdump -y X 0x50

Let's examine what proper DDR3 speed detection looks like:

# Sample output from decode-dimms
Memory Serial Presence Detect Decoder
=====================================

Decoding EEPROM: /sys/bus/i2c/drivers/eeprom/0-0050
Guessing DIMM is in                             bank 1

---=== SPD EEPROM Information ===---
EEPROM CRC of bytes 0-116                       OK (0x7C7D)
# of bytes written to SDRAM EEPROM              176
Total width (per module)                        64 bits
Data width (per module)                         64 bits
SDRAM type                                      DDR3 SDRAM
Module speed                                    1066 MHz (DDR3-1066)

If all tools report "Unknown" speed (as in your dmidecode output), this typically indicates either:

  • SPD data isn't being read correctly (try i2c-tools)
  • Motherboard limitations in reporting
  • Very old or non-standard memory modules

In such cases, checking the manufacturer's specifications (as you ultimately did) becomes necessary. The model number you found (RM12864AA667) confirms DDR2-667 operation.

For developers wanting direct hardware access, here's a Python snippet using ctypes to read memory information:

import ctypes

class MemoryInfo(ctypes.Structure):
    _fields_ = [
        ("length", ctypes.c_ulong),
        ("memory_load", ctypes.c_ulong),
        ("total_phys", ctypes.c_ulonglong),
        ("avail_phys", ctypes.c_ulonglong),
        ("total_page", ctypes.c_ulonglong),
        ("avail_page", ctypes.c_ulonglong),
        ("total_virtual", ctypes.c_ulonglong),
        ("avail_virtual", ctypes.c_ulonglong)
    ]

def get_memory_info():
    mem_info = MemoryInfo()
    ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(mem_info))
    return mem_info

# Note: This provides capacity info but not speed - 
# demonstrates the challenge of low-level memory detection

When working with Linux systems, identifying actual RAM speed can be surprisingly tricky. While BIOS and hardware specifications provide theoretical support for certain speeds (like 400/533/667 MHz in your case), the operational speed might differ due to various factors.

Here are the most effective command-line methods to check RAM speed on Linux systems:

# Method 1: dmidecode (Detailed Memory Information)
sudo dmidecode --type memory

# Method 2: Decoding specific DMI types
sudo dmidecode -t 5,6,16,17

# Method 3: Alternative tool - hardinfo (GUI available)
sudo hardinfo -r > memory_report.txt

The confusion about "30 ns" versus MHz ratings stems from how DMI reports memory timings. Here's how to interpret the values:

# Converting nanosecond ratings to MHz:
# 30 ns = (1 / (30 * 10^-9)) ≈ 33.33 MHz
# This represents the access time, not the clock speed

# Actual DDR speed calculation:
# DDR2-667 operates at 333 MHz clock (667 MT/s data rate)
# The ns rating refers to latency characteristics

For more precise detection when dmidecode shows "Unknown":

# Check kernel ring buffer for memory initialization
dmesg | grep -i memory

# Parse SPD data (requires root)
sudo decode-dimms

# Check memory controller info
lspci -v | grep -i memory -A 10

# CPU-specific memory info (Intel)
sudo cpuid | grep -i "memory profile"

As you discovered, sometimes physical inspection is necessary. However, we can combine multiple techniques:

# Create comprehensive memory report
{
  echo "===== DMI Information ====="
  sudo dmidecode --type memory
  echo "\n===== Kernel Memory Info ====="
  dmesg | grep -i -A 5 -B 5 "memory"
  echo "\n===== Current Memory Usage ====="
  free -h
  echo "\n===== Processor Cache Info ====="
  lscpu | grep -i cache
} > system_memory_report.txt

The motherboard's supported speeds (400/533/667 MHz) represent theoretical maximums. Actual operational speed depends on:

  • Lowest common denominator between installed DIMMs
  • CPU memory controller capabilities
  • BIOS configuration settings
  • Potential downclocking due to stability issues