I have 8 GB ram too, and when i made some tests (On lan, comparing my old firewall rules with my new ones) my computer ram goes from 3~4 gb ram usage to 9 GBS summing swap in some seconds, So you can try 'top', look at your process and wait till it crash so you can see what program is using that much ram and then ofc fix the problem.....