If the system totally freezes such that you can't even ssh in, that's just flaky hardware and you should replace it.