There's 3 options, you can download and run diagnostics for memory and your hard drive, or reinstall the operating system after a low-level format with a program like WipeDrive.
"Why would Windows Restart?"
By default with installations, Windows will automatically restart upon system failures aka "BLUE SCREEN OF DEATH" or aka Windows "STOP" Bug Codes. This can be due to corrupt drivers or bad drivers for the operating system. You could have replaced a CPU fan for issues you may have been receiving from a Video Card, but seems like a CPU Issue. It's hard to troubleshoot intermitten errors, so you need to use diagnostics to indentify component failures.
Memory failures - If theres a failure for memory writes or reads, then you could either have an issue on your graphics card or the actual RAM In the system that caused the errors. Running Memory tests from Diagnostics will discover these errors in Memory and can be sometimes fixed by reseating the RAM. Other cases, the DIMMs (Direct Inline Memory Modules) need to be replaced for problem resolution.
Hard Disk failures - Typically before a hard disk fails, you will experience numerous amounts of failures revolving around bluescreen Stop codes. You can attempt to correct this by running CHKDSK -R but there's no guarantee of a fix because if the hard drive actually has faulty hardware, there's no work around. You need to have it replaced, if you run hardware diagnostics and call the Vendor with the hard drive error codes, they can typically replace the drive because the hard drive vendor can reimburse them for the faulty hardware if the error code is provided.
Best of luck to ya but you will need to run some hardware diagnostics.
http://www.ultimatebootcd.com/ - A good source for bootable diagnostics
That something called a memory leak means that all of the data that is written to RAM was not cleared by closing the application. Residual data remains sitting in RAM, but it sits in there and keeps your RAM in use instead of freeing it up as the design is intended.... Memory leaks are not your issue in this case unless your BSOD specifies errors in WIN32K.SYS which can be a failure in the Windows Virtual Memory/Paging system.