如何分析.NET垃圾收集器?垃圾、收集器、NET

由网友(旧时光的影子爱人)分享简介:我想知道如何分析垃圾收集器的性能和监控三代。我不知道是否有可能知道在任何时间点有什么生活在 gen0,第一代,第二代。当前对象I'd like to know how to profile the performance of the garbage collector and monitor the three g...

我想知道如何分析垃圾收集器的性能和监控三代。我不知道是否有可能知道在任何时间点有什么生活在 gen0,第一代,第二代。当前对象

I'd like to know how to profile the performance of the garbage collector and monitor the three generations. I wonder if it is possible to know at any point in time what are the current objects living in gen0,gen1,gen2.

推荐答案

您可以得到的有用的GC性能从性能监视器信息 - 不是颗粒状,只要你想,虽然

You can get useful information on GC performance from PerfMon - not as granular as you want though.

有许多.NET内存性能   计数器,这是为了给你   在跨$ P $的一些准则pting的   计数器数据以及如何关联   他们。这里假设你有一个基本的   认识GC的。

There are many .NET Memory Performance Counters and this is meant to give you some guidelines in interpreting the counter data and how to correlate them. This assumes you have a basic understanding of GC.

如果您有Visual Studio的premium版本包括一个性能/分析工具,你可以在单个对象的分配和生命周期的详细信息。具体而言,这可能是你希望的领域:

If you have one of the premium versions of Visual Studio that includes Performance/Profiling Tools, you can get more info on individual object allocations and lifetimes. Specifically, this might be in the area you wished:

垃圾回收器回收内存   通过重新分配了整整一代   对象。对于异形物体   创建的应用程序,对象   终身视图显示的号码,   的对象和产生的尺寸   当他们被回收。

The garbage collector reclaims memory by deallocating a whole generation of objects. For objects that the profiled application created, the Object Lifetime view displays the number and size of the objects and the generation when they are reclaimed.

如果你感觉真的冒险,你可以使用分析工具定制分析API 。

If you are feeling really adventurous, you can do custom profiling using the Profiling Tools API.

阅读全文

相关推荐

最新文章