Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Memory Leak #2343

Open
ghost opened this issue Apr 30, 2015 · 8 comments
Open

Memory Leak #2343

ghost opened this issue Apr 30, 2015 · 8 comments
Labels
Verified The issue is verified.
Milestone

Comments

@ghost
Copy link

ghost commented Apr 30, 2015

Hello,

I am using Wkhtmltopdf which is very nice, thank you. The output is very clear.

However there seems to be a memory leak, I think it may be caused by calls to 'wkhtmltopdf_convert', and for me the amount varies between 20k - 60k.

Are you aware of this ? Do you have any advice to avoid ? I am definitely calling wkhtmltopdf_destroy_converter.

Many thanks,

-Phil

@ashkulz ashkulz added the Verified The issue is verified. label Apr 30, 2015
@ashkulz ashkulz added this to the future milestone Apr 30, 2015
@ashkulz
Copy link
Member

ashkulz commented Apr 30, 2015

There are memory leaks, but it's hard to fix out exactly where they are. They may be present in the Qt/WebKit bindings itself (which should hopefully be fixed with the 0.13 upgrade) or in the custom Qt patches (which I'll review for 0.13). The simplest solution is to use a separate process and periodically restart it if the leaks go very high.

@ghost
Copy link
Author

ghost commented Apr 30, 2015

Hi Ashish, thanks for the response.

Another post from Sept 2014 mentions the deleteLater() method, do you not
think this is the cause ? I didnt see any follow ups to that post ...

Phil

@ashkulz
Copy link
Member

ashkulz commented Apr 30, 2015

Yeah, but those were necessary for avoiding some crashes according to @pruiz. I've not really explored that in detail -- when you build in debug mode, it prints the leaks in WebKit after conversion completes. That might be a good start to identify where the problem is, but never got time to do that 😦

@ghost
Copy link
Author

ghost commented Apr 30, 2015

I understand ... thanks anyway, for now Im going to take your advice and
run out of process.

Cheers !

Phil

@ashkulz
Copy link
Member

ashkulz commented May 17, 2015

Can you try if 9fa4695 improves things? See the commit message for more details.

@ashkulz
Copy link
Member

ashkulz commented Jun 30, 2015

@pienaarp: were you able to try the above commit?

@SAYellow
Copy link

Hi Ashish,

Is this still an open issue? As I am experiencing the same memory leaks with v 12.4.0...

Thank you for a gr8 app ;)

Dirk

@alexander-nesterenko-kas

Built wkhtmltopdf 0.12.2.4 with the flag -debug and executed conversion HTML file into PDF under valgrind-3.11.0.

The command line:

valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=/home/alex/Desktop/sample-html-to-pdf.dbg.log ./wkhtmltopdf -q /home/alex/Desktop/sample.html /home/alex/Desktop/sample2.pdf 

The summary of report:

==26162== LEAK SUMMARY:
==26162==    definitely lost: 8,248 bytes in 124 blocks
==26162==    indirectly lost: 29,112 bytes in 418 blocks
==26162==      possibly lost: 336 bytes in 2 blocks
==26162==    still reachable: 294,108 bytes in 4,759 blocks
==26162==         suppressed: 0 bytes in 0 blocks
==26162== 
==26162== For counts of detected and suppressed errors, rerun with: -v
==26162== ERROR SUMMARY: 131 errors from 131 contexts (suppressed: 0 from 0)

files.zip

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Verified The issue is verified.
Development

No branches or pull requests

3 participants