ASP.NET Website Memory Usage quite high

前端 未结 7 1279
灰色年华
灰色年华 2020-12-14 18:54

I have an ASP.NET website that will hit about 2gb physical memory used within about 3-4 days, which to me sounds really bad. At the moment, I have configured IIS to restart

7条回答
  •  悲哀的现实
    2020-12-14 19:32

    Memory leaks in .NET are still possible. It is true that for the most part you don't need to free objects (there are a few exceptions such as the Graphics object) but if you keep references to them, they will not get garbage collected, because they are still referenced.

    If the GC sees that an object is being referenced somewhere, anywhere in your app, it will not trash it.

    Check out this Code Project article on .NET memory leaks and how to go about locating and fixing them.

提交回复
热议问题