What should I do when Ubuntu freezes?
I use ubuntu 11.04 64bits. Sometimes ubuntu will get stuck that everything paused including mouse, keyboard, etc.
How can I find out what happened? How to fix it?
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
By "getting stuck" I assume you mean "getting stuck temporarily", the system freezes for a moment, and then the reactivity is back. In my experience, such behavior is caused by extreme high system load, especially IO operations (writing / reading from disk) due to high memory usage and the necessity of using swap.
If this is a thing that happens on a regular basis, I would start monitoring the system load and what programs consume the CPU and memory.
Start by installing
Alternatively, use gnome-system-monitor.