MemTest86 Technical Information

Blacklisting RAM Pages

Several operating systems allow the user to pass in a blacklist of 'bad' memory ranges to block the operating system from using or allocating memory in that range. This is useful for cases where the RAM in the system fails predictably on the same set of memory addresses. By masking known faulty addresses, the system may temporarily be able to boot into the operating system to perform backup and additional diagnostics, where it would otherwise crash during the boot process.

Note that masking faulty memory addresses does not fix defective RAM, but provides a temporary workaround for allowing the system to boot, especially in the case of soldered memory that cannot be easily replaced. Faulty memory should always be replaced, if possible.

Linux BadRAM

Most newer Linux kernels (eg. Ubuntu 12.04 or newer) support BadRAM, which allow a blacklist of memory address & mask patterns to be passed in as a GRUB2 boot-time parameter. This work-around makes it possible for Linux to reliably run with defective RAM. For history and background information on the original BadRAM project by Rick van Rein, see the following page: http://rick.vanrein.org/linux/badram/

How to blacklist RAM regions

MemTest86 Pro (v9 or later) supports automatic generation of BadRAM string patterns from detected errors in the HTML report, that can be used directly in the GRUB2 configuration without needing to manually calculate address/mask values by hand.

To enter the address ranges to blacklist manually, do the following:

  1. Edit /etc/default/grub and add the following line:

    GRUB_BADRAM=addr,mask[,addr,mask...]

    where the list of addr,mask pairs specify the memory range to block using address bit matching
    Eg. GRUB_BADRAM=0x7ddf0000,0xffffc000 shall exclude the memory range 0x7DDF0000-0x7DDF4000

  2. Open and terminal and run the following command

    sudo update-grub

  3. Reboot the system

How to view blacklisted RAM regions

To view the memory regions that have been blacklisted, do the following:

  1. Open and terminal and run the following command

    sudo cat /proc/iomem

    ...
    7ddf0000-7ddf3fff : RAM buffer
    ...

    Memory ranges blacklisted by BadRAM are marked as RAM buffer

Windows badmemorylist

For Windows Vista and later, the blacklist of known 'bad' memory ranges can be passed in via the Boot Configuration Data (BCD) system store. This is part of the Windows Hardware Error Architecture (WHEA) which performs Predictive Failure Analysis (PFA) for ECC memory. For details of this feature, see the following page:
https://docs.microsoft.com/en-us/windows-hardware/drivers/whea/persistence-of-pfa-results

Note: Since Windows 10 2004, the blacklisted memory pages may no longer be recognized due to a possible bug. This is described in this post here:
https://answers.microsoft.com/en-us/windows/forum/all/starting-with-windows-10-2004-the-pfa-memory-list/4148df72-851d-4618-8181-d785d802c8c7

How to blacklist RAM pages

MemTest86 Pro (v9 or later) supports automatic generation of badmemorylist command strings from detected errors in the HTML report, that can pasted directly in the Command Prompt without needing to manually calculate page numbers by hand.

To enter the page numbers to blacklist manually, do the following:

  1. Open the Command Prompt (as Administrator) either from Windows or System Recovery options
  2. Run the following command to enable memory blacklisting:

    bcdedit /set {badmemory} badmemoryaccess no

  3. Run the following command to blacklist the faulty page frame numbers (PFN):

    bcdedit /set {badmemory} badmemorylist PFN1 [PFN2 PFN3 ...]

    where the list of PFN values specify individual page numbers to block
    Eg. bcdedit /set {badmemory} badmemorylist 0xA1 0xB8 0xB9 shall exclude the memory ranges 0xA1000-0xA1FFF, 0xB8000-0xB9FFF

    Note: Windows Memory Diagnostics can also overwrite or delete the entire PFN list without notifying the user. And at least in some cases Windows Memory Diagnostics might run as a background scheduled task in Windows.

How to view blacklisted RAM pages

To view the list of page numbers that have been blacklisted, do the following:

  1. Open the Command Prompt (as Administrator) either from Windows or System Recovery options
  2. Run the following command to display the list of blacklisted pages:

    bcdedit /enum {badmemory}

  3. Alternatively, you may use the RAMMap tool from Microsoft.

How to clear blacklisted RAM pages

To clear the list of page numbers that have been blacklisted, do the following:

  1. Open the Command Prompt (as Administrator) either from Windows or System Recovery options
  2. Run the following command to clear the list of blacklisted pages:

    bcdedit /deletevalue {badmemory} badmemorylist