IdentifierChangedEventHandler是干什么的?

yeahspyme 2010-03-30 02:24:40
大家好
最近用wmi弄了一个系统运行监控系统,采集进程每1s从20台左右的机器上采集应用软件发布的数据,问题是正常运行3天左右后,系统报OutOfMemory异常退出。通过windbg采集了内存dump并执行!dumpheap -stat,获得以下结果
!dumpheap -stat
MT Count TotalSize Class Name
675835ec 998575 15977200 System.Management.PropertyDataCollection
67582c14 998594 15977504 System.Management.ConnectionOptions+EncryptedData
790fa3e0 379776 21847316 System.String
791036b0 998838 23972112 System.Collections.ArrayList
67583354 998594 27960632 System.Management.ManagementScope
67582c6c 1997171 39943420 System.Management.ManagementPath
67581f08 998597 47932656 System.Management.ManagementNamedValueCollection
67582b6c 998594 55921264 System.Management.ConnectionOptions
790fea70 998845 55935320 System.Collections.Hashtable
67581468 998576 59914560 System.Management.ManagementObject
791242ec 998847 143867280 System.Collections.Hashtable+bucket[]
67581fc4 5991514 191728448 System.Management.IdentifierChangedEventHandler

从这个统计结果看,托管堆里最多的是System.Management.IdentifierChangedEventHandler,数量达到近600万个对象,查MSDN也没有找到这个Event Handler,应该不是公共的。
进一步查看其具体值,得到以下结果
0:000> !do 7e1ed06c
Name: System.Management.IdentifierChangedEventHandler
MethodTable: 67581fc4
EEClass: 6758a084
Size: 32(0x20) bytes
(C:\WINDOWS\assembly\GAC_MSIL\System.Management\2.0.0.0__b03f5f7f11d50a3a\System.Management.dll)
Fields:
MT Field Offset Type VT Attr Value Name
790f9c18 40000f9 4 System.Object 0 instance 7e1ecf10 _target
79109208 40000fa 8 ...ection.MethodBase 0 instance 00000000 _methodBase
790fe160 40000fb c System.IntPtr 1 instance 6751f590 _methodPtr
790fe160 40000fc 10 System.IntPtr 1 instance 0 _methodPtrAux
790f9c18 4000106 14 System.Object 0 instance 00000000 _invocationList
790fe160 4000107 18 System.IntPtr 1 instance 0 _invocationCount

继续查看_target对象
0:000> !do 7e1ecf10
Name: System.Management.ConnectionOptions
MethodTable: 67582b6c
EEClass: 6758ad0c
Size: 56(0x38) bytes
(C:\WINDOWS\assembly\GAC_MSIL\System.Management\2.0.0.0__b03f5f7f11d50a3a\System.Management.dll)
Fields:
MT Field Offset Type VT Attr Value Name
790fed1c 4000138 c System.Int32 1 instance 128 flags
67581f08 4000139 4 ...edValueCollection 0 instance 7e1ecf48 context
7910ca9c 400013a 10 System.TimeSpan 1 instance 7e1ecf20 timeout
67581fc4 400013b 8 ...angedEventHandler 0 instance 7e1ecef0 IdentifierChanged
7910ca9c 4000137 18 System.TimeSpan 1 static 01519dd8 InfiniteTimeout
790fa3e0 4000143 18 System.String 0 instance 00000000 locale
790fa3e0 4000144 1c System.String 0 instance 0144d7a8 username
67582c14 4000145 20 ...ons+EncryptedData 0 instance 7e1ed08c password
790fa3e0 4000146 24 System.String 0 instance 00000000 authority
675826cc 4000147 28 System.Int32 1 instance 3 impersonation
6758262c 4000148 2c System.Int32 1 instance -1 authentication
79104f64 4000149 30 System.Boolean 1 instance 0 enablePrivileges

发现这个EventHandler与ConnectionOptions相关,后者只是提供连接参数的一个对象,不清楚与EventHandler是什么关系,什么时候会调用EventHandler?
...全文
110 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zsuswy 2010-04-14
  • 打赏
  • 举报
回复
路过,接分。

17,741

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