Hello:
i use ipvs lib to get lvs info and when the code running long time, memory growed.
i use cmd: valgrind --leak-check=full --track-origins=yes ./lvs-metrics -c cfg.json -log_dir var/
get result as:
==24132== HEAP SUMMARY:
==24132== in use at exit: 9,888 bytes in 39 blocks
==24132== total heap usage: 21,043 allocs, 21,004 frees, 21,918,842 bytes allocated
==24132==
==24132== 224 bytes in 1 blocks are definitely lost in loss record 1 of 27
==24132== at 0x4A057BB: calloc (vg_replace_malloc.c:593)
==24132== by 0x4C2E52E: nl_cb_alloc (in /usr/lib64/libnl-3.so.200.16.1)
==24132== by 0x4C3261E: nl_socket_alloc (in /usr/lib64/libnl-3.so.200.16.1)
==24132== by 0x7588E3: _cgo_3a5013fcd522_Cfunc_nl_socket_alloc (netlink.go:144)
==24132== by 0x46012F: runtime.asmcgocall (/home/work/go/src/runtime/asm_amd64.s:582)
==24132== by 0x7: ???
==24132== by 0xC82003CC07: ???
==24132== by 0x403FE9: runtime.cgocall (/home/work/go/src/runtime/cgocall.go:110)
==24132== by 0x43359F: runtime.startTheWorldWithSema (/home/work/go/src/runtime/proc.go:983)
==24132== by 0xC82001F4FF: ???
==24132== by 0x1101: ???
==24132== by 0xC8200745FF: ???
==24132==
==24132== 224 bytes in 1 blocks are definitely lost in loss record 2 of 27
==24132== at 0x4A057BB: calloc (vg_replace_malloc.c:593)
==24132== by 0x4C2E52E: nl_cb_alloc (in /usr/lib64/libnl-3.so.200.16.1)
==24132== by 0x4C3261E: nl_socket_alloc (in /usr/lib64/libnl-3.so.200.16.1)
==24132== by 0x7588E3: _cgo_3a5013fcd522_Cfunc_nl_socket_alloc (netlink.go:144)
==24132== by 0x46012F: runtime.asmcgocall (/home/work/go/src/runtime/asm_amd64.s:582)
==24132== by 0x7: ???
==24132== by 0xC82014FBD7: ???
==24132== by 0x403FE9: runtime.cgocall (/home/work/go/src/runtime/cgocall.go:110)
==24132== by 0x43359F: runtime.startTheWorldWithSema (/home/work/go/src/runtime/proc.go:983)
==24132== by 0xC82046B3BF: ???
==24132== by 0x1101: ???
==24132== by 0xC82046B37F: ???
Hello: i use ipvs lib to get lvs info and when the code running long time, memory growed.
i use cmd: valgrind --leak-check=full --track-origins=yes ./lvs-metrics -c cfg.json -log_dir var/
get result as:
==24132== HEAP SUMMARY: ==24132== in use at exit: 9,888 bytes in 39 blocks ==24132== total heap usage: 21,043 allocs, 21,004 frees, 21,918,842 bytes allocated ==24132== ==24132== 224 bytes in 1 blocks are definitely lost in loss record 1 of 27 ==24132== at 0x4A057BB: calloc (vg_replace_malloc.c:593) ==24132== by 0x4C2E52E: nl_cb_alloc (in /usr/lib64/libnl-3.so.200.16.1) ==24132== by 0x4C3261E: nl_socket_alloc (in /usr/lib64/libnl-3.so.200.16.1) ==24132== by 0x7588E3: _cgo_3a5013fcd522_Cfunc_nl_socket_alloc (netlink.go:144) ==24132== by 0x46012F: runtime.asmcgocall (/home/work/go/src/runtime/asm_amd64.s:582) ==24132== by 0x7: ??? ==24132== by 0xC82003CC07: ??? ==24132== by 0x403FE9: runtime.cgocall (/home/work/go/src/runtime/cgocall.go:110) ==24132== by 0x43359F: runtime.startTheWorldWithSema (/home/work/go/src/runtime/proc.go:983) ==24132== by 0xC82001F4FF: ??? ==24132== by 0x1101: ??? ==24132== by 0xC8200745FF: ??? ==24132== ==24132== 224 bytes in 1 blocks are definitely lost in loss record 2 of 27 ==24132== at 0x4A057BB: calloc (vg_replace_malloc.c:593) ==24132== by 0x4C2E52E: nl_cb_alloc (in /usr/lib64/libnl-3.so.200.16.1) ==24132== by 0x4C3261E: nl_socket_alloc (in /usr/lib64/libnl-3.so.200.16.1) ==24132== by 0x7588E3: _cgo_3a5013fcd522_Cfunc_nl_socket_alloc (netlink.go:144) ==24132== by 0x46012F: runtime.asmcgocall (/home/work/go/src/runtime/asm_amd64.s:582) ==24132== by 0x7: ??? ==24132== by 0xC82014FBD7: ??? ==24132== by 0x403FE9: runtime.cgocall (/home/work/go/src/runtime/cgocall.go:110) ==24132== by 0x43359F: runtime.startTheWorldWithSema (/home/work/go/src/runtime/proc.go:983) ==24132== by 0xC82046B3BF: ??? ==24132== by 0x1101: ??? ==24132== by 0xC82046B37F: ???
my code in https://github.com/mesos-utility/lvs-metrics cron/lvs.go cron/collector.go
i call the code of ipvs.Init() in cron/collector.go, i need call some code for release resource?