28

I've got a fairly complex javascript application (it uses no external frameworks) that users are currently testing (a couple thousand lines). I've been getting reports that users are getting the popup in Google Chrome saying:

The following page(s) have become unresponsive. You can wait for them to become responsive or kill them.

They report that the only way to keep using the app is to open a new Chrome window, but that the messages comes back up every few minutes, and only happens when they try to go to a new page. They specifically said that they click to go to a new page, and the current page never changes, they just see the spinning loading icon for a minute until the popup comes sup.

The odd thing is that I've tested extensively on the exact version of Chrome (18) that these users are having issues with, and I've seen no problems. I'm sort of stumped and don't know where to look now since I've been unable to duplicate it, any ideas on where to look next to at least try and figure out what could even be causing that error?

Aaron Butacov
  • 32,415
  • 8
  • 47
  • 61
James Simpson
  • 13,488
  • 26
  • 83
  • 108
  • 6
    Try running SpeedTracer for Chrome to get a profile of any long-running processes, then investigate those for memory-leaks, heavy computation, etc. https://developers.google.com/web-toolkit/speedtracer/ – Evan Davis Apr 05 '12 at 20:56
  • 2
    One thing you could try is taking a Heap Snapshot, to see if there is some object that's consuming a increasing amount of memory. Also, try to spot what parts of your code are the ones that require more compute time, and comment them or use setTimeout, until you can spot the exact location of the issue – nicosantangelo Apr 05 '12 at 21:57
  • Any idea why either of those wouldn't affect everyone the same way? – James Simpson Apr 06 '12 at 01:27
  • Chromes Profiles / Profiler allows you to let existing code run a benchmark to see what logic is costing the most resources. That is most likely the culprit.+ – Illuminati Jun 15 '17 at 21:46

3 Answers3

20

I know this is an old question but I had this problem as well, and my best recommendation to you is the following:

Close Chrome completely and then add " --enable-logging" to your chrome shortcut to start it with that flag, you can even add " --enable-logging --v=1" to enable verbose logging.

I know with me, inserting a breakpoint wasn't an option because it was in a new tab that crashed before I could even get the console up. However, by enabling logging, the console gets written to a file in your chrome data directory ("C:\Users\username\AppData\Local\Google\Chrome\User Data")

I hope this helps somebody someday like it did me! :D

Jared
  • 2,999
  • 1
  • 28
  • 39
18

Use the chrome javascript debugger to pause (breaks running code) during the unresponsiveness. It takes some timing, but it should break in the middle of whatever is running too long. You can then use the debugger controls to step around and see what is looping unnecessarily.

Colin Godsey
  • 1,293
  • 9
  • 14
4

I had a page today that had some buggy JS (infinite loop) and I couldn't open the dev tools via keyboard shortcut or right click (Chrome 60.0.3112.113). Was able to get past this by:

  1. Open new tab
  2. Open dev tools (on empty tab)
  3. Enter URL and load
  4. Pause JS execution in dev tools

Maybe this will help someone! Also chrome debugger persists breakpoints across browser tabs (for same JS) so if I wasn't able to determine exactly what was causing the error, my breakpoints would still be there in a new tab!

tgrrr
  • 1,279
  • 1
  • 9
  • 10