We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Excessive Memory Usage

I am converting a 3MB file and right after I run the process method, the memory of my app jumps to over 1GB when I either put it to a stream or write it to a file. I have a requirement that I will need to convert 100MB files so I’m concerned of the scale of this.

My code is below

Aspose.Pdf.Document doc = new Aspose.Pdf.Document("C:\test.pdf");
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.CCITT4;
tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Default;
tiffSettings.Shape = ShapeType.Portait;
tiffSettings.SkipBlankPages = false;
TiffDevice tiffDevice = new TiffDevice(new Resolution(200), tiffSettings);
tiffDevice.Process(doc, "C:\test.tif");

Thank you

Hi Scott,


Thanks for using our products and sorry for the delayed response.

I have tested the scenario using Aspose.Pdf for .NET 8.0.0 over Windows 7 (X64) and I have used PDF document of 15MB and I did not notice any significant change in memory utilization. The problem seems to be related to the source PDF file which you are using. Can you please share the source file so that we can test the scenario at our end. We are sorry for this inconvenience.

I apologize, it does not appear to happen if I have a normal PDF. However, I have a method that looks for two like PDFs (based on file name) and then combined those using the AddPages method. I then pass this combined pdf to the TIF conversion method above, and that is when the memory jumps sky high to over 1GB. Unfortunately, I cannot give the actual PDF's I am using, as they contain sensitive information, but they are only 6 pages and 29 pages and are each less than 3MB a piece.

Here is my code for the combining of the PDFs

Aspose.Pdf.Document combinedPDF = new Aspose.Pdf.Document("Path1.pdf");
Aspose.Pdf.Document nextPDF = new Aspose.Pdf.Document("Path2.pdf");
combinedPDF.Pages.Add(nextPDF.Pages);
 

I then pass combinedPDF to another method to convert it to TIF with the code above. Is there a better way I should be doing this?

I should also add that I also put the combined PDF to disk, instead of keeping it in memory, and tried to convert it from there and the memory still skyrocketed.

Hi Scott,


Thanks for your feedback. We’ve tested the scenario at our end but I’m afraid I’m unable to find the memory usage issue. Could you please share some sample PDF documents here to replicate the issue? So we investigate it further and provide your more information accordingly.

Moreover, I’ve marked this thread as private so now only you and Aspose staff has access to this thread and its safe to attach documents here.

Sorry for the inconvenience faced.

Best Regards,