在混合托管/非托管流程中转储 CCW 和 RCW

发布于 2024-07-05 20:26:21 字数 197 浏览 6 评论 0原文

我有一个混合托管/非托管环境(Visual Studio 和 ReSharper),我怀疑 CCW 或 RCW 泄漏。 有没有办法转储所有当前分配的包装器并识别它们的源/目标? 我有 WinDbg、SOS 和 SOSEx,因此我可以使用 !syncblk 命令查看 RCW 和 CCW 的总数。 我只想查看对象,因此我可以对它们调用 !gcroot 并以其他方式检查嫌疑人。

I have a mixed managed/unmanaged environment (Visual Studio and ReSharper) and I suspect CCW or RCW leak. Is there any way to dump all currently allocated wrappers and identify their source/target? I have WinDbg, SOS & SOSEx, so I can see total number of RCWs and CCWs with !syncblk command. I just want to see objects, so I can call !gcroot on them and otherwise examine suspects.

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

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

发布评论

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

评论(1

幸福丶如此 2024-07-12 20:26:21

您应该能够使用 !dumpheap 来执行此操作。 !dumpheap -stat 会让你找到类型名称(如果你还不知道它们),然后 !dumpheap -type {typename} 会给你单独的对象可以传递给 !gcroot 的地址。

You should be able to use !dumpheap to do this. !dumpheap -stat would let you find the type names (if you don't already know them) and then !dumpheap -type {typename} would give you the individual object addresses which can be passed to !gcroot.

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