I have an ASP.NET Core application running behind IIS in production that is not freeing memory on its own until the application pool recycles itself. Every request causes the memory to increase.
I am able to reproduce this with a fresh ASP.NET core application using Visual Studio 2017 with the ASP.NET Core Web API template. I created the following method and called it from postman about 100 times:
namespace WebApplication3.Controllers { [Route("")] public class ValuesController : Controller { [HttpGet] public IEnumerable<string> Get() { var message = "test"; return Enumerable.Repeat(message, 100000); } } }
I did a publish build and launched the application from the command line.
The memory usage goes up and is never released:
Here is my dotnet version
PS C:\Windows\system32> dotnet --version
1.0.0
I expect the memory to go down after the requests are done being served. Does anybody have any idea what is going on?