# [Mustang] jstack



## Thomas Darimont (21. Februar 2006)

Hallo!

mit dem Kommandozeilentool jstack lassen sich Thread Stack Dumps (Kann man bei jeder JVM mit Konsolenfenster erzeugen indem man dort die Tastenkombination Strg + Pause drückt) von lokal laufenden JVMs anzeigen lassen. (Eine Liste mit den Prozessids aktuell laufender JVMs bekommt man mit dem Tool jps).


```
C:\Programme\Java\jdk1.6.0\bin>jps
992 Jps
796 startup.jar
1512 startup.jar
1972 jedit.jar

C:\Programme\Java\jdk1.6.0\bin>jstack.exe 1512
2006-02-21 23:30:32
Full thread dump Java HotSpot(TM) Client VM (1.6.0-beta2-b72 mixed mode):

"Worker-15" daemon prio=6 tid=0x2cb0dc00 nid=0xd04 in Object.wait() [0x31cef000..0x31cefc14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:173)
        - locked <0x06169d48> (a org.eclipse.core.internal.jobs.WorkerPool)
        at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:205)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:69)

"org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon prio=2 tid=0x2f93f000 nid=0x8fc in Object.wait() [0x31d9f000..0x31d9fd14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:176)
        - locked <0x04db0168> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)

"org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon prio=2 tid=0x2f8e3400 nid=0xda4 in Object.wait() [0x3153f000..0x3153fb94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:176)
        - locked <0x084d0708> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)

"Worker-11" daemon prio=6 tid=0x2f48b400 nid=0xf30 in Object.wait() [0x2f24f000..0x2f24fd14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:173)
        - locked <0x06169d48> (a org.eclipse.core.internal.jobs.WorkerPool)
        at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:205)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:69)

"Thread-8" prio=6 tid=0x2e8e1400 nid=0xf8c runnable [0x31c9f000..0x31c9fb14]
   java.lang.Thread.State: RUNNABLE
        at java.io.FileInputStream.readBytes(Native Method)
        at java.io.FileInputStream.read(FileInputStream.java:199)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
        - locked <0x07b8f228> (a java.io.InputStreamReader)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at java.io.BufferedReader.fill(BufferedReader.java:136)
        at java.io.BufferedReader.read(BufferedReader.java:157)
        - locked <0x07b8f228> (a java.io.InputStreamReader)
        at org.python.pydev.runners.ThreadStreamReader.run(ThreadStreamReader.java:25)

"Thread-7" prio=6 tid=0x2e8ecc00 nid=0xc84 runnable [0x2f29f000..0x2f29fb94]
   java.lang.Thread.State: RUNNABLE
        at java.io.FileInputStream.readBytes(Native Method)
        at java.io.FileInputStream.read(FileInputStream.java:199)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:254)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
        - locked <0x07b95330> (a java.io.BufferedInputStream)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
        - locked <0x07b953a8> (a java.io.InputStreamReader)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at java.io.BufferedReader.fill(BufferedReader.java:136)
        at java.io.BufferedReader.read(BufferedReader.java:157)
        - locked <0x07b953a8> (a java.io.InputStreamReader)
        at org.python.pydev.runners.ThreadStreamReader.run(ThreadStreamReader.java:25)

"org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon prio=2 tid=0x2e7dfc00 nid=0xce8 in Object.wait() [0x2f33f000..0x2f33fa14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:176)
        - locked <0x068078c8> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)

"Java indexing" daemon prio=4 tid=0x2dd8f800 nid=0x63c in Object.wait() [0x2f2ef000..0x2f2efb14]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:484)
        at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:349)
        - locked <0x06513178> (a org.eclipse.jdt.internal.core.search.indexing.IndexManager)
        at java.lang.Thread.run(Thread.java:626)

"Start Level Event Dispatcher" daemon prio=6 tid=0x2cb0e400 nid=0xeac in Object.wait() [0x2ea6f000..0x2ea6fd14]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x055f24b8> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
        at java.lang.Object.wait(Object.java:484)
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent(EventManager.java:349)
        - locked <0x055f24b8> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:287)

"Framework Event Dispatcher" daemon prio=6 tid=0x0088e400 nid=0xb7c in Object.wait() [0x2ea1f000..0x2ea1fd94]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:484)
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent(EventManager.java:349)
        - locked <0x055f3ab8> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:287)

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

"CompilerThread0" daemon prio=10 tid=0x0092f000 nid=0xc1c waiting on condition [0x00000000..0x2caaf8ec]
   java.lang.Thread.State: RUNNABLE

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

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

"Finalizer" daemon prio=8 tid=0x0091f800 nid=0x674 in Object.wait() [0x2c9bf000..0x2c9bfc94]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x051a0480> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x00913400 nid=0xad0 in Object.wait() [0x2c96f000..0x2c96fd14]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:484)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
        - locked <0x051a0090> (a java.lang.ref.Reference$Lock)

"main" prio=6 tid=0x00830400 nid=0x8cc runnable [0x0098f000..0x0098fe5c]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.swt.internal.win32.OS.WaitMessage(Native Method)
        at org.eclipse.swt.widgets.Display.sleep(Display.java:3386)
        at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(WorkbenchAdvisor.java:333)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1700)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:589)
        at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
        at org.eclipse.core.launcher.Main.run(Main.java:973)
        at org.eclipse.core.launcher.Main.main(Main.java:948)

"VM Thread" prio=10 tid=0x00910000 nid=0xedc runnable

"VM Periodic Task Thread" prio=10 tid=0x2cab1c00 nid=0x430 waiting on condition

JNI global references: 752


C:\Programme\Java\jdk1.6.0\bin>
```

Gruß Tom


----------

