1

我想请你帮忙分析一下线程转储。我有一个丰富的 SWING 应用程序,其中一位用户声称它在退出时挂起并在后台运行,消耗大量 CPU。我所拥有的只是线程转储。“AWT-EventQueue-1”线程对我来说似乎很奇怪。

你知道出了什么问题吗?

先感谢您。

2012-11-30 11:19:26
Full thread dump Java HotSpot(TM) Client VM (20.5-b03 mixed mode, sharing):

"Thread-1" daemon prio=6 tid=0x04aa8c00 nid=0x35ec runnable [0x07ccf000]
   java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WToolkit.shutdown(Native Method)
    at sun.awt.windows.WToolkit.access$200(Unknown Source)
    at sun.awt.windows.WToolkit$2$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"TimerQueue" daemon prio=6 tid=0x04aa8000 nid=0x2b58 in Object.wait() [0x062ff000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x145b0020> (a javax.swing.TimerQueue)
    at javax.swing.TimerQueue.run(Unknown Source)
    - locked <0x145b0020> (a javax.swing.TimerQueue)
    at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"CacheCleanUpThread" daemon prio=6 tid=0x04aa7000 nid=0x3184 in Object.wait() [0x05f0f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x1451f930> (a com.sun.deploy.cache.CleanupThread)
    at java.lang.Object.wait(Object.java:485)
    at com.sun.deploy.cache.CleanupThread.run(Unknown Source)
    - locked <0x1451f930> (a com.sun.deploy.cache.CleanupThread)

   Locked ownable synchronizers:
    - None

"CacheMemoryCleanUpThread" daemon prio=6 tid=0x04aa6c00 nid=0x2484 in Object.wait() [0x05e7f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x145130c8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    - locked <0x145130c8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    at com.sun.deploy.cache.MemoryCache$LoadedResourceCleanupThread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"ConsoleWriterThread" daemon prio=6 tid=0x04aa6400 nid=0xb64 in Object.wait() [0x05def000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x1439d3d0> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:485)
    at com.sun.deploy.util.ConsoleTraceListener$ConsoleWriterThread.run(Unknown Source)
    - locked <0x1439d3d0> (a java.lang.Object)

   Locked ownable synchronizers:
    - None

"AWT-EventQueue-1" prio=6 tid=0x04aa6000 nid=0x3538 runnable [0x05d5e000]
   java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WComponentPeer.addNativeDropTarget(Native Method)
    at sun.awt.windows.WComponentPeer.addDropTarget(Unknown Source)
    - locked <0x145b53c0> (a sun.awt.windows.WFramePeer)
    at java.awt.dnd.DropTarget.addNotify(Unknown Source)
    at java.awt.Component.addNotify(Unknown Source)
    - locked <0x14214c40> (a java.awt.Component$AWTTreeLock)
    at java.awt.Container.addNotify(Unknown Source)
    - locked <0x14214c40> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    - locked <0x14214c40> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    - locked <0x14214c40> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    - locked <0x14214c40> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    - locked <0x14214c40> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    - locked <0x14214c40> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at javax.swing.JRootPane.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    - locked <0x14214c40> (a java.awt.Component$AWTTreeLock)
    at java.awt.Window.addNotify(Unknown Source)
    - locked <0x14214c40> (a java.awt.Component$AWTTreeLock)
    at java.awt.Frame.addNotify(Unknown Source)
    - locked <0x14214c40> (a java.awt.Component$AWTTreeLock)
    at java.awt.Window.show(Unknown Source)
    at java.awt.Component.show(Unknown Source)
    at java.awt.Component.setVisible(Unknown Source)
    at java.awt.Window.setVisible(Unknown Source)
    at com.sun.deploy.util.ConsoleWindow.showConsole(Unknown Source)
    at com.sun.javaws.util.JavawsConsoleController.showConsoleIfEnable(Unknown Source)
    at com.sun.javaws.Launcher$1.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(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-EventQueue-0" prio=6 tid=0x04aa5800 nid=0x365c runnable [0x05ccf000]
   java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WDesktopProperties.getWindowsParameters(Native Method)
    at sun.awt.windows.WDesktopProperties.getProperties(Unknown Source)
    - locked <0x143d9bb8> (a sun.awt.windows.WDesktopProperties)
    at sun.awt.windows.WToolkit.updateProperties(Unknown Source)
    - locked <0x14216dc8> (a sun.awt.windows.WToolkit)
    at sun.awt.windows.WToolkit.access$300(Unknown Source)
    at sun.awt.windows.WToolkit$5.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(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

"DestroyJavaVM" prio=6 tid=0x04aa5400 nid=0x3054 waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Java Web Start Main Thread" prio=6 tid=0x04aa2c00 nid=0x2d34 in Object.wait() [0x0523f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x1423ec20> (a java.lang.Thread)
    at java.lang.Thread.join(Unknown Source)
    - locked <0x1423ec20> (a java.lang.Thread)
    at java.lang.Thread.join(Unknown Source)
    at java.lang.ApplicationShutdownHooks.runHooks(Unknown Source)
    at java.lang.ApplicationShutdownHooks$1.run(Unknown Source)
    at java.lang.Shutdown.runHooks(Unknown Source)
    at java.lang.Shutdown.sequence(Unknown Source)
    at java.lang.Shutdown.exit(Unknown Source)
    - locked <0x391b9068> (a java.lang.Class for java.lang.Shutdown)
    at java.lang.Runtime.exit(Unknown Source)
    at java.lang.System.exit(Unknown Source)
    at com.sun.javaws.Main.systemExit(Unknown Source)
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    at com.sun.javaws.Launcher.launch(Unknown Source)
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"Javaws Secure Thread" daemon prio=6 tid=0x04a9e800 nid=0x344c in Object.wait() [0x051af000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x1421b1d8> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:485)
    at com.sun.javaws.ui.JavawsSysRun$SecureThread.run(Unknown Source)
    - locked <0x1421b1d8> (a java.lang.Object)

   Locked ownable synchronizers:
    - None

"AWT-Windows" daemon prio=6 tid=0x04a9e000 nid=0x4dc runnable [0x0511f000]
   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

"AWT-Shutdown" prio=6 tid=0x04a9dc00 nid=0x1fe4 in Object.wait() [0x0508f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x14210788> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:485)
    at sun.awt.AWTAutoShutdown.run(Unknown Source)
    - locked <0x14210788> (a java.lang.Object)
    at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"Java2D Disposer" daemon prio=10 tid=0x04a9d400 nid=0x19ec in Object.wait() [0x04eaf000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x1421aab8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    - locked <0x1421aab8> (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

"traceMsgQueueThread" daemon prio=6 tid=0x021c6400 nid=0x1968 in Object.wait() [0x047ff000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x141c0490> (a java.util.ArrayList)
    at java.lang.Object.wait(Object.java:485)
    at com.sun.deploy.util.Trace$TraceMsgQueueChecker.run(Unknown Source)
    - locked <0x141c0490> (a java.util.ArrayList)
    at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
    - None

"Low Memory Detector" daemon prio=6 tid=0x0217bc00 nid=0x3144 runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"C1 CompilerThread0" daemon prio=10 tid=0x02178400 nid=0x31b8 waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Attach Listener" daemon prio=10 tid=0x02174000 nid=0x16ec waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Signal Dispatcher" daemon prio=10 tid=0x0216f000 nid=0x2164 runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Finalizer" daemon prio=8 tid=0x02167400 nid=0x9f8 in Object.wait() [0x0449f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x14191148> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    - locked <0x14191148> (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" daemon prio=10 tid=0x02166000 nid=0x2210 in Object.wait() [0x0440f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x14191048> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:485)
    at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
    - locked <0x14191048> (a java.lang.ref.Reference$Lock)

   Locked ownable synchronizers:
    - None

"VM Thread" prio=10 tid=0x02129400 nid=0x2ec0 runnable 

"VM Periodic Task Thread" prio=10 tid=0x0218d800 nid=0x2848 waiting on condition 

JNI global references: 1323
4

1 回答 1

1

谷歌搜索线程转储分析,以帮助您了解您手中的内容。

除此之外,您可能还想使用VisualVM进行进一步分析,以检查 GC 频率和堆使用情况。

如果没有更多关于您的应用在所谓的减速期间做什么的信息,恐怕这是我们可以提供的唯一提示。

于 2013-02-19T14:10:31.057 回答