infl3x
infl3x

Reputation: 1572

ASP.NET MVC5 app memory leak

I have an ASP.NET MVC5 web application that is consuming excessive amounts of memory on our production server (excessive in that it increases over time and doesn't seem to stop until we recycle the application pool at ~8 GB, the max we've let it reach is 30 GB). The application does not perform like this on my dev machine or on our test server.

The production server is Windows Server 2012 R2 running IIS 8.5.9600.

I have written a small test tool which creates 50 concurrent threads and sends 1000 sequential requests each thread. In development the web application's memory stays around 400 MB, as it does in our test environment. On the production server, the memory just increases on and on. It doesn't matter what the endpoint does, I've just got it returning a vanilla .cshtml Razor view.

I've been trying figure out what could be causing the memory leak for some time and tried a few things:

The production server does have 96 GB of RAM, and from my understanding of how IIS uses this, it can get very greedy. But my dev machine has 32 GB and the max application pool size I've seen is around 600 MB and then it gets GC'd and reduces back to around ~400 MB.

What is taking up all the memory? Is this normal behaviour for IIS?

Update: I've created a new VM server on Azure with similar specifications (112 GB RAM) and the memory stops at around 400 MB also. There must be something specific to our production server causing the problem.

Upvotes: 1

Views: 667

Answers (1)

infl3x
infl3x

Reputation: 1572

In our case, it was our hosting provider who had installed some monitoring tool which used the .NET profiling API poorly.

I suggest anyone who is observing similar symptoms in their app to try configuring a new server instance.

Upvotes: 2

Related Questions