That happened to me a lot on my old computer. the problem for me is it was hopelessly overusing my RAM. Usually right before this happened I would get an error message that I was low on virtual memory. if your situation is the same, gettin more ram should do the trick hope that helped.