我的 .Net 3.5 应用程序在运行时,Windows 任务管理器显示我的应用程序有16个线程。我为该进程收集了一个内存转储,并使用 WinDbg/SOS 打开了它。
运行 !threads 命令会显示我有:
ThreadCount: 456
UnstartedThread: 0
BackgroundThread: 6
PendingThread: 0
DeadThread: 449
Hosted Runtime: no
以下是 !threads 命令的前几行输出:
ID OSID ThreadOBJ State GC Context Domain Count APT Exception 0 1 2848 004366a8 6020 Enabled 11738178:11738778 0042a9f0 0 STA 2 2 1820 004430e0 b220 Enabled 00000000:00000000 0042a9f0 0 MTA (Finalizer) 7 5 2c38 055d6330 80a220 Enabled 00000000:00000000 0042a9f0 0 MTA (Threadpool Completion Port) 8 4 e18 04116900 180b220 Enabled 1157cdc8:1157e778 0042a9f0 0 MTA (Threadpool Worker) XXXX 6 0 055f94b0 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX 7 0 05649228 9820 Enabled 00000000:00000000 0042a9f0 0 MTA XXXX 8 0 0567d4f8 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX 9 0 05688d68 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX a 0 056fd680 9820 Enabled 00000000:00000000 0042a9f0 0 MTA XXXX b 0 0575d7f0 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX c 0 056fd250 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX d 0 0572a780 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX e 0 0f082668 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX f 0 0f082a38 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX 10 0 0570ca68 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX 11 0 0570ce50 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn 10 12 3fb0 0570d238 180b220 Enabled 00000000:00000000 0042a9f0 0 MTA (Threadpool Worker) XXXX 13 0 0570d620 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX 14 0 0570da08 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX 15 0 0570ddf0 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX 16 0 0570e1d8 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX 17 0 0570e5c0 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX 18 0 0579e540 9820 Enabled 00000000:00000000 0042a9f0 0 Ukn XXXX 19 0 0579e928 9820 Enabled 00000000:00000000 0042a9f0