We have a windows service that will process through PDF files and convert them to TIFF. During this process we were noticing large memory spikes. After narrowing down the memory usage - it appears that when the SaveAsTIFF method is called, is when the memory spikes.
The spike usually goes to the 1gb to 1.5gb range, before it starts to release and clean memory, but it will not attempt to clean memory before then.
The spike usually goes to the 1gb to 1.5gb range, before it starts to release and clean memory, but it will not attempt to clean memory before then.
To test this, i've sent through a small 10 page pdf, and the memory rises to 700m, but doesn't come back down. If i then run a second 10 page pdf, the memory gets up in to the 1gb range and then starts to clean itself.
Is there any way to avoid this? Below is the code the is causing this problem:
'create PdfConverter object and bind input PDF fileDim pdfConverter As New Aspose.Pdf.Facades.PdfConverter() pdfConverter.Resolution = New Aspose.Pdf.Devices.Resolution(Resolution) pdfConverter.BindPdf(tmpSourceFile) pdfConverter.DoConvert()'create TiffSettings object and set ColorDepthDim tiffSettings As New Aspose.Pdf.Devices.TiffSettings() tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Format1bpp tiffSettings.Compression = Aspose.Pdf.Devices.CompressionType.CCITT4'convert to TIFF image pdfConverter.SaveAsTIFF(tempMultiPageTif, tiffSettings, New WinAPIIndexBitmapConverter()) pdfConverter.Close()