If a computer freezes you might want to check the HDD with HDTune. The application is used to display SMART information. If you see anything RED-colored in the Health tab, then you need to replace it. Another solution is to update the drivers for all of your hardware parts.
Maintenance plays an important role meaning that you should periodically clean your computer; in this case you should use a tool like CCleaner. Uninstalling unneeded applications is also a good step.
You can test RAM memory with Memtest86. Use the main website to find out how to boot the application from a CD or a USB flash drive. After you've done that, run a full test or PASS. It should take approximately 15 minutes. If the scan shows no red-colored warnings, then the memory is fine.