On Wed, Oct 25, 2017 at 01:39:35PM -0600, Todd C. Miller wrote:
> On Wed, 25 Oct 2017 19:46:56 +0200, Mike Belopuhov wrote:
> 
> > I think we can extend this by adding an additional number for the
> > upper boundary (kern.maxclusters), like so:
> > 
> >   saru:usr.bin/netstat% ./obj/netstat -m
> >   539 mbufs in use:
> >     385 mbufs allocated to data
> >     13 mbufs allocated to packet headers
> >     141 mbufs allocated to socket names and addresses
> >   19/144 mbuf 2048 byte clusters in use (current/peak)
> >   0/45 mbuf 2112 byte clusters in use (current/peak)
> >   256/312 mbuf 4096 byte clusters in use (current/peak)
> >   0/48 mbuf 8192 byte clusters in use (current/peak)
> >   0/28 mbuf 9216 byte clusters in use (current/peak)
> >   0/40 mbuf 12288 byte clusters in use (current/peak)
> >   0/40 mbuf 16384 byte clusters in use (current/peak)
> >   0/40 mbuf 65536 byte clusters in use (current/peak)
> >   5876 out of 524288 Kbytes allocated to network (20% in use)
> >   0 requests for memory denied
> >   0 requests for memory delayed
> >   0 calls to protocol drain routines
> 
> That's definitely an improvement.  OK millert@
> 

The math for the percentage in use is doing something different at least
20% of 524288 is not 5876. AFAIK the percentage is calculated against the
pool size and not the maximum size.
Would be great if netstat could show the current and peak memory usage.

-- 
:wq Claudio

Reply via email to