[Bug 271246] Kernel wired memory leak with repeated netstat

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 06 May 2023 21:31:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271246

--- Comment #10 from Dave Hayes <dave@jetcafe.org> ---
Ok. Thank you for clarifying. It turns out this was easier than I thought it
would be. Here's output from my script (source code on request). I stopped at >
128 pages of lost wired memory but I can run this longer if you like. 

Stopped at > 128 pages of lost wired memory. Total wired change:   130 pages
(vmstat -z)                       PROC grew 1 bytes in that time period
(vmstat -z)            mbuf_jumbo_page grew -1 bytes in that time period
(vmstat -z)                  pf states grew 248 bytes in that time period
(vmstat -z)                   BUF TRIE grew -12 bytes in that time period
(vmstat -z)            pf state scrubs grew -3 bytes in that time period
(vmstat -z)             buf free cache grew 4 bytes in that time period
(vmstat -z)                  malloc-32 grew 8 bytes in that time period
(vmstat -z)                  filedesc0 grew 1 bytes in that time period
(vmstat -z)                      tcpcb grew 4 bytes in that time period
(vmstat -z)                       PGRP grew 1 bytes in that time period
(vmstat -z)                   4 Bucket grew -1 bytes in that time period
(vmstat -z)                 128 Bucket grew -7 bytes in that time period
(vmstat -z)                  MAP ENTRY grew 50 bytes in that time period
(vmstat -z)                      Files grew 8 bytes in that time period
(vmstat -z)                  tcp_inpcb grew 4 bytes in that time period
(vmstat -z)                  VM OBJECT grew 27 bytes in that time period
(vmstat -z)                  32 Bucket grew -2 bytes in that time period
(vmstat -z)                       mbuf grew 3 bytes in that time period
(vmstat -z)            buffer arena-32 grew -1 bytes in that time period
(vmstat -z)                 RADIX NODE grew 56 bytes in that time period
(vmstat -z)                   2 Bucket grew 10 bytes in that time period
(vmstat -z)                      udpcb grew 3 bytes in that time period
(vmstat -z)                 vm pgcache grew 101 bytes in that time period
(vmstat -z)                  64 Bucket grew 1 bytes in that time period
(vmstat -z)                     socket grew 7 bytes in that time period
(vmstat -z)                  udp_inpcb grew 3 bytes in that time period
(vmstat -z)                  malloc-64 grew 13 bytes in that time period
(vmstat -z)                  malloc-16 grew 1 bytes in that time period
(vmstat -z)                malloc-4096 grew 1 bytes in that time period
(vmstat -z)               mbuf_cluster grew -1 bytes in that time period
(vmstat -z)                    VMSPACE grew 1 bytes in that time period
(vmstat -z)                      KNOTE grew 6 bytes in that time period
(vmstat -z)              pf state keys grew 246 bytes in that time period
(vmstat -z)                 malloc-256 grew -34 bytes in that time period
(vmstat -m)                   freework grew by -3 Kbytes in that time period)
(vmstat -m)                    subproc grew by 4 Kbytes in that time period)
(vmstat -m)                   freeblks grew by -1 Kbytes in that time period)
(vmstat -m)                     select grew by 1 Kbytes in that time period)
(vmstat -m)                     newblk grew by -5 Kbytes in that time period)
(vmstat -m)                   freefile grew by -1 Kbytes in that time period)
(vmstat -m)                  bmsafemap grew by -1 Kbytes in that time period)
(vmstat -m)                        pcb grew by 1 Kbytes in that time period)

These numbers come from slurping in --libxo json output. For vmstat -z I use
the "name" and "used" keys. For vmstat -m I use the "type" and "memory-use"
keys. 

From this output, my likely naive analysis is that your leak is in -none- of
these areas. :)

-- 
You are receiving this mail because:
You are the assignee for the bug.