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
collectd-5.6.2 memory leak #2303
Comments
xml comes from bind plugin. bind plugin is configured as below:
I commented out loading bind plugin. After this valgrind didn't mention libxml2:
|
Can you reproduce this on master? |
I compiled master version. I run it only under valgrind:
Now I run collectd without valgrind, I'll know more about memory usage after a couple of days. As for now collectd uses 14MB of RES. |
Could you see if this helps?
|
Scratch that, I found a few more. Could you give #2306 a try? |
I run collectd for a 10 hours, RES has stable size. Valgrind says:
For me it looks good, thank you for quick fix. Will be this fix backported to 5.6 branch? |
Nice, thanks for testing! Sure, I'll backport this to 5.6 in a few days. Any reason you're not on 5.7 yet? It contains a lot more of those kinds of fixes ;) |
I'm waiting for ebuild in Gentoo:) |
Just summon @Whissi, he will fix that ;) |
See collectd/collectd#2303 Package-Manager: Portage-2.3.5, Repoman-2.3.2
Thanks for the ping, @rubenk! And I'll add collect-5.7 probably in the next week. |
Thanks Thomas! |
Thanks Ruben & Thomas. |
Expected behavior
RES memory shouldn't grow up to 2GB
Actual behavior
After a week or two of working RES memory usage grows and grows. Today I saw that collectd used almost 2GB of ram (on RES)/
This is what I got when I run collectd under valgrind:
# valgrind --leak-check=full --trace-children=yes --log-file=/tmp/coll-val.log --leak-resolution=med --show-leak-kinds=definite /usr/sbin/collectd -C /etc/collectd.conf -P /run/collectd/coll
ectd.pid -f
==10052== Memcheck, a memory error detector
==10052== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==10052== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==10052== Command: /usr/sbin/collectd -C /etc/collectd.conf -P /run/collectd/collectd.pid -f
==10052== Parent PID: 12265
==10052==
==10052== Syscall param prctl(arg4) contains uninitialised byte(s)
==10052== at 0x4D31A0A: prctl (syscall-template.S:84)
==10052== by 0x12522A: check_capability (common.c:1532)
==10052== by 0x4218C5E: dns_init (dns.c:311)
==10052== by 0x118ECE: plugin_init_all (plugin.c:1581)
==10052== by 0x10EE58: do_init (collectd.c:297)
==10052== by 0x10EE58: main (collectd.c:656)
==10052==
==10052==
==10052== HEAP SUMMARY:
==10052== in use at exit: 1,069,105 bytes in 8,923 blocks
==10052== total heap usage: 376,369 allocs, 367,446 frees, 35,566,813 bytes allocated
==10052==
==10052== 8 bytes in 1 blocks are definitely lost in loss record 12 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x4CC5288: strdup (strdup.c:42)
==10052== by 0x12907B: yyparse (parser.y:110)
==10052== by 0x1258E3: oconfig_parse_fh (oconfig.c:62)
==10052== by 0x1258E3: oconfig_parse_file (oconfig.c:89)
==10052== by 0x111276: cf_read_file (configfile.c:604)
==10052== by 0x111276: cf_read_generic (configfile.c:774)
==10052== by 0x11219B: cf_read (configfile.c:1006)
==10052== by 0x10EB18: main (collectd.c:523)
==10052==
==10052== 466 bytes in 43 blocks are definitely lost in loss record 368 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x58C9875: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==10052== by 0xB81CC6F: ???
==10052== by 0xF16AC631E29C2BFF: ???
==10052== by 0xE9FC9CF: ???
==10052==
==10052== 466 bytes in 43 blocks are definitely lost in loss record 369 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x58C9875: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==10052== by 0xB01BC6F: ???
==10052== by 0xF16AC631E29C2BFF: ???
==10052== by 0x538245F: ???
==10052==
==10052== 466 bytes in 43 blocks are definitely lost in loss record 370 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x58C9875: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==10052== by 0xB81CC6F: ???
==10052== by 0xF16AC631E29C2BFF: ???
==10052== by 0x545D5FF: ???
==10052==
==10052== 484 bytes in 47 blocks are definitely lost in loss record 371 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x58C9875: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==10052== by 0xA019C6F: ???
==10052== by 0xF16AC631E29C2BFF: ???
==10052== by 0x5328ABF: ???
==10052==
==10052== 502 bytes in 51 blocks are definitely lost in loss record 372 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x58C9875: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==10052== by 0xB01BC6F: ???
==10052== by 0xF16AC631E29C2BFF: ???
==10052== by 0x5328ABF: ???
==10052==
==10052== 520 bytes in 55 blocks are definitely lost in loss record 373 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x58C9875: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==10052== by 0xB81CC6F: ???
==10052== by 0xF16AC631E29C2BFF: ???
==10052== by 0x5328ABF: ???
==10052==
==10052== 864 bytes in 1 blocks are definitely lost in loss record 379 of 407
==10052== at 0x402DD7A: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x10FEC9: cf_ci_append_children.isra.2 (configfile.c:505)
==10052== by 0x111216: cf_read_generic (configfile.c:789)
==10052== by 0x11138B: cf_include_all (configfile.c:552)
==10052== by 0x11138B: cf_read_file (configfile.c:610)
==10052== by 0x11138B: cf_read_generic (configfile.c:774)
==10052== by 0x11219B: cf_read (configfile.c:1006)
==10052== by 0x10EB18: main (collectd.c:523)
==10052==
==10052== 1,007 bytes in 109 blocks are definitely lost in loss record 380 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x58C9875: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==10052== by 0xA019DBF: ???
==10052== by 0xF16AC631E29C2BFF: ???
==10052== by 0xE0CC97F: ???
==10052==
==10052== 1,007 bytes in 109 blocks are definitely lost in loss record 381 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x58C9875: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==10052== by 0xB81CDBF: ???
==10052== by 0xF16AC631E29C2BFF: ???
==10052== by 0x545D5FF: ???
==10052==
==10052== 2,014 bytes in 218 blocks are definitely lost in loss record 390 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x58C9875: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==10052== by 0xB81CDBF: ???
==10052== by 0xF16AC631E29C2BFF: ???
==10052== by 0xD797D1F: ???
==10052==
==10052== 2,014 bytes in 218 blocks are definitely lost in loss record 391 of 407
==10052== at 0x402ADD5: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10052== by 0x58C9875: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==10052== by 0xB01BDBF: ???
==10052== by 0xF16AC631E29C2BFF: ???
==10052== by 0x538245F: ???
==10052==
==10052== LEAK SUMMARY:
==10052== definitely lost: 9,818 bytes in 938 blocks
==10052== indirectly lost: 0 bytes in 0 blocks
==10052== possibly lost: 288 bytes in 1 blocks
==10052== still reachable: 1,058,999 bytes in 7,984 blocks
==10052== suppressed: 0 bytes in 0 blocks
==10052== Reachable blocks (those to which a pointer was found) are not shown.
==10052== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10052==
==10052== For counts of detected and suppressed errors, rerun with: -v
==10052== Use --track-origins=yes to see where uninitialised values come from
==10052== ERROR SUMMARY: 14 errors from 14 contexts (suppressed: 0 from 0)
Steps to reproduce
The text was updated successfully, but these errors were encountered: