Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Thread handling, what if AWT-EventQueue-0 stays in "Unsafe.park"? (Newbie)

scampsdMay 28 2015 — edited May 29 2015

Good afternoon,

I'm relatively new at Java Thread programming, and I have fallen in following situation: I have a AWT button (up/down), which normally works quite well.

Now however in some cases, after some "up" clicks I see that my application seems not to react anymore (the button reacts on the up/down clicks, but the processing which correspond are not always executed).

When I press the "Suspend" button in my Eclipse environment (pausing the application), I see a call stack of the "AWT-EventQueue-0" thread, ending with "Unsafe.park()" method.

After some googling, I have decided to launch a "jstack -l <PID>" of my application, but I have no idea how to interprete the result.

For a good understanding: I can't modify the "AWT-EventQueue-0" thread in any way: it gets started automatically by "JFrame.pack()" method.

Hereby the results of my "jstack -l <PID>" command (my application is not suspended in Eclipse at this time):

C:\Program Files\Java\jdk1.8.0_40\bin>jstack -l 9308
2015-05-28 14:49:16
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode):

"DestroyJavaVM" #40 prio=5 os_prio=0 tid=0x000000005a6e4000 nid=0x23b4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"GC Daemon" #38 daemon prio=2 os_prio=-2 tid=0x000000005a6e2800 nid=0x410 in Object.wait() [0x000000006082f000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at sun.misc.GC$Daemon.run(Unknown Source)
        - locked <0x00000000faf9ba60> (a sun.misc.GC$LatencyLock)

   Locked ownable synchronizers:
        - None

"RMI Reaper" #37 prio=5 os_prio=0 tid=0x000000005a6e1800 nid=0x1d00 in Object.wait() [0x00000000623ae000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        - locked <0x00000000faf9ba70> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        at sun.rmi.transport.ObjectTable$Reaper.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"RMI TCP Accept-1199" #36 daemon prio=5 os_prio=0 tid=0x000000005a6e1000 nid=0x23d8 runnable [0x000000006225f000]
   java.lang.Thread.State: RUNNABLE
        at java.net.DualStackPlainSocketImpl.accept0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
        at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
        at java.net.PlainSocketImpl.accept(Unknown Source)
        - locked <0x00000000faf33ce0> (a java.net.SocksSocketImpl)
        at java.net.ServerSocket.implAccept(Unknown Source)
        at java.net.ServerSocket.accept(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"Thread-8" #34 daemon prio=5 os_prio=0 tid=0x000000005a6e0000 nid=0x1fd8 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"JavaFX Application Thread" #33 prio=5 os_prio=0 tid=0x000000005a6df800 nid=0x1a88 runnable [0x000000005ee8f000]
   java.lang.Thread.State: RUNNABLE
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$null$145(Unknown Source)
        at com.sun.glass.ui.win.WinApplication$$Lambda$58/2070438137.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"Thread-7" #32 daemon prio=5 os_prio=0 tid=0x00000000596b7800 nid=0x1c14 waiting on condition [0x000000005ecbf000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000fac77c80> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.LinkedBlockingDeque.takeFirst(Unknown Source)
        at com.sun.glass.ui.InvokeLaterDispatcher.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"QuantumRenderer-0" #30 daemon prio=5 os_prio=0 tid=0x0000000055653800 nid=0x20d8 waiting on condition [0x000000005ea3e000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000fabde868> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"TimerQueue" #29 daemon prio=5 os_prio=0 tid=0x0000000059f99800 nid=0x9d4 waiting on condition [0x000000005d80e000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000fa884618> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.DelayQueue.take(Unknown Source)
        at javax.swing.TimerQueue.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
        - <0x00000000fa884818> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)

