How to block out or map out bad RAM in Windows…

A friend recently came across a Samsung Ultrabook with faulty RAM.. sadly the RAM was soldered onto the board so it isn’t possible just to swap it out.

It is also about 13 months old and Samsung refuse to fix it under warranty.

Our next quest was to see if you could block out the windows kernel from using the faulty section of RAM. Linux has a similar option (original link dead, use Archive.org) and windows seems to automatically list faulty areas of RAM if you have ECC ram in your machine.

However if you want to mask out ram yourself it wasn’t so clear how you do it manually.

Microsoft don’t have any official documentation showing how you add faulty RAM zones or pages. A few comments on their forums list the incorrect command and the wider internet also lists this incorrect command.

Windows will accept the incorrect command with no errors – so it looks like it worked, but if you read back the memory list it actually has not added the faulty section.

bcdedit /set badmemorylist 0xB7 0xB8 0xB9 0xBA 0xBB 0xBC 0xBD 0xBE 0xBF 0xC0 0xC1
The operation completed successfully.

bcdedit /enum {badmemory}

RAM Defects
-----------
identifier              {badmemory}

The correct command, only documented in one place I could find, is in fact this:

bcdedit /set {badmemory} badmemorylist 0xB7 0xB8 0xB9 0xBA 0xBB 0xBC 0xBD 0xBE 0xBF 0xC0 0xC1
The operation completed successfully.

bcdedit /enum {badmemory}

RAM Defects
-----------
identifier              {badmemory}
badmemorylist           0xb7
                        0xb8
                        0xb9
                        0xba
                        0xbb
                        0xbc
                        0xbd
                        0xbe
                        0xbf
                        0xc0
                        0xc1

You then need to turn off the ability to access the bad memory:

bcdedit /set badmemoryaccess no

2022 note: memtest now has a function to generate the command for you!

The formula to convert RAM to pages is (replace line 65566 with the correct line!):

ram to microsoft page

DONE! Except this doesn’t help you if so much RAM is faulty that you can not boot to add the entries ;)… that is for another day. (Possibly copy a BCD from another system with the mask applied?).

This entry was posted in Uncategorized. Bookmark the permalink.

