Reputation: 3212
Environment:
I'm deploying an ASP.NET MVC 5 appliation to a server.
SQL Server memory usage is growing rapidly on task manager more than 5 gigs in one hour and website is out of function.
SQL Server memory consumption is growing at a constant rate but it never reduces.
How can I find the reason of this memory consumption in SQL Server?
I can afford any commercial solution. I just need to find this memory leak.
I used just trace from telerik but i didn't find anything strange it seems that all dbcontext connections are disposed.
but I have only seen such sql server high memory consumption when dbcontext connections are not disposed.
what should i do?
how to find this memory leak?
Upvotes: 3
Views: 1136
Reputation: 62101
Common sense and - the documentation.
SQL Server will use up all memory as cache it is allowed to (there is a setting to limit it) because it assumes that it may reuse the data. THis is how it gets fast. Discs, even SSD, are a lot slower than RAM and so any cache hit helps a LOT.
If you really insist on running a sql server on something that lowly specced, then I suggest you set up a realistic limit for memory usage.
Upvotes: 1
Reputation: 754518
I highly doubt that this is a memory leak - have you defined a max. memory size for SQL Server?
If not - this is normal behavior.
Unless told otherwise, SQL Server will take up more and more memory to hold database pages used for answering queries in memory (instead of getting them from disk over and over again).
It will use all the memory it can get - or as much as you tell it to use as a maximum. It never releases memory - how would SQL Server ever know that a given database page isn't going to be used in the very next incoming request? It just keeps pages in memory for as long as it can - until it runs out of (physical or configured) memory.
Upvotes: 3