The memory traces track the memory allocated by backtrace, ie the functions call chain that leads to the allocation. Traceback is the backtrace similar to what you get in a debugger. Bytes is the total memory currently allocated by this specific backtrace. Count is the number of active allocations. The traces are ordered by 'Bytes' (ie total memory used)
So in your example, the 1st entry is a single (Count is 1) big (Bytes is ~30MB) allocation that happened when put an interface into L2 mode whereas the 2nd entry is 5222 (Count is 5222) small (average is Bytes/Count = 266768/5222 ~51B) allocations. To detect a memory leak, you dump the memory traces and compare the output: if an entry for a specific backtrace keeps increasing in both Bytes and Count, it is probably the culprit. Best ben > -----Original Message----- > From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Xuo Guoto via > lists.fd.io > Sent: Sunday, July 3, 2022 11:56 > To: vpp-dev@lists.fd.io > Subject: [vpp-dev] Interpreting memory-trace > > Hello vpp-dev, > > I am trying to pin down an elusive memory leak and from previous messages > its understood that memory-trace is the best tool for the job. From the > docs it uses two commands: > > $ vppctl memory-trace on main-heap > $ vppctl show memory-trace on main-heap > Thread 0 vpp_main > base 0x7fffb6422000, size 1g, locked, unmap-on-destroy, name 'main heap' > page stats: page-size 4K, total 262144, mapped 30343, not-mapped > 231801 > numa 0: 30343 pages, 118.53m bytes > total: 1023.99M, used: 115.49M, free: 908.50M, trimmable: 908.48M > free chunks 451 free fastbin blks 0 > max total allocated 1023.99M > > Bytes Count Sample Traceback > 31457440 1 0x7fffbb31ad00 clib_mem_alloc_aligned_at_offset + 0x80 > clib_mem_alloc_aligned + 0x26 > alloc_aligned_8_8 + 0xe1 > clib_bihash_instantiate_8_8 + 0x76 > clib_bihash_init2_8_8 + 0x2ec > clib_bihash_init_8_8 + 0x6a > l2fib_table_init + 0x54 > set_int_l2_mode + 0x89 > int_l3 + 0xb4 > vlib_cli_dispatch_sub_commands + 0xeee > vlib_cli_dispatch_sub_commands + 0xc62 > vlib_cli_dispatch_sub_commands + 0xc62 > 266768 5222 0x7fffbd79f978 clib_mem_alloc_aligned_at_offset + 0x80 > vec_resize_allocate_memory + 0xa8 > _vec_resize_inline + 0x240 > > In the output what does Bytes, Count, Sample and Traceback denote? > > > To check if there is a memory leak, do I have to leave the memory-trace on > and get another output after say 24 hours? How do I compare the two > outputs? > > Sorry for too many questions, but this aspect has been poorly documented > and if documented in this thread, will help others in same situation in > future. > > best, > X.
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#21678): https://lists.fd.io/g/vpp-dev/message/21678 Mute This Topic: https://lists.fd.io/mt/92144131/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-