Page 1 of 1

Out of Memory Errors

Posted: Tue Jun 20, 2017 4:27 pm
by mmasood
Hi Alex,

I have created a small stamping utility that performs three operations one after another:

1. Adds Watermarks to the pdf file
2. Adds Margins to the pdf file
3. Adds Banners on 6 locations in the pdf file

This works perfectly fine with smaller files depending on the content and pages. Like a simple file with text only I can process upto 200 pages where as a file that contains images as well the threshold is about 130 pages. If I go over that threshold, i get two types of errors:

1. I get an out of memory exception from my application after a minute into the operation
2. The application just sits without using any CPU at all and does not do anything at all

I am using Core Api version 6.0.319.0 and VB6.
I am currently saving and reloading the pdf file after each step mentioned above.
If I do not save and reload, the threshold is increased but I still get the error for larger files.
I am attaching 4 files, 2 that work and 2 that don't.
The files that fail are not large at all memory wise (2 - 2.5 MBs).

My questions are:

Q1. What should I do to make sure that I do not get out of memory exceptions?
Q2. Is there a cleanup method that I can call that can help?


Re: Out of Memory Errors

Posted: Wed Jun 21, 2017 9:17 am
by Sasha - Tracker Dev Team
Hello mmasood,

Please make sure that you are Closing all of the documents and other objects after their usage. If it won't help, please provide a sample project that we can debug and hopefully find a solution to your problem.