the OS X disc that came with your mac includes a diagnostic mode. press "d" while booting to boot into the diagnostic program and there it includes a memory testing function. or try the OS X version of memtest at
http://www.memtestosx.org/
but i guess random rebooting is mainly an OS or hdd problem. crashes and freezing are RAM related problems. since your problem is the former and you have already re-installed your OS, that leaves your hdd as the most likely cause.