File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Occasional IE Lock-Ups Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Occasional IE Lock-Ups" Watch "Occasional IE Lock-Ups" New topic
Author

Occasional IE Lock-Ups

Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
I'm working on a J2EE application and, for some reason, Internet Explorer (7) occasionally locks up on me (it will freeze, go into "Not Responding", and has to be killed manually through the task manager). I have not tested this extensively with other browsers as my user-base is primarily IE-only. I have one page, in particular, that uses a lot of Java Script for the UI controls - this is the page that is giving me trouble. I am using both JQuery and Scriptaculous on the page.

I'm having a very difficult time debugging this for a couple reasons.

1. It only happens intermittently and almost never on my system.
2. When it does lock, it doesn't lock up "in my code". Rather, the browser will lock up when a user clicks on a control. Most often, the user will click on a span with an onclick and the browser will lock up prior to invoking the onclick method. Just yesterday, though, the browser locked up when a user tried opening a drop-down list, which has no onclick associated with it.

My best guess, at this point, is that I have a memory leak going on. Unfortunately, I've been unable to identify it with certainty and, most certainly, I haven't been able to fix it. I believe the issue lies in this code (although I'm not certain):



This code is invoked any time someone wants to add an "indicator" to the page. It's not essential to know what an indicator is, but it is represented with a single line of text. Beside that line of text is a little graphic "Minus.gif" that allows the user to click on the element and remove it from the page.

Is there anything here that looks like it could cause problems? I realize this is a rather vague question, but I'm very unsure of exactly where this problem lies. This is my best guess.

Thanks.


SCJP Tipline, etc.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Is it reproducible on multiple systems?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Bear Bibeault wrote:Is it reproducible on multiple systems?


Yes. Unfortunately, it rarely happens on mine and, on those systems where it does happen, it is intermittent. This is making it extremely difficult to debug.

I have verified that this issue occurs on multiple systems and to multiple users (and even the same user on multiple systems).
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

I don't see anything horrendous in your code that would drive IE batty. but then, it takes so little.

But, of course, the problem could lie elsewhere.

By the way, if you're using jQuery 1.3, you can simplify your code by adding the click handler to the new span using live(), rather than needing a separate function to bind it after the fact.
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Bear Bibeault wrote:By the way, if you're using jQuery 1.3, you can simplify your code by adding the click handler to the new span using live(), rather than needing a separate function to bind it after the fact.


Originally, I was doing that (or something very similar) but I was concerned that the handler might be getting references to all the method parameters and therefore causing a memory leak. So I moved it to a method on its own, hoping to minimize the issue. It seems to have made it somewhat better (it doesn't lock up as often), but it obviously hasn't solved the issue.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Have you watched the task manager to see if the page climbs in memory. Also it is wise to have people clear their cache Sometimes a full cache can cause havoc on a machine.

Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Eric Pascarello wrote:Have you watched the task manager to see if the page climbs in memory. Also it is wise to have people clear their cache Sometimes a full cache can cause havoc on a machine.


I've done all sorts of stuff to try to monitor the memory usage of this code. The test I was really trying to get something out of was to put this code into a large loop (executing 10,000 times, or so) and then watch a memory monitor to see what was happening. It did appear to use up a little more memory, but it wasn't much. That said, I have users that are running Windows XP with 512 MB of memory - they don't have a lot of room to spare.

I did make some changes and reran those tests and it appears that the page is now a little easier on the memory usage, but it's still crashing.

I can certainly try the cache clearing to see if that makes a difference.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You might find this useful : http://home.wanadoo.nl/jsrosman/

Eric
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Eric Pascarello wrote:You might find this useful : http://home.wanadoo.nl/jsrosman/


Thanks. I had been previously using Drip, which is looks like this is based on, but I haven't used this. Perhaps that will get me a little further.
Cloudgen C.F. Wong
Greenhorn

Joined: Jul 15, 2009
Posts: 19
I came across the sudden slow down or even lock-up in IE 6 (IE 7 and IE 8 are OKay). Firstly, we thought the problem came from the javascript code, we try to remove all the javascript and still cannot find the answer. Finally, after dividing code "piece-by-piece", it came out that the source of the problem came from a conditional style sheet which applied to a class of text boxes (and on that page, the number of the text box is more than 30).


cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Occasional IE Lock-Ups
 
Similar Threads
Need Help with Jquery Selector logic
Jack Up Browser Viewport
jquery accordion is causing jquery treeview picker to breakup
using ajax and struts iterate tags
Calling a new JSP form a Spring Controller using Ajax