gpt4 book ai didi

c# - C#程序占用了大量的内存

转载 作者:太空宇宙 更新时间:2023-11-03 18:13:15 27 4
gpt4 key购买 nike

Possible Duplicate:
Best .NET memory and performance profiler?




我的C#程序是一个网络抓取工具,它广泛使用了异步HttpWebRequests,Regex和HTML敏捷包。使用ThreadPool.QueueUserWorkItem方法是多线程的。

它开始时使用大约600,000 K的内存,最终攀升至超过1,000,000K。

如何跟踪占用最多的内存并进行清理,以减少资源消耗?

谢谢

最佳答案

使用内存分析器-它们可以帮助分析此类问题,例如:


http://memprofiler.com/(将商业托管PLUS非托管集成到一个探查器中!)
http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/(商业)
CLR Profiler from MS(免费)

关于c# - C#程序占用了大量的内存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10826690/

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