gpt4 book ai didi

.net - 我如何使用 !gcroot

转载 作者:行者123 更新时间:2023-12-03 22:16:34 24 4
gpt4 key购买 nike

在加载了 SOS 调试扩展的 Visual Studio 即时窗口中,我可以做到

!dumpheap -stat

然后我得到这样的东西:
    total 108,014 objects
Statistics:
MT Count TotalSize Class Name
...
0x00be209c 135 714108 System.Object[]
0x79b925c8 218 2659728 System.String
0x00be2c3c 78986 10,705,064 System.Byte[]
Total 208,014 objects, Total size: 36,259,364

我现在如何在一些 System.Byte[] 实例上调用 !gcroot ?我首先必须找到他们的地址。但是使用 !dumpheap -type System.Byte[] 肯定是一个坏主意,因为这会给我一个无穷无尽的列表,而且由于直接窗口似乎很慢,所以列出它们需要 20 多分钟 - 在那段时间里,visual studio 不是可用。有什么 secret 技巧可以在某些字节数组上调用 !gcroot 吗?

最佳答案

您可以使用 -min -max 开关过滤掉噪音,我猜您的问题出在大对象上,所以请调用 !dumpheap -min -type System.Byte[] 其中足够大以过滤掉噪音。

关于.net - 我如何使用 !gcroot,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1461491/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com