debug时Thread的问题
0:000> !dumpheap -thinlock
------------------------------
Heap 0
Address MT Size
02d07a80 7a7aac2c 28 ThinLock owner 13 (1c5124d0) Recursive 0
02d279d0 02b88b54 116 ThinLock owner 20 (1efc8d60) Recursive 0
02da6a84 02b88b54 116 ThinLock owner 1a (1f12d860) Recursive 0
0305fbd0 02b88b54 116 ThinLock owner 21 (1ef966f8) Recursive 0
032fa954 02b88b54 116 ThinLock owner 8 (1b197178) Recursive 0
total 109719 objects
------------------------------
Heap 1
Address MT Size
06d296a8 02b88b54 116 ThinLock owner 14 (1c55f9e8) Recursive 0
06dbc1d0 02b88b54 116 ThinLock owner 19 (1ef894a8) Recursive 0
06e051c8 02b88b54 116 ThinLock owner 9 (1b1c0c38) Recursive 0
06f1b224 02b88b54 116 ThinLock owner 17 (1ef4b648) Recursive 0
070b2c20 02b88b54 116 ThinLock owner 27 (1f139bd8) Recursive 0
total 125251 objects
------------------------------
Heap 2
Address MT Size
0ad1e438 02b88b54 116 ThinLock owner 11 (1c46b3c0) Recursive 0
0ad2c18c 02b88b54 116 ThinLock owner 7 (1b196db0) Recursive 0
0ae0d304 02b88b54 116 ThinLock owner 1 (001020d8) Recursive 0
0ae63de8 02b88b54 116 ThinLock owner 6 (1b146410) Recursive 0
0af79898 02b88b54 116 ThinLock owner 12 (1c5aedc0) Recursive 0
0b1b3e2c 02b88b54 116 ThinLock owner 29 (1c5a6868) Recursive 0
0b1b7a48 02b88b54 116 ThinLock owner 23 (1efa3360) Recursive 0
0b6c641c 6639ee84 20 ThinLock owner 1f (1effed18) Recursive 0
total 112596 objects
------------------------------
Heap 3
Address MT Size
0ed8e040 02b88b54 116 ThinLock owner 10 (1f1346a8) Recursive 0
0ef1277c 02b88b54 116 ThinLock owner 1f (1effed18) Recursive 0
0f17a5d8 02b88b54 116 ThinLock owner 25 (1f105200) Recursive 0
total 115697 objects
------------------------------
thinlock有不少.主要是三个地方有,分别dump出来:
0:000> !dumpmt 7a7aac2c
EEClass: 7a7c1990
Module: 7a726000
Name: System.Collections.Generic.LinkedList`1[[System.WeakReference, mscorlib]]
mdToken: 0200022e (C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll)
BaseSize: 0x1c
ComponentSize: 0x0
Number of IFaces in IFaceMap: 6
Slots in VTable: 18
0:000> !dumpmt 02b88b54 <---这个出现的次数最多
EEClass: 1b0f9028
Module: 02b88718
Name: ASP.global_asax
mdToken: 02000002 (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\25b56683\aeaa6b96\assembly\dl3\610f7bc9\00a99076_8ca3c801\App_global.asax.DLL)
BaseSize: 0x74
ComponentSize: 0x0
Number of IFaces in IFaceMap: 4
Slots in VTable: 22
0:000> !dumpmt 6639ee84
EEClass: 6639ee14
Module: 6638c000
Name: System.Web.Configuration.MapPathCacheInfo
mdToken: 02000207 (C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll)
BaseSize: 0x14
ComponentSize: 0x0
Number of IFaces in IFaceMap: 0
Slots in VTable: 5
看!threads会有什么东西
0:000> !threads
ThreadCount: 41
UnstartedThread: 0
BackgroundThread: 37
PendingThread: 0
DeadThread: 4
Hosted Runtime: yes
PreEmptive GC Alloc Lock
ID OSID ThreadOBJ State GC Context Domain Count APT Exception
14 1 1558 001020d8 3808220 Enabled 03677a84:03678564 0012ac88 1 MTA (Threadpool Worker)
21 2 1598 000e96d0 b220 Enabled 00000000:00000000 000ff220 0 MTA (Finalizer)
22 3 159c 000d6668 1220 Enabled 00000000:00000000 000ff220 0 Ukn
23 4 15b8 00125720 80a220 Enabled 00000000:00000000 000ff220 0 MTA (Threadpool Completion Port)
11 5 154c 00160008 880a220 Enabled 00000000:00000000 000ff220 0 MTA (Threadpool Completion Port)
13 6 1554 1b146410 180a220 Disabled 07778a30:07778c18 0012ac88 1 MTA (Threadpool Worker)
15 8 1560 1b197178 180a220 Enabled 036753b8:03676564 0012ac88 1 MTA (Threadpool Worker)
26 9 15f4 1b1c0c38 380b220 Enabled 0f6e24f8:0f6e2d94 0012ac88 1 MTA (Threadpool Worker)
27 a 1508 1c3ebca8 200b220 Enabled 00000000:00000000 0012ac88 0 MTA
28 b 1504 1c3e49b0 200b220 Enabled 00000000:00000000 0012ac88 0 MTA
29 d 9a0 1c43c428 a80b220 Enabled 00000000:00000000 0012ac88 0 MTA (Threadpool Completion Port)
31 11 17d8 1c46b3c0 180b220 Enabled 0f700f50:0f702c9c 0012ac88 1 MTA (Threadpool Worker)
33 13 15bc 1c5124d0 200b220 Enabled 00000000:00000000 0012ac88 1 MTA
7 15 14f8 1c551600 220 Enabled 00000000:00000000 000ff220 0 Ukn
34 14 998 1c55f9e8 180b220 Disabled 07794de0:07796c30 0012ac88 1 MTA (Threadpool Worker)
25 e 15d4 1c5954e0 220 Enabled 00000000:00000000 000ff220 0 Ukn
XXXX 16 0 1ef4d998 1801820 Enabled 00000000:00000000 000ff220 0 MTA (Threadpool Worker)
6 18 14f0 1c553ce0 220 Enabled 00000000:00000000 000ff220 0 Ukn
5 1b 3fc 00158328 220 Enabled 00000000:00000000 000ff220 0 Ukn
4 1c 1374 1b1cdc28 220 Enabled 00000000:00000000 000ff220 0 Ukn
30 1d 9c0 1c5071c8 220 Enabled 00000000:00000000 000ff220 0 Ukn
35 1f 1350 1effed18 180b220 Enabled 0b6c66ec:0b6c7e48 0012ac88 2 MTA (Threadpool Worker)
36 12 3bc 1c5aedc0 380b220 Enabled 0b6b3404:0b6b3e30 0012ac88 1 MTA (Threadpool Worker)
37 f 14dc 1f017230 200b220 Enabled 00000000:00000000 0012ac88 0 MTA
39 7 1224 1b196db0 380b220 Enabled 0f6feb44:0f6fec9c 0012ac88 1 MTA (Threadpool Worker)
40 20 1734 1efc8d60 180b220 Disabled 077934b8:07794c30 0012ac88 1 MTA (Threadpool Worker)
41 21 968 1ef966f8 380b220 Enabled 0b6b9e48:0b6b9e48 0012ac88 1 MTA (Threadpool Worker)
XXXX 22 0 00163fa0 1801820 Enabled 00000000:00000000 000ff220 0 MTA (Threadpool Worker)
43 23 12b4 1efa3360 380b220 Enabled 0f6ff578:0f700c9c 0012ac88 1 MTA (Threadpool Worker)
42 24 c58 1f0806b0 220 Enabled 00000000:00000000 000ff220 0 Ukn
XXXX 26 0 1c4bc520 1801820 Enabled 00000000:00000000 000ff220 0 MTA (Threadpool Worker)
44 27 9dc 1f139bd8 380b220 Enabled 0f6f0270:0f6f0c9c 0012ac88 1 MTA (Threadpool Worker)
45 28 13c0 1ef6e900 220 Enabled 00000000:00000000 000ff220 0 Ukn
47 29 1398 1c5a6868 380b220 Enabled 0777ac30:0777ac30 0012ac88 1 MTA (Threadpool Worker)
48 25 14d8 1f105200 380b220 Enabled 0367e69c:03680454 0012ac88 1 MTA (Threadpool Worker)
XXXX 1e 0 1c519258 1801820 Enabled 00000000:00000000 000ff220 0 MTA (Threadpool Worker)
49 1a 930 1f12d860 180b220 Disabled 0777b580:0777cc30 0012ac88 1 MTA (Threadpool Worker)
51 19 1328 1ef894a8 180b220 Disabled 0b6b64f8:0b6b7e30 0012ac88 1 MTA (Threadpool Worker)
52 17 1210 1ef4b648 380b220 Enabled 036576a8:036595ec 0012ac88 1 MTA (Threadpool Worker)
53 10 1518 1f1346a8 380b220 Enabled 03672624:03674564 0012ac88 1 MTA (Threadpool Worker)
55 c 974 1ef61770 180b220 Enabled 0b4bcc8c:0b4bd73c 000ff220 0 MTA (Threadpool Worker)
0:000> !dumpdomain 000ff220
--------------------------------------
Domain 1: 000ff220
LowFrequencyHeap: 000ff244
HighFrequencyHeap: 000ff29c
StubHeap: 000ff2f4
Stage: OPEN
SecurityDescriptor: 000ffaa0
Name: DefaultDomain
Assembly: 000d5ee0 [C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll]
ClassLoader: 000a9518
SecurityDescriptor: 0010be00
Module Name
790c2000 C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll
024b239c C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\sortkey.nlp
024b2010 C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\sorttbls.nlp
024b2768 C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\prcp.nlp
Assembly: 00119470 [C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll]
ClassLoader: 00095828
SecurityDescriptor: 00112c20
Module Name
6638c000 C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll
Assembly: 00118fe8 [C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll]
ClassLoader: 00113898
SecurityDescriptor: 001135a0
Module Name
7a726000 C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll
Assembly: 00140120 [C:\WINDOWS\assembly\GAC_MSIL\mscorlib.resources\2.0.0.0_zh-CHS_b77a5c561934e089\mscorlib.resources.dll]
ClassLoader: 001399c0
SecurityDescriptor: 0013b2d8
Module Name
024b2bb0 C:\WINDOWS\assembly\GAC_MSIL\mscorlib.resources\2.0.0.0_zh-CHS_b77a5c561934e089\mscorlib.resources.dll
Assembly: 0014a4c8 [C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll]
ClassLoader: 00141738
SecurityDescriptor: 0014a0b0
Module Name
648ea000 C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll
Assembly: 00157010 [C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll]
ClassLoader: 00139220
SecurityDescriptor: 00157e40
Module Name
639f8000 C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll
Assembly: 1b163ea0 [C:\WINDOWS\assembly\GAC_MSIL\System.Web.RegularExpressions\2.0.0.0__b03f5f7f11d50a3a\System.Web.RegularExpressions.dll]
ClassLoader: 1b1622d8
SecurityDescriptor: 1b129a78
Module Name
66f18000 C:\WINDOWS\assembly\GAC_MSIL\System.Web.RegularExpressions\2.0.0.0__b03f5f7f11d50a3a\System.Web.RegularExpressions.dll
Assembly: 1c41ca20 [C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll]
ClassLoader: 1c412760
SecurityDescriptor: 1c41d2b8
Module Name
7ae74000 C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll
Assembly: 1c3e8d28 [C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll]
ClassLoader: 1c3d6f70
SecurityDescriptor: 1c451ab0
Module Name
1ce56000 C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll
站的高一点看:
0:000> vertarget
Windows Server 2003 Version 3790 (Service Pack 2) MP (4 procs) Free x86 compatible
Product: Server, suite: Enterprise TerminalServer SingleUserTS
kernel32.dll version: 5.2.3790.4062 (srv03_sp2_gdr.070417-0203)
Debug session time: Wed Jul 2 17:16:40.000 2008 (GMT+8)
System Uptime: 9 days 21:29:47.578
Process Uptime: 0 days 0:09:23.000
Kernel time: 0 days 0:01:42.000
User time: 0 days 0:07:52.000
0:000> !runaway f
User Mode Time
Thread Time
31:17d8 0 days 0:00:29.671
26:15f4 0 days 0:00:28.875
14:1558 0 days 0:00:28.265
15:1560 0 days 0:00:26.296
13:1554 0 days 0:00:25.609
34:998 0 days 0:00:24.390
35:1350 0 days 0:00:17.718
41:968 0 days 0:00:16.078
39:1224 0 days 0:00:15.890
40:1734 0 days 0:00:15.859
......
Kernel Mode Time
Thread Time
14:1558 0 days 0:00:07.265
31:17d8 0 days 0:00:06.953
26:15f4 0 days 0:00:06.859
13:1554 0 days 0:00:06.765
34:998 0 days 0:00:06.000
15:1560 0 days 0:00:05.703
35:1350 0 days 0:00:04.453
39:1224 0 days 0:00:04.125
36:3bc 0 days 0:00:03.828
41:968 0 days 0:00:03.734
.....
Elapsed Time
Thread Time
0:1440 0 days 0:09:22.427
3:14a8 0 days 0:09:22.412
2:1298 0 days 0:09:22.412
1:1324 0 days 0:09:22.412
8:1510 0 days 0:09:22.318
7:14f8 0 days 0:09:22.318
6:14f0 0 days 0:09:22.318
5:3fc 0 days 0:09:22.318
4:1374 0 days 0:09:22.318
10:151c 0 days 0:09:22.287
0:000> !threadpool
CPU utilization 92%
Worker Thread: Total: 20 Running: 19 Idle: 1 MaxLimit: 400 MinLimit: 4
Work Request in Queue: 5
Unknown Function: 6a2aa6fb Context: 020db970 《---为什么是unknown function? --- 2008/08/06添加:因为加载的sos版本不正确
Unknown Function: 6a2aa6fb Context: 020db9b0
Unknown Function: 6a2aa6fb Context: 020e2b38
Unknown Function: 6a2aa6fb Context: 020c3d00
--------------------------------------
Number of Timers: 17
--------------------------------------
Completion Port Thread:Total: 2 Free: 1 MaxFree: 8 CurrentLimit: 1 MaxLimit: 400 MinLimit: 4
这个似乎看不出什么:(.net framework 3.5的程序)
0:000> !syncblk
Index SyncBlock MonitorHeld Recursion Owning Thread Info SyncBlock Owner
-----------------------------
Total 1076
CCW 2
RCW 0
ComClassFactory 0
Free 317
唉...