The next time the Firefox freezing happened, I opened the Task Manager and found there was a process named plugin-container.exe which did not look normal. I decided to kill the process. After I did that, the script-not-responding alert dialog showed up. By stopping the script, the Firefox was waken up. Then I know plugin-container.exe is the key.
Searching on the web directed me to this article Plugin-container and out-of-process plugins. To me, the cause is most likely that the plugin-container is not fully compatible with the flash player plugin. The solution would be disabling the plugin-container:
- Type about:config in the Location Bar (address bar) and press the Enter key.
- (Optional) Click the "I'll be careful. I promise!" button to continue.
- Type dom.ipc.plugins.enabled in the Filter.
- Double click on the preference dom.ipc.plugins.enabled to change its value to false.
- If there are more items of dom.ipc.plugins.enabled.<plugin-filename>, do the same thing (set the value to false) to all of them.