And there's an app for that, aptly named stressapptest (originally developed by google). In the (now distant) past, I found it to be much more efficient (in terms of runtime until fault detected) and effective in finding memory related (RAM chips or memory controller) defects than memtest.