dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.87k stars 4.88k forks source link

Freeing up memory from ArrayPools #1409

Closed okarlsson closed 6 years ago

okarlsson commented 6 years ago

Hey Guys!

I'm running a .NET Core application in a docker container that runs in a EC2 instance on AWS.

I have a function for resizing profile images before they get uploaded and I'm using a third party library called ImageSharp for this. The library uses ArrayPools when handling the images and my memory usage shoots up to about 1GB after handling a image.

But after the request has completed the memory usage never goes back, but is allocated to these memory pools.

image

Since I only have 1GB memory in my EC2 instance the entire instance crashes if I try to for example deploy a new version of my app when there is only 70MB memory available.

Is there any way to free up the memory allocated to the ArrayPools after I have finished a request so my containers don't run out of memory?

Petermarcu commented 6 years ago

Issue moved to dotnet/coreclr #17434 via ZenHub