### Prerequisites - [X] I have written a descriptive issue title - [X] I have verified that I am running the latest version of ImageSharp - [X] I have verified if the problem exist in both `DEBUG` and `RELEASE` mode - [X] I have searched [open](https://github.com/SixLabors/ImageSharp/issues) and [closed](https://github.com/SixLabors/ImageSharp/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported ### ImageSharp version 2.1.1 ### Other ImageSharp packages and versions None ### Environment (Operating system, version and so on) Window 11 Pro, Version 10.0.22000 Build 22000 ### .NET Framework version net6.0 ### Description When doing a simple image resize the TotalUndisposedAllocationCount increases per image resized. ### Steps to Reproduce ``` using SixLabors.ImageSharp; using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Diagnostics; var photos = Directory.EnumerateFiles(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "*.png", SearchOption.AllDirectories).Take(5); foreach (var photo in photos) { Console.WriteLine($"Number of undisposed ImageSharp buffers: {MemoryDiagnostics.TotalUndisposedAllocationCount}"); using (var outputStream = new MemoryStream()) using (var imageStream = File.OpenRead(photo)) { var (image, format) = await Image.LoadWithFormatAsync(stream: imageStream); image .Mutate(x => x.Resize(image.Width/2, 0, KnownResamplers.Lanczos3)); await image.SaveAsync(outputStream, format); outputStream.Position = 0; Console.WriteLine($"Number of undisposed ImageSharp buffers: {MemoryDiagnostics.TotalUndisposedAllocationCount}"); } } ``` ### Images 
Activity
JimBobSquarePants commentedon Apr 28, 2022
You're not disposing of the image in your sample code.
outputStream.Position = 0; + image.Dispose();