Memory Leak - ImageDevice.Process

I’m getting increasing memory usage when converting a batch of pdf documents to image formats using similar code to this:

public void Function(stream)
{
Aspose.Pdf.Document document = new Aspose.Pdf.Document(stream);

for (int i = 1; i <= document.Pages.Count; i++)
{
ImageDevice device;
device.Process(document.Pages[i], streamOut);

}

document.Dispose();
}

I close and dispose all streams after use. Memory goes up to 2GB for 100 files. Preliminary analysis leads to the culprit being ImageDevice (which is not disposable).

Aspose.PDF .Net v19.1.0.0/Win 10 64

@babreu

Thank you for contacting support.

Would you please share a few of your sample documents and mention average size of your documents so that we may analyze document contents and try to reproduce this problem. Before sharing requested data, please ensure using Aspose.PDF for .NET 19.9.