利用CLRProfiler分析.NET程序

CLRProfiler是一个可以用于分析.NET程序行为的工具。可用其分析垃圾回收器堆正在发生的事情,例如什么方法分配了什么类型的对象?另外,还提供了调用图(call graph)功能用于显示哪个方法调用了哪个方法。

CLRProfiler可以跟踪分析.NET程序、Services、ASP.NET页面。

CLRProfiler支持命令行方式调用:

  CLRProfiler [-o logName][-na][-nc][-np][-p exeName [args]]

 

The switches have the following meaning:

  • –o names the output log file.
  • –p names the application to execute.
  • –na tells CLRProfiler not to log allocations.
  • –nc tells CLRProfiler not to log calls
  • –np tells CLRProfiler to start with profiling off (useful when the profiled application turns profiling on for interesting code sections)

CLRProfiler还提供了一个API供程序调用,使用ProfilerOBJ.dll里的函数,可以调用CLRProfiler的很多功能,例如为程序中的某个方法指定跟踪分析,触发堆的快照,输出某些信息到日志文件中去等。

CLRProfiler的缺点是不能附加到已经运行的进程。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值