1. Overheating. Is there sufficient space around it for cooling? Nothing on top? Is the heatsink up? Try aiming a fan of some sort at the unit, see if that makes a difference.
2. Bad RAM. Download memtest86 and write it to a USB drive then let it run for a couple of hours. Any reported RAM faults is cause to swap the RAM out.
if you have the same problem with pfsense the power supply might be the problem. It might be sensitive to "noise" on the grid. I would suggest a "online" UPS since that will output nice and clean power if working properly.