views:

1164

answers:

4

I'm currently experiencing an intermediate problem with some inherited client side javascript. Every so often the users' experience a browser hang with the cursor becoming an egg timer and then the browser failing to respond.

I'm having real difficulty in determining where the issue is arising from. Short of disabling large chunks of javascript at a time is there any way to detect a hang in internet explorer and then examine the stack trace to determine the last few functions called in order to localise the problem?

Any help with this would be really appreciated.

+4  A: 

Update: You can use Web Development Helper or IE Dev Toolbar to trace your Javascript calls. Fiddler is also a powerful web debugging proxy.

If you want to eliminate the IE part of the problem, disable all unnecessary addons loaded in Internet Explorer first. I had a big problem with skype addons.

If you want to do low level monitoring, you have to use tools like Process Explorer and Process Monitor. They have functionalities to show the stack trace, your trace of files and registries being accessed etc from your IE.

For javascript profiling, you can use a tool like firebug.

Gulzar
A: 

The application is IE only and not Firefox compatible as the company infrastructure does not support Firefox. Also, this also occurs on a stripped down virtual machine which has no ie addons or toolbars installed.

A: 

Have you really no idea what so ever about which particular script could be causing the issue? IE8 beta 2 has some nice debugging / profile features, I would tend to look for the possible resource culprits (e.g google maps, ajax calls, dom manipulation table appending etc) and use the debugger to set breakpoints and monitor things this way. Also I would check using firebug profiler also to see which methods were being called most and taking the most time, you may gain an answer in those results or at least provide you with a starting point

redsquare
I can repeat the same steps a number of times and have no error but then seemingly randomly I will get a browser hang.I guess what I'm asking for is a good strategy for tracking the bug and eliminating it when I cannot easily replicate it. I'd hoped there was a way of catching a global ie hang.
If you run the app and attach visual studio (if you have it) and attach that to the ie process you should be able to press pause in visual studio when ie starts to hang up and it should break into the js stack. I used this to debug an issue I was having with polygons being created in for google maps
redsquare
but you need visual studio (2008 I use) - visual web express (free cut down version) may also have the same capabilities but never tried with that
redsquare
A: 

I can repeat the same steps a number of times and have no error but then seemingly randomly I will get a browser hang. I guess what I'm asking for is a good strategy for tracking the bug and eliminating it when I cannot easily replicate it. I'd hoped there was a way of catching a global ie hang.