Closed TobiasWolters closed 5 months ago
There is no pixel cache used when you Ping
the image for most of the formats. The memory on the Native side is cleaned up with native code that calls free and returns memory to the operating system. Memory allocated on the .NET side is not immediately returned to the operating system by the garbage collector so I suspect you are seeing that? And are you properly disposing the imageStream
?
Magick.NET version
Magick.NET-Q16-HDRI-AnyCPU, Version 13.6.0
Environment (Operating system, version and so on)
Windows 11 Business, 23H2, 22631.3593
Description
We are using Magick.NET to retrieve information about an image.
In particular, we are doing something along the lines of:
We initialize Magick.NET in the following way:
For large images, the entire pixel cache in RAM is used - i.e. all 512 MiB, allowed by the
map
parameter above.However, the RAM allocated for the pixel cache never seems to be freed again, although the
MagickImageCollection
is disposed.Is it possible to somehow ensure that the allocated RAM for the pixel cache is freed again?
Steps to Reproduce
Use the setup from the description, providing a large image file via the
imageStream
parameter.