Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - OutOfMemoryError while converting PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

OutOfMemoryError while converting PDF

 Post Reply Post Reply
Author
Message
Seb_Stati View Drop Down
Beginner
Beginner
Avatar

Joined: 23 May 17
Location: France
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Seb_Stati Quote  Post ReplyReply Direct Link To This Post Topic: OutOfMemoryError while converting PDF
    Posted: 11 Oct 17 at 10:54AM
Hello,

I have a big list of PDF files to convert into .jpg files.

But at the end of a certain number of conversions, it doesnt work anymore, and I have only OutOfMemory Errors.

This is how I convert my files : 

PDFLibrary->LoadFromFile(filename.c_str(), L"");
nbPages = PDFLibrary->PageCount();
PDFLibrary->RenderDocumentToFile(300, 1, nbPages, 1, cible.c_str());

Am I missing something ? Any way to clear memory ?

Thanks
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 144
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 11 Oct 17 at 11:31AM
Do you create PDFLibrary at the start of each conversion, and Free it afterwards?  If not, that is an obvious thing to try first, and is the pattern I have always used. There may be no huge 'memory leak' in the library, but what you describe may still result from fragmentation if some of the fields of the library object remain in use throughout.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 2599
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 11 Oct 17 at 1:38PM
Hi Sebastian,

like tfrost said already:
The "Free" is what you need ;-)

Here's a "Hello World" for the first steps:
http://www.quickpdflibrary.com/tutorials/delphi/hello-world.php
After create and unlock you have to insert your loadfromfile and the very last thing should be always a free.

If there are still memory lacks.
You can stop after a bunch of pages...
Keep the actual page number in mind...
Doing the Free...
Start with a new Create/Unlock/LoadFromFile...
Begin again with the same file but the last page number...

Cheers and welcome here,
Ingo

BTW:
The starting point for help is here:
http://www.quickpdf.org/

Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store