IE hanging, using 100% of the CPU

…衆ロ難τιáo~ 提交于 2019-11-29 01:57:25

问题


I have a web application, which in the course of a normal interaction, hangs IE. By "IE being hung", I mean that IE doesn't respond anymore and using 100% of the CPU. The only to get out of this state is to kill the IE process. About the app:

  • It loads only one page in the browser, communicates with a server with Ajax queries, and updates the DOM.
  • I can reproduce this with both IE6 and IE7, but not Firefox or Safari.

I am wondering if anyone has seen this already, and if there are a few known cases that can get IE into this hung / using 100% of the CPU state.


回答1:


Use WinDbg, http://www.microsoft.com/whdc/devtools/debugging/

Attach it to the IE process that has the problem.

The .symfix+ command will set your symbol path to point to the Microsoft symbol server and cache the debug symbols locally.

The !runaway command will enumerate all the stacks in the process and tell you which one is going berserk.

If you're lucky, you may see something recognizable, such as a regex replacement at the top of the stack. Or perhaps the layout engine has gone into an infinite loop. Both of these have happened to me in the past.

If the callstack doesn't make sense, use 'g' to make the process go, wait a few seconds, hit Ctrl+Break, then try !runaway again.

Once you've got the symbols locally, you can also use SysInternals' Process Explorer to look at a process's stacks. Configure the Symbols option in Process Explorer to point to your local symbol cache, something like c:\Program Files\Debugging Tools for Windows\sym.




回答2:


Try attaching the script debugger (via Visual Studio, in my case), and see what is causing it.

Most likely it's a javascript running an infinite loop, or just looping too fast for what needs to be done per ajax request.




回答3:


Have you tried tracing the problem? If the problem also happens in IE8 you could use console.log commands and their awesome new debugger/dev tool that's built in. Otherwise use the old dev toolbar for IE or alerts. Try to reduce the problem and then file a bug (and paste the code here please).



来源:https://stackoverflow.com/questions/574423/ie-hanging-using-100-of-the-cpu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!