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

Free Support Forum - aspose.com

Running out of Memory on optimizeResources

We have a PDF document that iis approx 48MB, 7152 pages. We are trying to run optimizeResources on this document with the following optimizations set:

optimizeOptions.setRemoveUnusedObjects(true);
optimizeOptions.setLinkDuplcateStreams(true);
optimizeOptions.setRemoveUnusedStreams(true);
optimizeOptions.setUnembedFonts(true);
optimizeOptions.setSubsetFonts(true);
optimizeOptions.setAllowReusePageContent(true);

optimizeOptions.getImageCompressionOptions().setCompressImages(false);
optimizeOptions.getImageCompressionOptions().setResizeImages(false);

on a system with 4cpus and 60GB of memory allocated to the application.
When running optimizeResources, with the above options set, we are running out of memory.

This manual has a large number of SVG images embedded.

Is there something we can look at to reduce the memory footprint so that we are not running out?
What is the expected size of memory consumption for a manual this size/

@lodonnell,

Thanks for contacting support.

Can you please share complete source code along with source PDF file to further investigate this issue in details.

AsposePDFConversion.zip (2.7 KB)
processOptimization is called with the PDF in question, flags of optimize set to true and convert to false. We’ve played with various iterations of this trying to track down the issue, which is why all optimization options are on properties file settings. It’s the subsetfonts that is putting us out of memory. The document I noted here, and I have an 800MB PDF (32K pages) that is also doing it.
I’m working on seeing if I can give you the document as well.

@Adnan.Ahmad in order to send you the source PDF I need to check with our customer. They requested you let us know what country or countries this document would go to? where are you located?

@lodonnell,

Sure, we are waiting for your response in this regard.

The source is likely not something that I’ll be able to provide. Can you give me some information regarding memory consumption/footprint when running subsetfonts? What is it doing?

Hello @Adnan.Ahmad I work with @lodonnell and in order to send you the files, I need to know where you are located. This is due to our customer requirements having to conduct a export review. Would you please let me know your location?

@dalia_g_rhule_boeing_com

I’m Support Manager at Aspose and I would be happy to clarify your question.

We have teams in different countries, while as far as your particular concern with respect to Aspose.Pdf, our product team is based in Russia, while the support team is based in Pakistan.

Please note that we only request the files for testing purpose to reproduce the issue. It is not important that the files must be with your actual data. You can replace the actual data with dummy data as long as the issue can be reproduced.

Even if the actual files are shared, which many of our customers do, those are safe with our teams and are secured properly. However, while sharing such a file in the forum, you can mark the thread as private, so that it is only accessible by our teams and yourself. That way, no one else can access that from outside.

You may also refer to Nondisclosure section of our EULA.

I hope this helps regarding your concerns. If you still have any questions, please do let us know. Thanks.

1 Like

Thank you I appreciate the response.