我怎样才能获得引用计数为托管对象? [英] How can I get reference count for a managed object?

查看:168
本文介绍了我怎样才能获得引用计数为托管对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET分析器可以显示引用计数管理对象。他们怎么算呢?

.NET profilers can show reference count to managed objects. How do they count them?

推荐答案

他们使用非托管的API可抵达探查。

They use unmanaged APIs which provide access to the profiler.

ICorProfilerCallback 和的 ICorProfilerCallback2 是主要的。这些都是是.NET廓线仪所使用的接口。还有像这个

ICorProfilerCallback and ICorProfilerCallback2 are the main ones. These are the the interfaces that .NET profilers use. There are some more references like this.

您可以使用该方法的类加载(ClassLoadFinished())和卸载(ClassUnloadFinished())来跟踪这些信息。

You can use the methods for class loads (ClassLoadFinished()) and unloads (ClassUnloadFinished()) to track this information.

这篇关于我怎样才能获得引用计数为托管对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