Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A large memory leak #7

Open
jben94 opened this issue Jul 21, 2016 · 7 comments
Open

A large memory leak #7

jben94 opened this issue Jul 21, 2016 · 7 comments

Comments

@jben94
Copy link

jben94 commented Jul 21, 2016

Hello,

We have a large memory leak issue regarding the "malloc" line 90 of file "packet.cc".
We lost 4MB, 8MB of RAM in 15 minutes of use.

I did not find in your memory the release of this code "malloc".
Will you help us fix this problem?

We found this problem by using the tool Valgrind.

@SpamapS
Copy link
Member

SpamapS commented Aug 21, 2016

Hi jben94! Sounds like it's worthy of some inspection. Can you share with us the exact valgrind command you used, what version of valgrind, and what platform you ran it on? THANKS!

@SpamapS SpamapS added the bug label Aug 21, 2016
@jben94
Copy link
Author

jben94 commented Aug 22, 2016

Hi,
Here are the different versions:

  • Valgrind 3.11.0, command used : valgrind -v --tool=memcheck --leak-check=full --show-leak-kinds=all --log-file=/var/log/valgrind.log
  • Gearmand 1.1.11
  • Mod-gearman 1.5.5
  • Redhat 6.7 (Santiago)

Changes made to bypass the problem are in the file.

diff.gearmand.txt

@p-alik
Copy link
Collaborator

p-alik commented Oct 23, 2016

I did a dry run without patching

  • ubuntu 16.04
  • valgrind-3.11.0
  • gearmand 1.1.13 (+ bccf801)

Except still reachable it looks fine to me. Here entire valgrind.log. Is there anything I overseen?

==25057== 
==25057== HEAP SUMMARY:
==25057==     in use at exit: 72,704 bytes in 1 blocks
==25057==   total heap usage: 2,066 allocs, 2,065 frees, 278,679 bytes allocated
==25057== 
==25057== Searching for pointers to 1 not-freed blocks
==25057== Checked 1,217,456 bytes
==25057== 
==25057== 72,704 bytes in 1 blocks are still reachable in loss record 1 of 1
==25057==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==25057==    by 0x6DA3EFF: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==25057==    by 0x40104E9: call_init.part.0 (dl-init.c:72)
==25057==    by 0x40105FA: call_init (dl-init.c:30)
==25057==    by 0x40105FA: _dl_init (dl-init.c:120)
==25057==    by 0x4000CF9: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)
==25057==    by 0x4: ???
==25057==    by 0xFFF00000E: ???
==25057==    by 0xFFF00002A: ???
==25057==    by 0xFFF000031: ???
==25057==    by 0xFFF000036: ???
==25057==    by 0xFFF000040: ???
==25057== 
==25057== LEAK SUMMARY:
==25057==    definitely lost: 0 bytes in 0 blocks
==25057==    indirectly lost: 0 bytes in 0 blocks
==25057==      possibly lost: 0 bytes in 0 blocks
==25057==    still reachable: 72,704 bytes in 1 blocks
==25057==         suppressed: 0 bytes in 0 blocks
==25057== 
==25057== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==25057== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

@jben94
Copy link
Author

jben94 commented Oct 25, 2016

how do you use gearman server?
this rise was actually how long to use?
From my side, I use the mod-gearman module centreon-engine.

@p-alik
Copy link
Collaborator

p-alik commented Oct 25, 2016

gearmand started in valgrind as described in your comment at Aug 22 and run simple sum test.
I didn't use mod-gearman. Maybe is mod-gearman to blame for the issue?

@jben94
Copy link
Author

jben94 commented Oct 26, 2016

I do not have the results of my tests with valgrind. But if you look at the portion of source code that I indicated. We can see a memory allocation that is never freed.

@p-alik
Copy link
Collaborator

p-alik commented Jan 23, 2017

@jben94, mod-gearman supports gearmand v0.33.
See

Maybe it's a clue for the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants