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 - PDfium memory consumption
  FAQ FAQ  Forum Search   Register Register  Login Login

PDfium memory consumption

 Post Reply Post Reply
Author
Message
pdfuserxx View Drop Down
Beginner
Beginner


Joined: 05 Feb 16
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote pdfuserxx Quote  Post ReplyReply Direct Link To This Post Topic: PDfium memory consumption
    Posted: 10 Apr 20 at 9:53AM
I'm using PDFium renderer in my project

  var result = newPdfLibrary.SetPDFiumFileName(libraryFileName);
            if (result == 1)
            {
                int renderId = newPdfLibrary.SelectRenderer(4);
            }

and then RenderPageToString to render pdf document, but this results in huge memory consumption which is never released.

Do I need to call anything else to free the memmory?
DestroyRenderer and ReleaseLibrary have no effect.

regards

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 10 Apr 20 at 2:33PM
Hi,

regarding the instance the library itself offers "free"...
Cheers,
Ingo

Back to Top
pdfuserxx View Drop Down
Beginner
Beginner


Joined: 05 Feb 16
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote pdfuserxx Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 20 at 6:54AM
I'm already calling "ReleaseLibrary" which calls DPLReleaseLibrary and FreeLibrary but the memory is not being released.

regards 
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 20 at 8:03AM
If it's a QuickPDF-issue:

QuickPDF 16 and newer reduced memory consumption down to half.
How big (pages) are your pdf-files?
What's always better for bigger files is using the DA-functionality (but never mix DA- and Non-DA-functions).

Here's a kb-document about how to use an external renderer:
https://www.debenu.com/kb/use-rendering-printing-add-debenu-quick-pdf-library/

I think more that it's a PDFium-issue itself:

Try Google with "PDFium release memory"...
There's a lot.

Cheers,
Ingo

Back to Top
pdfuserxx View Drop Down
Beginner
Beginner


Joined: 05 Feb 16
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote pdfuserxx Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 20 at 9:13AM
The page size is 3x2 inch and the file itself is approx 50 kb, but similar results can be observed with other pdf files. 
Sorry for the question, but what is DA functionality?

May be but, I can only access PDFium functionality thru PDF functions. I'm using PDfium, because there ware same issues with default renderer. 

regards
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 20 at 10:38AM
This small pdf won't be responsible for great memory consumption.
I don't know your dev.language and you don't post the real code but if you've free the library itself the problem can only be the PDFium-handling itself.

About DA-functionality:
You're registered here for more than four years now and don't know the online resources?!

Here for a common start:
http://www.quickpdf.org/

Here to read about the direct access functionality (DA):
https://www.debenu.com/docs/pdf_library_reference/FunctionGroups.php

Here to search about anything regarding QuickPDF:
https://www.debenu.com/docs/pdf_library_reference/Search.php

Here you can choose your developer-guide:
https://www.debenu.com/products/development/debenu-pdf-library/help/developer-guide/


Cheers,
Ingo

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 20 at 10:45AM
In the developer guide you should read the chapter:
Memory and direct access functions

Cheers,
Ingo

Back to Top
pdfuserxx View Drop Down
Beginner
Beginner


Joined: 05 Feb 16
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote pdfuserxx Quote  Post ReplyReply Direct Link To This Post Posted: 17 Apr 20 at 9:59AM
I'm using c#and usng debenu to convert pdf document to png , most of the files consist from single page.
DA functions are not used as the application is working with in memory streams.

The code is fairly simple:

dynamic newPdfLibrary = new DebenuPDFLibraryDLL1711.PDFLibrary(librarypath);  
newPdfLibrary.SetPDFiumFileName(pdfiumdllpath);
newPdfLibrary.SelectRenderer(4)

//load the document from memory stream
pdfLibrary.LoadFromString(ms.ToArray(), string.Empty) 
//select the document 
int documentID = pdfLibrary.SelectedDocument();
//render 
pdfLibrary.RenderPageToString(300, 1, 0);

//cleanup
pdfLibrary.RemoveDocument(documentID);
pdfLibrary.DestroyRenderer();
pdfLibrary.ReleaseLibrary();
pdfLibrary = null;

The problem is in RenderPageToString which calls DPLRenderPageToString where the memory leak occurs.

regards
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 17 Apr 20 at 10:10AM
"...
The problem is in RenderPageToString which calls DPLRenderPageToString where the memory leak occurs.
..."

and the render-function calls PDFium inside.
Again: Try Google regarding memory consumption by PDFium.
You can check it very easily if it's PDFium or the QP-function:
Change your code and kick off PDFium - what's the result now... better?

If you won't succeed with your trys you should ask the publishers of the library via the official support page.

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