How to find causes of memory consumption of SQL Server IIS

Wednesday:

  • Windows Server 2012 r2
  • SQL Server 2014
  • ASP.NET MVC 5
  • Entity Framework code-first

I am deploying an ASP.NET MVC 5 application to a server.

SQL Server memory usage is growing rapidly in Task Manager over 5 gigabytes in one hour and the website is down.

SQL Server memory consumption grows at a constant rate, but it never decreases.

How can I find the reason why this memory is being consumed in SQL Server?

I can afford any commercial solution. I just need to find this memory leak.

I only used tracing from telerik, but I didn't find anything strange, it looks like all dbcontext connections are located.

but I've only seen so much memory consumption in sql server when no dbcontext connections are located.

what should I do?

how to find this memory leak?

+3


source to share


3 answers


I highly doubt this is a memory leak - you have defined max. memory size for SQL Server?

enter image description here

If not, this is normal behavior.



Unless otherwise noted, SQL Server will consume more and more memory to store the database pages used to respond to queries in memory (instead of getting them from disk over and over again).

He will use all the memory he can get, or as much as you say to make the most of him. It never releases memory - how would SQL Server know that a given database page will not be used in the very next incoming request? It just keeps the pages in memory for as long as it can - until it runs out of (physical or configured) memory.

+3


source


Common sense and - documentation.

SQL Server will use all the memory as the cache it is allowed to (there is a limit to its limit) as it assumes it can reuse data. It's how fast. Drives, even SSDs, are much slower than RAM and therefore any cache hit helps LOT.



If you really insist on running sql server on something that is kept to a minimum, I suggest you set a realistic limit for memory usage.

+1


source


Due to the above entry, Max Memory 68-GB is recommended for 72-GB according to this article. Suggested Maximum Memory Options for SQL Server 2005/2008

0


source







All Articles