简体   繁体   English

ASP.NET内存问题

[英]ASP.NET memory problem

I have an ASP.NET application that communicates with another API and processes a lot on Page_Load. 我有一个ASP.NET应用程序,它与另一个API通信并在Page_Load上进行大量处理。

If in my browser I hold F5 and hit the site, the server shoots from 120mb to 1.5GB. 如果在我的浏览器中我按住F5并点击该网站,服务器将从120mb射到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! 感谢您的时间!

Use a profiler like ANTS Profiler or dotTrace . 使用像ANTS ProfilerdotTrace这样的探查器

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 . 对于它的价值,1.5 GB并不 Does it eventually give an OutOfMemoryException if you keep the button pressed? 如果按下按钮,它最终是否会产生OutOfMemoryException

I would suggest looking into ANTS Memory Profiler and/or ANTS Performance Profiler from Red Gate. 我建议从Red Gate查看ANTS Memory Profiler和/或ANTS Performance Profiler。 They're very affordable, and they do a great job of identifying bottlenecks. 他们非常实惠,他们在识别瓶颈方面做得很好。

ANTS Memory Profiler: ANTS Memory Profiler:
http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/ http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/

ANTS Performance Profiler: ANTS Performance Profiler:
http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/ http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/

+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. 但在短期内,它可能更便宜,更容易移动到体面的64位盒/ 64位版本的Windows并使用64位ASP.Net - 你将获得更多的内存可用于IIS进程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM