Intellitrace 是否可用于调查生产环境中不需要的 memory/cpu 使用问题

Is Intellitrace useful for investigation undesired memory/cpu usage issues in production envrionment

我听到很多关于调查 cpu 和内存问题的新功能,使用 Visual Studio 2015 和 Intellitrace 中的新诊断工具。假设我需要解决生产环境中的高内存或 cpu 问题。我知道我可以从生产环境中收集 iTrace 文件,但它对确定高 memory/cpu 的原因是否有用?到目前为止,我看到的 Intellitrace 的所有用例都与异常等不良行为有关,但我希望看到有关使用 intellitrace 进行生产 memory/cpu 问题的任何教程。

确实可以在生产环境中使用Standalone Collector记录IntelliTrace日志。但是,这些日志不会包含任何有关 CPU/memory 使用情况的信息(实际上 iTrace 文件仅包含有关方法调用的信息)。

意思是如果你在Visual Studio打开生产环境记录的iTrace文件你只会看到记录的诊断事件列表和调用树(如果IntelliTrace 被配置为收集调用信息)。 诊断工具 window 将不可用。如果您尝试打开它,则会报告以下错误消息:

诊断工具window不支持当前的调试配置。

如果您想使用 Visual Studio 2015 诊断工具 来分析 CPU/Memory 在生产中的使用情况,您可能会对 Using the Profiling Tools from Command-line 感兴趣。不过这个方法我没试过,不知道方便不。第二个问题可能是许可。我不确定是否可以在不安装 VS 的情况下使用这些命令行工具。

我建议建立 remote debugging for a target machine with production environment. You do not need to install Visual Studio on target but you'll need to install Remote Tools. While debugging you can use CPU Usage and Memory Usage 工具。

除了 I'd add that: 1) Using the Profiling Tools from Command-line refers to command line interface for Performance Wizard tool in Performance and Diagnostics Hub and CPU Usage and Memory Usage tools do not have command line interface for now; 2) you do not need 安装 Visual Studio IDE 从命令行使用分析工具。

您可以在应用程序中构建一个诊断线程来监视异常行为,并在不停止操作的情况下进行有限的转储。

可以在可疑代码中创建不执行任何操作的虚拟方法 运行 并为其提供一些字符串或整数参数。这些将被捕获到 IntelliTrace 中,因此您可以在 intellitrace 日志中跟踪性能、cpu 等值等。