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, Chris - Tracker Supp, Sean - Tracker, 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
mmasood
User
Posts: 101
Joined: Fri Sep 18, 2015 9:49 pm

Out of Memory Errors

Post 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?

Regards,
M
Attachments
WORKS Watermark crash 125.pdf
(2.17 MiB) Downloaded 147 times
WORKS 201 page-out of memory.pdf
(331.6 KiB) Downloaded 162 times
FAILS Watermark crash 135.pdf
(2.2 MiB) Downloaded 152 times
FAILS 210 page-out of memory.pdf
(346.29 KiB) Downloaded 166 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Out of Memory Errors

Post 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.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply