ASP.NET内存问题
我有一个 ASP.NET 应用程序,它与另一个 API 通信并在 Page_Load 上处理大量内容。
如果在我的浏览器中按住 F5 并点击该网站,服务器的大小就会从 120mb 增加到 1.5GB。
我找不到任何内存泄漏或未关闭的对象。我可以采取任何方式或额外的事情来提供帮助吗?
谢谢您的宝贵时间!
I have an ASP.NET application that communicates with another API and processes a lot on Page_Load.
If in my browser I hold F5 and hit the site, the server shoots from 120mb to 1.5GB.
I can't find any memory leaks or unclosed objects. Is there any way or extra things I can do to help?
Thank you for your time!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 ANTS Profiler 或 dotTrace。
有很多很多事情可能会导致这种行为 - 尝试用武断的建议解决问题可能不会让我们有任何结果。
一旦探查器确定了问题区域,如果您无法解决该问题,您可以将该代码发布到新问题中。
就其价值而言,1.5 GB 并不是很大。如果您按住按钮,它最终会给出
OutOfMemoryException
吗?Use a profiler like ANTS Profiler or dotTrace.
There are many, many things that could cause that behavior - trying to solve the problem with arbitrary suggestions probably won't get us anywhere.
Once the profiler has identified problem areas, you can post that code in a new question if you aren't able to resolve that problem.
For what it's worth, 1.5 GB isn't huge. Does it eventually give an
OutOfMemoryException
if you keep the button pressed?我建议查看 Red Gate 的 ANTS Memory Profiler 和/或 ANTS Performance Profiler。它们的价格非常实惠,而且在识别瓶颈方面做得很好。
ANTS 内存分析器:
http://www.red-gate.com/products /dotnet-development/ants-memory-profiler/
ANTS 性能分析器:
http://www.red-gate.com/products /dotnet-development/ants-performance-profiler/
I would suggest looking into ANTS Memory Profiler and/or ANTS Performance Profiler from Red Gate. They're very affordable, and they do a great job of identifying bottlenecks.
ANTS Memory Profiler:
http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/
ANTS Performance Profiler:
http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/
+1“分析并找出问题”——如果你想解决问题,就必须了解正在发生的事情。
但在短期内,迁移到像样的 64 位盒子/64 位版本的 Windows 并使用 64 位 ASP.Net 可能会更便宜、更容易 - 您将获得更多可用于 IIS 进程的内存。
+1 to "profile and figure out problems" - knowing what is happening is must if you want to solve the issue.
But in short term it may be cheaper and easier to move to decent 64 bit box/64 bit version of Windows and use 64 bit ASP.Net - you'll get much more memory available to IIS process.