PDF Reducer Memory Usage

Discussions about machine vision support in GdPicture.
Post Reply
alvvays
Posts: 2
Joined: Fri Oct 13, 2023 9:37 am

PDF Reducer Memory Usage

Post by alvvays » Fri Oct 13, 2023 9:44 am

Hi,

When gdpicturePDFReducer.ProcessDocument() is called, it seems that it uses as much memory as it can. If I have a 600 page PDF with not much images, it uses up to 6gb of RAM. Other PDF's which has lots of images uses even more RAM and the application just crashes. Is there a way to throttle it to avoid using too much RAM? e.g. process the PDF page by page.

It looks like it is trying to load everything into memory and then process it there.

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: PDF Reducer Memory Usage

Post by Hugo » Mon Oct 16, 2023 3:58 pm

Hi there,

Thank you for your feedback here.

For managing memory within GdPicturePDF please ensure you are freeing each document after using this. This can be done via the following method:
https://www.gdpicture.com/guides/gdpict ... ument.html

You also have this method which allows you to clear the cache within your loaded document:
https://www.gdpicture.com/guides/gdpict ... urces.html

And on top of all of this, you can dispose of the GdPicturePDF object being used by using this method:
https://www.gdpicture.com/guides/gdpict ... ose().html

Please try using all 3 of the above.

For singular PDF documents containing a large number of pages, this may tricky as the full document loaded in GdPicturePDF is a requirement.
I'd recommend trying to reduce the size of the PDF using PDFReducer:
https://www.gdpicture.com/guides/gdpict ... ring).html
https://www.gdpicture.com/guides/gdpict ... neral.html

Regards,
Hugo Cudd
Technical Support

alvvays
Posts: 2
Joined: Fri Oct 13, 2023 9:37 am

Re: PDF Reducer Memory Usage

Post by alvvays » Wed Oct 18, 2023 9:29 am

Hi Hugo,

Are you able to give a guide on how we can calculate or estimate the memory that's going to be used by PDFReducer if we're going to compress a single file?

e.g.
A PDF with 10 pages will use 100MB of RAM
or
a 1MB PDF will use 30MB of RAM

This will be useful for planning and checking if a machine can run PDFReducer successfully.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest