3

环境是windows2008 X64

当我使用asp.net状态服务保持会话时,我发现aspnet_state.exe的内存增长缓慢,并且从未下降。几天后,进程内存不足。

所以我使用windbg检查转储,并找到以下信息。

!dumpheap -stat

000007feea261c38    22266      1959408 System.Collections.Hashtable
000007feea2601d8    86680      3467200 System.Collections.ArrayList
000007fee833eb60    11628      3813984 System.Web.HttpResponse
000007fee833e380    11628      4000032 System.Web.HttpContext
000007fee833e7c8    11628      4186080 System.Web.HttpRequest
000007feea261eb8    22297      4304928 System.Collections.Hashtable+bucket[]
000007feea25ae78    87792      5103632 System.Object[]
000007feea256970   114737     10454192 System.String
0000000000388220     2774     19328376      Free
000007feea25b328    81563     52155808 System.Char[]

!dumpheap -mt 000007feea25b328 -stat

Statistics:
              MT    Count    TotalSize Class Name
000007feea25b328    81563     52155808 System.Char[]

Total 81563 objects

!dumpheap -mt 000007feea25b328 -max 2200 -stat

Statistics:
              MT    Count    TotalSize Class Name
000007feea25b328    81547     51952128 System.Char[]
Total 81547 objects

!dumpheap -mt 000007feea25b328

0000000090787af8 000007feea25b328     2072     
0000000090788348 000007feea25b328      216     
0000000090788df0 000007feea25b328      536     
0000000090789008 000007feea25b328      536     
0000000090789430 000007feea25b328      536     
0000000090789678 000007feea25b328      536     
0000000090789d28 000007feea25b328       32     
0000000090789db0 000007feea25b328     2072     
000000009078ada8 000007feea25b328      216     
000000009078b1b8 000007feea25b328      536     
000000009078b3d0 000007feea25b328      536     
000000009078b788 000007feea25b328      536     
000000009078b9d0 000007feea25b328      536     
000000009078c080 000007feea25b328       32     
000000009078c108 000007feea25b328     2072     
000000009078c958 000007feea25b328      216     
000000009078d3d8 000007feea25b328      536     
000000009078d5f0 000007feea25b328      536     
000000009078da18 000007feea25b328      536     
000000009078dc60 000007feea25b328      536     
000000009078e310 000007feea25b328       32

分贝 0000000090789db0 L?2072

....

00000000`9078b160  00 00 00 00 00 00 00 00-70 69 25 ea fe 07 00 00  ........pi%.....
00000000`9078b170  03 00 00 00 32 00 30 00-30 00 00 00 00 00 00 00  ....2.0.0.......
00000000`9078b180  00 00 00 00 00 00 00 00-70 69 25 ea fe 07 00 00  ........pi%.....
00000000`9078b190  08 00 00 00 32 00 30 00-30 00 20 00 4f 00 4b 00  ....2.0.0. .O.K.
00000000`9078b1a0  0d 00 0a 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
00000000`9078b1b0  00 00 00 00 00 00 00 00-28 b3 25 ea fe 07 00 00  ........(.%.....
00000000`9078b1c0  00 01 00 00 00 00 00 00-32 00 30 00 30 00 20 00  ........2.0.0. .
00000000`9078b1d0  4f 00 4b 00 0d 00 0a 00-00 00 00 00 00 00 00 00  O.K.............

....

00000000`9078b3d0  28 b3 25 ea fe 07 00 00-00 01 00 00 00 00 00 00  (.%.............
00000000`9078b3e0  58 00 2d 00 41 00 73 00-70 00 4e 00 65 00 74 00  X.-.A.s.p.N.e.t.
00000000`9078b3f0  2d 00 56 00 65 00 72 00-73 00 69 00 6f 00 6e 00  -.V.e.r.s.i.o.n.
00000000`9078b400  3a 00 20 00 34 00 2e 00-30 00 2e 00 33 00 30 00  :. .4...0...3.0.
00000000`9078b410  33 00 31 00 39 00 0d 00-0a 00 43 00 61 00 63 00  3.1.9.....C.a.c.
00000000`9078b420  68 00 65 00 2d 00 43 00-6f 00 6e 00 74 00 72 00  h.e.-.C.o.n.t.r.
00000000`9078b430  6f 00 6c 00 3a 00 20 00-70 00 72 00 69 00 76 00  o.l.:. .p.r.i.v.
00000000`9078b440  61 00 74 00 65 00 0d 00-0a 00 00 00 00 00 00 00  a.t.e...........

所以,事实证明,我的大部分内存都被存储会话 http ok 和锁定响应使用(也得到一些字符串存储“423 锁定”),还有更多

!gcroot 0000000090789db0

Scan Thread 17 OSTHread b9d4
Scan Thread 19 OSTHread b46c
Scan Thread 20 OSTHread 2290
Scan Thread 21 OSTHread e9c
Scan Thread 22 OSTHread 1cf4
Scan Thread 23 OSTHread 12d0
Scan Thread 25 OSTHread 1668
Scan Thread 24 OSTHread 13ec
Scan Thread 26 OSTHread 10f18
Scan Thread 28 OSTHread 1a74
Scan Thread 27 OSTHread 11a0
Scan Thread 29 OSTHread 1cec
Scan Thread 30 OSTHread 6784
Scan Thread 31 OSTHread 77c4
Scan Thread 32 OSTHread 10b08

我找不到对 Char 的任何引用。

我检查了!finalizequeue,只有几个对象可以完成..所以我很困惑..

谢谢。

4

1 回答 1

0

下载asp.net 网络分析器并使用它来查看数据存储的内容和位置。

于 2013-02-06T05:46:43.767 回答