Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .