-
-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apparent memory leak with image resize #707
Comments
|
What happens when you do |
|
Would it be possible to create a super tiny sample project that includes a Dockerfile and demonstrates the issue and publish that on github @shadowndacorner. |
|
Sorry for the very delayed response, we ended up taking a different approach due to deadlines on the project, so this has been somewhat on the backburner for me. After fighting with it for awhile, I couldn't tell for sure if the issue was actually a memory leak in this library or if it was an issue with the .NET garbage collector not handling large allocations well causing memory usage to balloon over time (stuff like this makes me loathe garbage collection...). Regardless, I will set up a minimal git repository that can reproduce the issue soon. Thanks, and I apologize again for the late response! |
|
Ping @shadowndacorner ? |
|
@shadowndacorner Can you share any details on the different approach you took? |
|
Maybe someone will stumble across the same problem as me. I'm using Magick.NET in a ASP.NET Core application inside a linux docker container. An image conversion is triggered by a rabbitmq message. What happened was that the application was using much more memory than it should. After analysing memory and searching for leaks etc. I finally stumbled across this: Setting the environment to either |
|
@kaktuspalme Thanks for sharing that, I was having memory issues using Magick.NET in a ASP.NET Web API inside a docker container. My application was growing slowly until it reaches 1GB and crashes and I couldn't understand why it was happening because I was disposing everything that was disposable. |
Prerequisites
Description
My issue seems similar to this comment in #340, but it doesn't seem to have ever been addressed. It appears that MagickImage.Resize has a memory leak. I have come to this conclusion experimentally rather than via debugging the library manually, but the snipped code below does not leak memory if I comment out the
image.Resize(...)line, whereas it does leak memory otherwise. I have observed this in Docker (based on the image mcr.microsoft.com/dotnet/core/sdk:2.2).Steps to Reproduce
The container's memory balloons if I continuously make requests to the endpoint containing this code. I imagine simply calling this code in a while loop would exhibit the same behavior (I can provide the full controller if necessary, but figured I would limit it for brevity).
System Configuration
The text was updated successfully, but these errors were encountered: