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.

Has Linux some mechanism to test memory online as a background job, flag bad memory as unusable and warn the user if memory is faulty?

Much like running Memtest86+ on a little chunk of memory every nth minutte until all memory is tested and then repeat over.

Edit: I did not make it clear that I want such a service running in the kernel. A (peak) performance hit should be avoided by running the test in small steps and only when the system have some CPU cycles to spare

Edit2: I meant this as a Linux kernel service that scans the memory in the background. Not meant to be run in userspace but a routine in the kernel itself, perhaps in the memory manager to make sure memory are sane!

share|improve this question
2  
Why would you want such a thing? It would incur a large performance cost at very small gain. I supposed you can iterate a pointer if you want, but this is not recommended. –  soandos May 28 '11 at 22:57
    
I edited the answer to clarify. The idea is to detect memory errors perhaps before the memory is even used. If this can be done when the system is bored it could increase the overall stability as far as I can understand –  Waxhead May 29 '11 at 21:48
    
I think this is such a low probability event that I do not know why you are testing for it. In programming terms, I would wrap it in a try catch as opposed to testing a condition. –  soandos May 29 '11 at 22:09

2 Answers 2

There is a memtester application. If you are running ubuntu or something touching the repo's you can install is with:

    apt-get install memtester

This can't flag the memory as faulty, but it can alert the user to bad memory, and will essentially function as memtest86. It's up to you as to how you put it into a script. Here's a site for some reference: http://www.cyberciti.biz/faq/linux-how-do-i-find-out-causes-for-memory-faults/

share|improve this answer

A user process cannot really test all (of physical) memory since Linux uses memory management and allocates virtual memory space. In a worst case scenario, the memory test program thinks it is testing megabytes of memory, but because of virtual memory and paging, only a few 4096 bytes of physical memory pages might be tested.

So a memory tester in Linux could certainly exercise memory logic hardware, but there is no way to access every physical memory location. Any workaround for the virtual memory and kernel relocation issues could open up an unacceptable security hole.

share|improve this answer
    
Sorry, but I did not made it clear in my question that I would like for this feature to be in the Linux kernel. I edited my question above to clarify. –  Waxhead May 29 '11 at 21:50

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.