Out of Memory Errors

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
Posts: 99
Joined: Fri Sep 18, 2015 9:49 pm

Out of Memory Errors

Post by mmasood » Tue Jun 20, 2017 4:27 pm

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?

WORKS Watermark crash 125.pdf
(2.17 MiB) Downloaded 84 times
WORKS 201 page-out of memory.pdf
(331.6 KiB) Downloaded 96 times
FAILS Watermark crash 135.pdf
(2.2 MiB) Downloaded 90 times
FAILS 210 page-out of memory.pdf
(346.29 KiB) Downloaded 100 times

User avatar
Sasha - Tracker Dev Team
Posts: 5119
Joined: Fri Nov 21, 2014 8:27 am

Re: Out of Memory Errors

Post by Sasha - Tracker Dev Team » Wed Jun 21, 2017 9:17 am

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.

Join us at Google+:
Subscribe at:

Post Reply