<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-03-19 18:18 GMT+01:00 Marco <span dir="ltr"><<a href="mailto:ctxspi@gmail.com" target="_blank">ctxspi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><pre>On 2014-03-19 07:20, Marco wrote:
><i> I have check any memory leak with valgrind and original pdftotext
</i>><i> (poppler-0.24.5) because using its code in my program that converts a
</i>><i> sequence of pdf files in text format, Ive seen that takes too much
</i>><i> system memory.
</i>><i>
</i>><i> For test I have used a pdf file (it had inside only ONE WORD) with
</i>><i> command valgrind -v --tool=memcheck --leak-check=full
</i>><i> --show-reachable=yes --track-origins=yes ./pdftotext -bbox
</i>><i> /tmp/file.pdf - 2>/tmp/valgrind.log >> /tmp/valgrind.log and in 
</i>><i> return
</i>><i> briefly this result:
</i>><i>
</i>><i> ==11606== LEAK SUMMARY:
</i>><i> ==11606==    definitely lost: 24 bytes in 1 blocks
</i>><i> ==11606==    indirectly lost: 0 bytes in 0 blocks
</i>><i> ==11606==      possibly lost: 0 bytes in 0 blocks
</i>><i> ==11606==    still reachable: 22,311 bytes in 740 blocks
</i>><i>  ==11606==         suppressed: 0 bytes in 0 blocks
</i>><i> ==11606==
</i>><i> ==11606== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from
</i>><i> 0)
</i>><i> --
</i>><i> ==11607== LEAK SUMMARY:
</i>><i> ==11607==    definitely lost: 34 bytes in 1 blocks
</i>><i>  ==11607==    indirectly lost: 0 bytes in 0 blocks
</i>><i> ==11607==      possibly lost: 0 bytes in 0 blocks
</i>><i> ==11607==    still reachable: 21,247 bytes in 694 blocks
</i>><i> ==11607==         suppressed: 0 bytes in 0 blocks
</i>><i> ==11607==
</i>><i>  ==11607== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 
</i>><i> from
</i>><i> 0)
</i>><i> --
</i>><i> ==11609== LEAK SUMMARY:
</i>><i> ==11609==    definitely lost: 14 bytes in 1 blocks
</i>><i> ==11609==    indirectly lost: 0 bytes in 0 blocks
</i>><i> ==11609==      possibly lost: 0 bytes in 0 blocks
</i>><i>  ==11609==    still reachable: 46,029 bytes in 2,147 blocks
</i>><i> ==11609==         suppressed: 0 bytes in 0 blocks
</i>><i> ==11609==
</i>><i> ==11609== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from
</i>><i> 0)
</i>><i> --
</i>><i>
</i>><i> Im not expert programmer but in this case log of valgrind like this:
</i>><i>
</i>><i> ==11606== 1,600 bytes in 1 blocks are still reachable in loss record
</i>><i> 523 of 524
</i>><i>  ==11606==    at 0x4007D89: malloc (vg_replace_malloc.c:236)
</i>><i> ==11606==    by 0x80AE501: xmalloc (in /bin/bash)
</i>><i> ==11606==    by 0x524F4C4E: ???
</i>><i> ==11606==
</i>><i> ==11606== 3,163 bytes in 51 blocks are still reachable in loss record
</i>><i> 524 of 524
</i>><i>  ==11606==    at 0x4007D89: malloc (vg_replace_malloc.c:236)
</i>><i> ==11606==    by 0x80AE501: xmalloc (in /bin/bash)
</i>><i> ==11606==    by 0x807925A: ??? (in /bin/bash)
</i>><i> ==11606==    by 0x807C12C: maybe_make_export_env (in /bin/bash)
</i>><i>  ==11606==    by 0x808D2C4: command_substitute (in /bin/bash)
</i>><i> ==11606==    by 0x80931B9: ??? (in /bin/bash)
</i>><i> ==11606==    by 0x809431C: ??? (in /bin/bash)
</i>><i> ==11606==    by 0x80946C8: expand_word_unsplit (in /bin/bash)
</i>><i>  ==11606==    by 0x8077B6C: ??? (in /bin/bash)
</i>><i> ==11606==    by 0x80741D4: execute_command_internal (in /bin/bash)
</i>><i> ==11606==    by 0x8077A21: execute_command (in /bin/bash)
</i>><i> ==11606==    by 0x8077FA4: ??? (in /bin/bash)
</i>><i>
</i>><i> are incomprehensible for me and despite all my goodwill Im not able 
</i>><i> to
</i>><i> understand where to find code that cause memory leak.
</i>><i>
</i>><i> Unfortunately, the excessive use of memory does not allow to utilize
</i>><i> code for the intensive uses.
</i>
Are you sure you are testing the right executable?  That looks like you 
are running valgrind on bash.  Make sure pdftotext isn't a shell script.</pre></div></blockquote><div><div>Hi Jason<br><br></div>I have compiled last software version in temporary executable directory and running into utils dir. <br>
<br> </div></div>
</div></div>