Garrett Hall
Garrett Hall

Reputation: 30032

What could cause the JVM to lock up mouse click and keyboard input for a machine?

I am running Java 6 on a Linux machine (RHEL 5) and my program occasionally locks up the input to the computer. No mouse clicks or keyboard strokes work. Oddly enough, the mouse cursor can be moved and the CTRL+ALT+F2 command works (although it doesn't bring up a terminal).

Using top and jvisualvm I see no memory leaks or other issues with the process. However, the only way to unfreeze the computer is to ssh from another computer and kill the java process. What could possibly be the cause of this behavior?

I can reproduce it occasionally by lowering the memory ceiling. It seems like deadlock might be here:

"Java2D Disposer" daemon prio=10 tid=0xae7d6800 nid=0x4451 in Object.wait() [0xae6ad000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0xb3253070> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
    - locked <0xb3253070> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
    at sun.java2d.Disposer.run(Disposer.java:127)
    at java.lang.Thread.run(Thread.java:662)

Upvotes: 1

Views: 472

Answers (2)

ulidtko
ulidtko

Reputation: 15643

The symptoms that you describe seem to me as an unreleased X11 keyboard&pointer grab. This can easily be caused by buggy or unresponsive GUI -> X11 layer. Check your GUI thread carefully.

Upvotes: 1

Adamski
Adamski

Reputation: 54725

The most likely thing is that you're performing a long running task on the Event Dispatch Thread, preventing it from servicing user input events, thus making your UI unresponsive.

You could verify this by running jstack or JConsole and looking at the stack trace for "AWT EventQueue".

Another alternative is that you're performing a legitimate UI task but have inefficiencies in the underlying code. For example, you may have defined a JTable containing 1000,000 rows and have based the underling TableModel on a LinkedList, leading to O(n) access per row.

Upvotes: 1

Related Questions