43 Responses to How to block out or map out bad RAM in Windows…

  1. jgustavo says:

    if memtest detect error from 0x51000000 to 0x51FFFFFF the adress pages are “0x51” ?
    bcdedit /set {badmemory} badmemorylist 0x51
    or how I should write?

  2. Not entirely sure but I believe so. Does memtest show the faulty ram in megabytes, if so – use the formula in the excel sheet to locate the correct “microsoft page” value?

  3. JGustavo says:

    there are 16MB fault. and in 4K pages, are 4096 entry.
    I try this.

    I test the 0x51 and don’t work. I can access the range.
    thanks

  4. JGustavo says:

    I solve it.
    thanks for de support
    the keys are:
    0x10000000 in memtest = 0x10000 in windows
    0x00001000 in memtest = 0x1 in windows
    page windows cut the 3 hex from right
    page windows cut the 0 from the left

    yo can’t mark a range of addesses, but mark page a page.
    if you need mark 0x51c00000 to 0x51c04000 yo need:
    bcdedit /set {badmemory} badmemorylist 0x51c00 0x51c01 0x51c02 0x51c03 0x51c04
    then
    bcdedit /set badmemoryaccess no
    and reboot

    and… IT WORK

    thanks again

  5. Thank you so much for coming back with your findings! I’m glad I aimed you in the right direction.
    What device were you repairing that couldn’t have the RAM swapped out?

  6. JGustavo says:

    :)
    the device are “chuwi vi10”.
    the seller gave more than 500, and mine is the only failed.
    anyway, these devices will become increasingly common.
    and this solution will help very many of them are not expensive paperweight.

    now, the device are powerfull for the money spend

  7. atropos says:

    The comand
    bcdedit /set badmemoryaccess no
    doesn’t work. After some fiddling i figured out that you need to add {badmemory} too,so it looks like this

    bcdedit /set {badmemory} badmemoryaccess no

    Applies to win 10.
    Thanks for the post. I wouldn’t have had the working sytem without you.
    I’ve had problems updating win8 to win10 because of the “not enough ram to create ramdisk” message. I’ve cleared badmemory with
    “bcdedit /deletevalue {badmemory} badmemorylist”
    command and then I was able to install win10. But then I had random crashes very often (twice a day or more). To cut the king stiry short: it wasn’t bad drivers, earlier incompatible software etc. And for three weeks I fought with my rig :). And as I hadn’t have any hardware problems earlier…. :) what have I thrown at microsoft :D Luckily I remebered that I did bcdedit command. The rest is google…
    Thank you again :)

  8. Charlie says:

    Hello thecomputerperson, Thankyou for this discussion, it is the clearest simplest explanation i have seen on the internet on how to blacklist some memory in windows. Im in the middle of doing so for a laptop i have which unfortunely has embedded ram. However i was wondering if you can give a little help as i am still a little confused on how to read and convert the address’s memtest is giving out. Thankyou in advance and hope all is well on your side of the world

  9. Take the location like 255.984375 MB from memtest and then *1024 then *1024 then divide by 4096 and turn the result into hex.
    If you did it right the location calculations should match the excel screenshot.

    Good luck.

  10. Charlie says:

    Thankyou. i now understood what you do in excel sheet. Thankyou. Have another couple of questions if you dont mind. DId you use Memtest86 to get the results? As my adress results are only to 1 decimal place “eg: 5227.3MB

    Also once you get the HEX value in this case lets use FFFC from my spreadsheet. do you need to further convert? EG you have (0xB7) in your command, or is the (0xB7) already in HEX, as i noticed this is what u used
    bcdedit /set {badmemory} badmemorylist 0xB7

    Thankyou and sorry its been a long long time since ive been in school learning hex… i “used” to know it:D

  11. 0xFFFC should do the trick iirc. As for the decimals and region of ram.. chuck the whole string of them into the bad list to cover that entire decimal(?).

  12. Charlie says:

    Ah i see, thankyou
    So to clarify, if say i had a bad memory range from 3400mb -to 3500mb
    Do you think i would need to enter 3400, 3401, 3402……….3499, 3500
    Or do you think i would nee4d to enter 3400.0, 3400.1, 3400.2………3499.9, 3500.0 or maybe even smaller?
    What i mean is how often does it need an entry?
    Thankyou again for your help

  13. I expect one for every “microsoft page” so in the increments on the spreadsheet. I remember having trouble trying to run a command with so many attributes.
    (It has been a while since I’ve done this so sorry if I’m a bit rusty on the specifics).
    If you don’t already know – a good tool for testing RAM once you are in windows is Prime95.

  14. Charlie says:

    thankyou this will be tonights job ..ill try and make an excel that will work out all my values and a bat file to enter them into command
    i will post up wat i make Thankyou for your time..

  15. Charlie says:

    believe it or not.. i didint get a chance to do it.. but am back to it and writing the script now!.. i WILL get back to write how it went

  16. mirh1 says:

    Given memtest86+ didn’t seem to have any kind of logging on my BIOS-based computer (and who seriously would copy addresses one at a time by hand?) I decided to blacklist a whole memory range altogether.
    I took the lowest and highest figures I could spot on display (in my case 760,5MB and 760,6MB), “lengthened” their span by an additional 0,1MB for safety, then went through your calculations/conversions.

    Instead of calling it a day though, I converted the lowest page number nack into DEC, copied its value to a separate cell and put DEC2HEX into the one next to it.
    By dragging both of them down (and stopping when I reached the max interested value) I could get a pretty good list of every existing page in my affected range.

    You can in the end get right bcdedit command format by using Notepad++ to replace “\n\r” characters to ” 0x”.
    Should you have *too many* PFNs for BCD to stand, you could try https://github.com/prsyahmi/BadMemory

  17. Charlie says:

    In the end, the windows command wasnt sufficient enough for me as i had so many entries as i was blocking out over a 1gb of ram. The method posted by mirh1 worked like a charm however. And successfully working my laptop well again
    Thankyou to all that helped out

  18. airmark says:

    Memtest86 shows one address (one bit) in error so I thought of using the above method instead of replacing the RAM. It’s also quite high 7944mb (1f080d0a0 to be exact) out of 8gb of RAM which is underutilized so it’s possible that it wouldn’t be accessed anyway.

    However when I use the command it gives me the below error message:

    C:\WINDOWS\system32>bcdedit /set {badmemory} badmemorylist 1f080d
    The integer data is not valid as specified.
    Run “bcdedit /?” for command line assistance.
    The parameter is incorrect.

    Any ideas? Running Windows 10 Pro.

  19. Juan Fogelman says:

    you can’t write 1f080d…
    you need in hex “0x[numberpage]” …
    ex:
    0xB7
    or
    0x012ABF

  20. kokko says:

    Thanks for this solution, for author and coments. Was very helpfull. Better repair instead of buying new one.

  21. Mohammed Akram says:

    I have DDR3 8gb stick and my system is slow and some time it hangs, after memory check I found few bad sectors in RAM,
    Kindly give me procedure to block the bad sectors

  22. The page tells you the commands¡ Also… If you have removable RAM I recommend replacing the stick rather than continuing to use it. The instructions are really only sensible for machines with soldered in RAM that you cannot change.

  23. Stefan says:

    Hello, so I have followed you instructions, but, I think doesn’t work.
    The bad addresses are from 0x2950fc00 to 0x2950d100ffc, which are the right commands to block the computer to acces them?

  24. As noted in the main article…

    bcdedit /set badmemorylist 0xB7 0xB8 0xB9 0xBA 0xBB 0xBC 0xBD 0xBE 0xBF 0xC0 0xC1
    etc.

    But going by your 0x2950fc00, it looks like you may not have the right locations or have calculated them wrong? They seem to be too long. How did you get the location addresses?

  25. Stefan Furtuna says:

    I got them from memtest86.
    So which could be, I will attach a screenshot.

    https://imgur.com/a/MdjUhcv

    Here you have it sir. And thank you

  26. Yea, I’m not sure that the address ranges noted in Memtest are the same as the Microsoft “Page address”. When I had the problem I took the range in megabytes and used the excel formula (see the screenshot) to calculage the Microsoft page address.

  27. Stefan Furtuna says:

    Ok then, how do I find addresses like yours? 0xB7 etc.

  28. When I had the problem I took the range in megabytes and used the excel formula (see the screenshot) to calculate the Microsoft page address.

  29. Stefan Furtuna says:

    Last question maybe before reinstalling windows with GitHub app to block the badblocks.

    Will this help you?
    http://imgur.com/a/uuBuN6S
    I have converted the hex from memtest86 to Dec for windows.

    Any guidance? I am on the right side? Haha

  30. No :D Use the excel formula shown in the screenshot on this page!

  31. juan gustavo Fogelman says:

    the keys are:
    0x10000000 in memtest = 0x10000 in windows
    0x00001000 in memtest = 0x1 in windows
    page windows cut the 3 hex from right
    page windows cut the 0 from the left
    so…
    002950fc in memtest = 0x295 in windows
    0029d100 in memtest = 0X29d in windows

    try this

  32. Francisco says:

    @juan gustavo fogelman
    That is because 0xFFF (hex) = 4095 (decimal). It starts from 0 so it means a 4096 bytes address space.
    That means that the last 3 hex numbers are inside the same memory page number.
    Example: 0x002950fc = 2707708 decimal / 4096 decimal = 661,06 decimal
    661 decimal = 0x295
    It is the same as deleting the last 3 hex digits.

    Just for reference:
    The value showing at Memtest is the address specified in bytes (in hex).
    Strange thing it that it also show the address offset in Mb. But when doing the conversion from Mb I get a different page number.
    Will try this tut to blacklist a bad memory region and will comment again in a few days.

  33. Francisco says:

    Already tried it.
    There was only 1 bad byte in the RAM. It was byte 0x0005f15afcc. So I added 0x5f15a to the black list.
    I run AIDA64 stability test for about 4 hours and it didn’t fail so it seems to be working.
    Here you can watch how it is ommited on the system memory.
    https://imgur.com/a/m3INbVQ

    It was a swappable RAM, but here in Argentina memories are very expensive right now and for a machine that has very little use I didn’t want to spend the money…

  34. Jevuner says:

    I have bad byte 0x338E553F0 in memtest86 (it say 13198MB)
    Is it correct to add 0x338e55?
    It was a while when I’m was dealing with this problem (before windows reinstall)
    And people who helped me said to add 338E00 (0x338E00 ?) I’m confused so add both.
    It would be good if someone post correct formula for those who not very familiar with spreadsheets…

  35. Francisco says:

    @jevuner
    Add only 0x338e55 to the blacklist, that is the correct one.

  36. Ruben says:

    Hey,
    I want to block memtest86-address LOW 0x0039a214088 till HIGH 0x003bffcbff0. So I tried the following command:
    “bcdedit /set {badmemory} badmemorylist 0x390000 0x3a0000 0x3b0000 0x3c0000” Remove the zero’s in front and remove 3 last digits.
    But it doesn’t work (bootloop with various BSOD’s).
    I also tried to add the whole list which contains over 150.000 different locations. That is impossible to fit into CMD.
    What am I doing wrong? Does someone have a solution?

  37. Francisco says:

    @ruben
    You have to blacklist every one of the memory pages, from 39A214 to 3BFFCB.
    There are exactly 155063 locations.

    Test the software shared above
    https://github.com/prsyahmi/BadMemory/releases
    Using the region I mentioned

  38. Ruben says:

    @Francisco At first I was a bit hesitant to install the BadMemory Driver.
    But I gave it a try and it is now working without any errors for a couple of weeks.
    Thanks for the advice!

  39. Which method is better? https://github.com/prsyahmi/BadMemory/releases or Bcdedit?
    For me none of them worked. Somebody with Windows 10 could PM me?

  40. Dragos says:

    Hey man! Thanks for this great article.

    Memtest gave me this range:
    Lowest Error Address 0x3CA1A6D4 (970MB)
    Highest Error Address 0x4FED2930 (1278MB)

    I entered this values in bcdedit, they appear listed, but I still have bsods.
    0x3c
    0x3d
    0x3e
    0x3f
    0x40
    0x41
    0x42
    0x43
    0x44
    0x45
    0x46
    0x47
    0x48
    0x49
    0x4a
    0x4b
    0x4c
    0x4d
    0x4e
    0x4f

    I know i`m doing something wrong, but I don`t know what.
    This is on a Surface Book 2 with soldered ram, for which Microsoft refuse to give me warranty.

  41. moonlightrider says:

    Hi
    I recently discovered some errors in my RAM, it’s actually just one error that repeats across tests, always just one address.
    I’m running Windows 10 x64

    After many hours trying to make this trick work I finally found that the command “bcdedit /set {badmemory} badmemorylist” do not work for me. After countless restarts, and running RAMMap to check if the memory address exclusion was working, it would never reflect those changes.

    Then I decided to execute the “incorrect” command as mentioned in this article
    bcdedit /set badmemorylist 0xaddress
    Rebooted and checked with RamMap and it worked!!
    Don’t get me wrong, I’m thankful for this article and but it looks like the “incorrect” command as seen in many forums, actually works.

    @Dragos, try bcdedit /set badmemorylist 0xaddress (without “{badmemory}” to see if it works like it worked for me).
    You should always check Physical Ranges with RamMap to see if badmemorylist addresses are actually working.

    Many thanks for the OP for making me realizing this was possible under Windows OS.
    My RAM is actually under warranty, but it’s DDR3, not available anymore (even if listed in online shops, then when buying is out of stock!!!) and they probably would at best give me back the money, but would lose 8GB of RAM for just one tiny error. (at least for now! :) )

  42. How very strange. I’m not sure what operating system I did my article on so maybe microsoft fixed their command to match the documentation rather than fix the documentation :D ?

  43. Dragos says:

    For me it worked with the op workflow. I verified with “bcdedit /enum {badmemory}” and also with RamMap. I still get bsods though.
    Maybe because I put in the bad memory list the error addresses and not the range between the lowest error and the highest one.
    I also tried BadMemory but it gets windows into repair loop saying the file badmemory.sys is corrupt.
    Microsoft still won`t honor the warranty so now I have an expensive paper weight.

Comment on this topic

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s