Hang in AWT-EventQueue thread with Java 1.5.0_10
843805Dec 3 2006 — edited Feb 9 2007I recently upgraded from JDK 1.4.2_04 to 1.5.0_10. A program I wrote that was rock solid under 1.4.2_04 now hangs after several minutes of successful operation.
I notice the hang as an "On Monitor" state for one of my threads that uses Swing. The thread is always blocked waiting on a contended monitor for javax.swing.text.DefaultHighlighter$SafeDamager when trying to call DefaultHighlighter#SafeDamager.damageRange. The last call made by my own code was to JTextArea.append.
In reviewing other threads, I find that thread AWT-EventQueue-0 owns the contended lock. However the AWT-EventQueue-0 thread is in a wait state having called Object.wait. One of the parameters I see being passed through the call stack of the AWT-EventQueue thread is a reference to the same JTextArea object.
Anyone have any insight into what is causing this problem to show up with JDK 1.5.0_10? As I said, the program typically runs successfully for several minutes. During that time 300 to 400 calls are successfully made to the append method for the same JTextArea object from the thread that eventually hangs in the On Monitor state.