.net 内存分析器,可以分析远程机器

发布于 2024-09-14 05:07:11 字数 209 浏览 5 评论 0原文

我拥有 Ants Profiler 4,它非常适合性能/内存分析。

不幸的是,它仅适用于本地计算机,我无法附加到正在运行的进程。 但我有一个内存泄漏,似乎只发生在我们的生产服务器上。用 vb.net 编写的 Windows 控制台应用程序运行良好,内存使用量持续几天,然后突然开始消耗所有可用内存,直到 24 小时内。

有没有办法从正在运行的进程中收集一些数据并进行检查?

I own the Ants Profiler 4 which is great for performance / memory profiling.

Unfortunately it only works on the local machine and I cannot attach to a running process.
But I have a memory leak that only seems to occure on our production server. A windows console app written in vb.net runs fine with constant memory usage for several days and then suddenly starts consuming all the available memory 'til within 24 hours.

Is there a way to collect some data from the running process and inspect it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柠檬色的秋千 2024-09-21 05:07:11

截至撰写本文时,两个大型 .NET 商业分析器 - ANTS 和 dotTrace 仍然不支持内存分配的远程分析。悲伤的脸。

我自己正在研究这个问题,目前正在考虑两种选择。首先是 Microsoft 的 CLR Profiler:

http://clrprofiler.codeplex.com/

虽然它不支持远程分析,它确实有完整源代码。我认为向其中添加一些命令行选项并让您告诉它附加到进程、获取内存快照并发送到磁盘、然后分离并不需要太多工作。使用Powershell在实时服务器上远程执行它,然后我可以在桌面上闲暇时分析快照。

我正在考虑的另一个选择是从实时应用程序中获取小型转储并使用 sos 运行正在使用的内存的报告。请注意,遗憾的是,由于 此错误,必须执行完全冻结转储。

不管怎样,这都是不平凡的工作,我才刚刚开始,但我还没有找到更好的解决方案。

The two big .NET commercial profilers - ANTS and dotTrace - as of this writing still do not support remote profiling of memory allocations. Sad face.

I'm researching this issue myself, and am currently looking at two options. First is Microsoft's CLR Profiler:

http://clrprofiler.codeplex.com/

While this does not support remote profiling, it does have full source. I don't think it would be too much work to add some command line options to it that let you tell it to attach to a process, grab a memory snapshot and send to disk, then detach. Use Powershell to remote execute it on the live server, and then I can analyze the snapshot at my leisure on my desktop.

The other option I'm considering is grabbing a minidump off the live app and using sos to run reports of the memory being used. Note that the minidump unfortunately cannot be done with procdump -r due to this bug, must do a full frozen dump.

Nontrivial work either way and I'm just getting started, but I have yet to find a better solution.

小红帽 2024-09-21 05:07:11

升级到最新版本(6.0)。它支持附加到进程,我想这就是您所追求的!

Upgrade to the latest version (6.0). That has support for Attach to Process, which is, I think, what you're after!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文