"Swing-Shell" #26 daemon prio=5 os_prio=0 tid=0x0000000058e6a000 nid=0x1ec8 waiting on condition [0x000000005b8fe000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000fa7ab808> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"AWT-EventQueue-0" #21 prio=6 os_prio=0 tid=0x00000000559bc000 nid=0x9a0 waiting on condition [0x000000005604e000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000fa6decc0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.awt.EventQueue.getNextEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"AWT-Shutdown" #19 prio=6 os_prio=0 tid=0x00000000557ed800 nid=0x1440 in Object.wait() [0x00000000569ef000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Unknown Source)
        at sun.awt.AWTAutoShutdown.run(Unknown Source)
        - locked <0x00000000fa6ddd08> (a java.lang.Object)
        at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"AWT-Windows" #16 daemon prio=6 os_prio=0 tid=0x000000005581f000 nid=0x704 runnable [0x000000005633f000]
   java.lang.Thread.State: RUNNABLE
        at sun.awt.windows.WToolkit.eventLoop(Native Method)
        at sun.awt.windows.WToolkit.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"Java2D Disposer" #14 daemon prio=10 os_prio=2 tid=0x00000000557ed000 nid=0x1b68 in Object.wait() [0x00000000561bf000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        - locked <0x00000000fa251330> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        at sun.java2d.Disposer.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"Thread-0" #13 prio=5 os_prio=0 tid=0x0000000055641000 nid=0x266c runnable [0x0000000055edf000]
   java.lang.Thread.State: RUNNABLE
        at java.net.DualStackPlainSocketImpl.accept0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
        at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
        at java.net.PlainSocketImpl.accept(Unknown Source)
        - locked <0x00000000fa4346e8> (a java.net.SocksSocketImpl)
        at java.net.ServerSocket.implAccept(Unknown Source)
        at java.net.ServerSocket.accept(Unknown Source)
        at com.barco.ets.ucam.breakhandler.UcamBreakHandler.run(UcamBreakHandler.java:40)
        at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"Service Thread" #12 daemon prio=9 os_prio=0 tid=0x0000000054146800 nid=0x201c runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"C1 CompilerThread2" #11 daemon prio=9 os_prio=2 tid=0x0000000054115800 nid=0xc60 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"C2 CompilerThread1" #10 daemon prio=9 os_prio=2 tid=0x0000000054115000 nid=0x25e4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"C2 CompilerThread0" #9 daemon prio=9 os_prio=2 tid=0x00000000540c1000 nid=0x1d78 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"JDWP Command Reader" #8 daemon prio=10 os_prio=0 tid=0x00000000540b5000 nid=0x1254 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"JDWP Event Helper Thread" #7 daemon prio=10 os_prio=0 tid=0x00000000540b1000 nid=0x186c runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"JDWP Transport Listener: dt_socket" #6 daemon prio=10 os_prio=0 tid=0x0000000052f2f800 nid=0x101c runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x00000000540a4800 nid=0x618 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x0000000052f28800 nid=0x135c runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x0000000052ecd000 nid=0x1db0 in Object.wait() [0x000000005409e000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        - locked <0x00000000fa5ba9b8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

   Locked ownable synchronizers:
        - None

"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x0000000052ec6800 nid=0x24ac in Object.wait() [0x0000000053f6f000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Unknown Source)
        at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
        - locked <0x00000000fa4352a0> (a java.lang.ref.Reference$Lock)

   Locked ownable synchronizers:
        - None

"VM Thread" os_prio=2 tid=0x0000000052ec1000 nid=0x2798 runnable

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x000000000215e000 nid=0x1e2c runnable

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x000000000215f800 nid=0x20a4 runnable

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x0000000002161000 nid=0x21dc runnable

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x0000000002164800 nid=0x1038 runnable

"VM Periodic Task Thread" os_prio=2 tid=0x000000005415e000 nid=0x174c waiting on condition

JNI global references: 20169


C:\Program Files\Java\jdk1.8.0_40\bin>


Does anybody have an idea?

Thanks

Dominique

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 26 2015
Added on May 28 2015
2 comments
1,678 views