A software approach to a hardware problem is an exercise in futility.
Test your memory with Memtest86
Test your disks too. badblocks is a Linux utility. I like the Victoria and HDDScan Windows programs because they’re less pass/fail in their reporting - you can see that a disk is degraded even if all of the sectors technically respond.