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!
![]() |
PDfium memory consumption |
Post Reply ![]() |
Author | |
pdfuserxx ![]() Beginner ![]() Joined: 05 Feb 16 Status: Offline Points: 18 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3530 |
![]() ![]() ![]() ![]() ![]() |
Hi,
regarding the instance the library itself offers "free"... |
|
Cheers,
Ingo |
|
![]() |
|
pdfuserxx ![]() Beginner ![]() Joined: 05 Feb 16 Status: Offline Points: 18 |
![]() ![]() ![]() ![]() ![]() |
I'm already calling "ReleaseLibrary" which calls DPLReleaseLibrary and FreeLibrary but the memory is not being released.
regards
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3530 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
pdfuserxx ![]() Beginner ![]() Joined: 05 Feb 16 Status: Offline Points: 18 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3530 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3530 |
![]() ![]() ![]() ![]() ![]() |
In the developer guide you should read the chapter:
Memory and direct access functions |
|
Cheers,
Ingo |
|
![]() |
|
pdfuserxx ![]() Beginner ![]() Joined: 05 Feb 16 Status: Offline Points: 18 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3530 |
![]() ![]() ![]() ![]() ![]() |
"...
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 |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store