Linux has a kernel argument memtest:

Specifies the number of memtest passes to be performed. Each pass selects another test pattern from a given set of patterns. Memtest fills the memory with this pattern, validate memory contents and reserves bad memory regions that are detected.

By reserving the memory what it means is that kernel makes it unavailable for userland allocation. This means you can run programs without having to worry about them writing to a defective sector of ram. You use memtest by providing the Linux kernel an argument to boot,

memtest=        [KNL,X86,ARM,PPC] Enable memtest
                Format: <integer>
                default : 0 <disable>

This is not a default. It takes 5-10 minutes to run through the 17 passes (current default). How can I do this on OS10?

Note: I can not replace the RAM. It's BGA soldered on.

  • Presumably you suspect that your RAM is faulty? That's not impossible, but is quite rare. Have you ruled out other possibilities?
    – benwiggy
    Mar 21, 2022 at 10:26

2 Answers 2


There is no macOS equivalent of the Linux kernel argument memtest.

You could perhaps make do with the macOS kernel argument named maxmem. If you set the boot-args to include for example maxmem=1024 this means that the system will only use the first gigabyte of memory. Ofcourse this is only practical if your RAM problem is located at the top end of memory addresses.

Another option is to make a memtest equivalent yourself. This is ofcourse only possible if you are a programmer yourself. You can download the macOS kernel source code and make this change to create your own kernel. It comes with a lot of practical downsides, but if it is just for recovering data from the system it might be good enough.

Finally, you could make a user-space version of memtest. If the system actually boots, you could make launchd start your own program early in the boot (delaying the rest of the boot), and that program would scan the memory for broken bits and allocating them as pinned allocations (i.e. ensure that it is not swapped out, compressed, or any other type of page table shenanigans is going on). This would ensure that other programs do not get those parts of memory allocated.

  • @Thinkr No, not at all. That answer seems to be based on a misunderstanding of the question here. I mention user-space testers (as that other answer is a user-space tester) in my answer here - and the one in the answer you have linked does not perform the actions I describe. It only performs half of what is needed - but it is the part that the user with the original question already had figured out - the functionality he is requesting, is not performed by "memtester".
    – jksoegaard
    Apr 16 at 20:24
  • Sorry for the confusion and thanks for the explaination. Have a nice day :)
    – Thinkr
    Apr 17 at 6:23

There is an “equivalent” to memtest called memtester. It’s a userland utility to test out the memory subsystem.

It’s available on both MacPorts (my preferred method) and Homebrew as well as from source. Incidentally, it’s also available for Linux, FreeBSD (via FreshPorts) and Solaris (Sun). The current version (4.6) works on Ventura on both Intel and Apple Silicon.

  • Is it Oracle Solaris you're talking about ? :)
    – Thinkr
    Apr 15 at 16:32
  • It’s still and will always be Sun to us former Sun folks @Thinkr
    – Allan
    Apr 15 at 16:42
  • But it's this you're talking about?
    – Thinkr
    Apr 15 at 16:46
  • Yes @Thinkr. It became Oracle Solaris after the acquisition
    – Allan
    Apr 15 at 16:47
  • 2
    "memtester" is not an equivalent - at all. I mentioned userspace memory testers in my answer more than a year ago. "memtester" does not at all offer the same functionality, and won't be able to solve the problem in the original question.
    – jksoegaard
    Apr 16 at 20:21

You must log in to answer this question.

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