Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to run Windows (7, x64) with a defective RAM module? More precisely, is there some way to tell Windows not to allocate a known bad address or block of addresses?

For Linux, there is BadRAM. Is there an existing implementation for Windows? Is that even possible with Windows' kernel (NT 6.1)? Maybe a kernel mode driver?

share|improve this question
3  
@ekaj If it was only a week after purchase, maybe replace it under warranty? ;) –  Bob May 3 '12 at 13:49
2  
Actually thats the smartest idea, Its broken, get em to fix it –  Journeyman Geek May 4 '12 at 12:29
add comment

7 Answers

up vote 9 down vote accepted

Bob, there's three parts to your question. I'll address one at a time.

Running Windows with bad memory

It is indeed possible to run Windows 7 with a defective module. Depending on the location of the bad sectors and where the module sits in your DIMM banks, Windows 7 will run like there's nothing as long as it doesn't try to touch the bad portions of the memory. So, ideally you'd move the defective module as far away as possible from bank 0. Naturally, if this is your only module, you are out of luck.

Blocking bad memory sectors in Windows

On x86 (32 and 64 bits) operating systems, memory is managed by the kernel. As you mention, BadMem is able to block bad memory sectors in Linux. It works by instructing the kernel to lock those memory addresses you specified. This effectively stops Linux from ever addressing those addresses when allocating (and deallocating) memory. But in order to do this, BadMem needs to patch the kernel. BadMem is nothing more than a kernel patch that you configure before applying.

Now, you don't have that ability on Windows. You cannot patch the kernel. Developing a kernel mode driver won't do you any good either, since the Windows kernel will never let your driver take precedence over its memory management architecture (understandably so).

For this reason, you cannot instruct windows in any way to not use certain memory addresses. The only way would be for Microsoft to patch the kernel for your case specifically. Unlikely.

The spreading of bad memory addresses

There are not many reasons why a memory module may contain bad addresses. Ultimately it all boils down to an error in the production line, assuming it didn't sustain damage before getting into your computer. Contrary to hard drives there's no movable parts in memory modules, as you well know. So, bad sectors don't tend to spread as is the case with hard drive sectors.

However, memory test software isn't foolproof. It's possible (and common) for it to pass certain addresses that are in fact bad. So bad memory may give the impression of "spreading" as more and more addresses are revealed to be bad. For this reason tools like BadMem reveal their weakness, because naturally they can only handle those addresses you instruct them to.

It's unlikely that anyone can conduct a thorough test of a memory module and identify all bad memory addresses, then lock them and end up with a "good" memory module. The easiest thing to do is to consider a module with bad addresses as a defective module throughout and consequently not to be trusted.

What this means is that, as much as BadMem is an attractive proposition, it in fact isn't a solution to the problem of bad memory. More likely then not you'll still end up with an operating system that tries to read a bad sector and crashes with a stop error. A bad module is a bad module is a bad module.

share|improve this answer
    
There are quite a few good answers, but I'll accept this for giving a good reason why not to do so. The Windows kernel can be told not to use past a certain address, as others have noted, but when the error is in the middle of the address space it's like using an axe when you want a scapel... finer control is desired but, apparently, impossible. It's a pity. –  Bob May 6 '12 at 3:45
    
Not quite correct; it is possible to instruct Windows to avoid certain addresses (more accurately, certain page frame numbers). The functionality is designed for ECC memory, with which Windows can detect possible faults and mark those PFNs as bad, but it is possible to manually add PFNs to the list: superuser.com/a/490522/117590 - just not very practical. So, yea, replacement remains the best option :P –  Bob Oct 21 '12 at 7:16
add comment

Eh, I wouldn't feel comfortable using memory I knew was bad, even if you could lock out the bad parts. I would buy a new stick for peace of mind.

share|improve this answer
add comment

As far as i'm aware, the only way to do this is using the BurnMem command which can artificially limit the amount of RAM windows uses.

share|improve this answer
2  
Hmm.. that's an interesting option. Perhaps maxmem, since apparently burnmem doesn't limit the max physical address while maxmem does. The Vista and 7 equivalent would be truncatememory. While this is a possible solution, is there a more precise method for cases where the defective memory is in the middle or beginning of the address space and blocking everything after it is not desired? –  Bob May 3 '12 at 12:10
    
@Bob - THe reason you cannot simply replace the bad memory modual is why? –  Ramhound May 3 '12 at 14:33
    
@Ramhound I could, if I wanted to. But that would take time. Right now, I'm running with half my original memory, not great for my VMs. Getting a new or replacement module that would actually work could take a few weeks. If a software solution lets me do this in two hours or less, I'd consider it time well spent and something new learned. I would accept this answer (my memory happened to fail right at the end of the address space) but if someone has a more versatile solution I would prefer that for future refference. –  Bob May 3 '12 at 15:02
    
@Bob - Having just read into this quite extensively, it appears that it is not possible. This is because BadRam utilises memtest to instruct the kernel to exclude bad adresses from the bootloader, Windows is unable to do this as there is currently no way for it to work out which bad addresses to exclude in the same way that a BadRam patched kernel can. –  Oliver G May 3 '12 at 16:52
add comment

The Windows BCD (Boot Configuration Data) actually has a {badmemory} object. It seems memory addresses that are "predicted to fail" by ECC memory will be listed here, and not used by the operating system.

The {badmemory} object accepts a BadMemoryList (BCD type 0x1700000a) element, which is a list of integers that can be entered as hex, separated by spaces. I guess it would be possible to manually insert bad memory addresses as found by memtest86 to this element - but I have not tested this. Apparently, it accepts 'page frame numbers, which is the actual address divided by 4096. Unfortunately, these addresses/PFNs may not match those reported by memory diagnostics. Manual editing can be done with Visual BCD Editor.

In any case, faulty memory sticks should be replaced as indicated by the other answers. This is merely a note on a possible way to work around the issue (temporarily?).

share|improve this answer
add comment

Windows BCD has {badmemorylist} and {badmemoryaccess} objects. You should set the first to bad memory pages separated by spaces (eg. bcdedit /set badmemorylist 1499543 1434007) and the second to No (bcdedit /set badmemoryaccess No)

Bear in mind that memory page size in windows usually 4KB

Tested in windows 7 and it works well

You can test your settings by Rammap by Sysinternals

PS i've got that info from "Windows Internals Book" chapter 10

share|improve this answer
add comment

Yes. There are boot parameter to control the amount of memory that windows can use. You can only remove from the end of the memory space though. See this msdn article to control boot parameters. The parameters of interest are truncatememory and removememory.

share|improve this answer
add comment

You could try this feature in Windows 7, but I am not sure which chip it will effect, or if it skims the same amount off of each one. I'll have to look around to find that out.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.