简体   繁体   English

C#中的细粒度内存分析

[英]Fine-grained memory profiling in C#

I'm building a small simulation/profiling tool for an application that I'll be working on over the next year. 我正在为明年将要使用的应用程序构建一个小型的仿真/性能分析工具。 The profiling tool is to be used in my build server such that it can generate some metrics of my application's performance as the development progresses. 概要分析工具将在我的构建服务器中使用,以便随着开发的进行它可以生成我的应用程序性能的一些指标。

I have previous experience with memory profilers, but to my knowledge the existing products does not suit my needs, where: 我以前有内存分析器的经验,但是据我所知,现有产品不适合我的需求,其中:

  • I can profile the memory allocation of individual methods and data structures 我可以分析各个方法和数据结构的内存分配
  • I can invoke the profiler as part of my build process, that is: 我可以在构建过程中调用探查器,即:
    • Either by command-line or directly programmable with in .NET. 通过命令行或直接在.NET中进行编程。

How can I achieve this? 我该如何实现? Ideally I would have something like the Process class although more fine-grained. 理想情况下,我将拥有类似于Process类的东西,尽管粒度更细。

After toying around with Redgate's Profiler API and looking at the CLR Profiler source code, I came to the conclusion that perhaps the easiest solution would be to simply do some UI automation. 在使用Redgate的Profiler API并查看CLR Profiler源代码之后,我得出的结论是,最简单的解决方案可能就是简单地进行一些UI自动化。

Using AutoHotKey I can start CLRProfiler on my app, find the correct allocations and dump the stats I need in text files. 使用AutoHotKey,我可以在应用程序上启动CLRProfiler,找到正确的分配并将所需的统计信息转储到文本文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#细粒度权限:多个内部系统,Intranet方案 - C# fine-grained permissions: multiple internal systems, intranet scenario “内部”成员的细粒度可见性 - Fine-grained visibility for 'internal' members 对横向扩展应用细粒度控制 - applying fine-grained control over scale out 细粒度的权限; PrincipalPermission-角色与权限分开; - fine-grained permissions; PrincipalPermission - roles seperate from permissions; 在asp.net成员中实现细粒度的运行时权限? - Implementing fine-grained runtime permissions in asp.net Membership? 实现IQueryable时对延迟执行的细粒度控制<T> - Fine-grained control of deferred execution when implementing IQueryable<T> 最佳实践缓存:单片与细粒度缓存数据 - Best-practice caching: monolithic vs. fine-grained cache data 使用COM对C#应用程序进行内存分析 - Memory profiling of C# application with COM 在C#应用中运行时分析所有变量的内存使用情况 - Profiling memory usage of all variables during runtime in C# app c #windows app - 分析峰值内存使用情况并识别趋势 - c# windows app - profiling peak memory usage and identifying trends
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM