Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Feb 1998 15:31:54 -0800
From:      David Greenman <dg@root.com>
To:        SrA Scott Gregory <gregory@afpubs.hq.af.mil>
Cc:        freebsd-questions@FreeBSD.ORG, grobin@accessv.com
Subject:   Re: FW: Something is very wrong. Memory leak? (fwd) 
Message-ID:  <199802192331.PAA04684@implode.root.com>
In-Reply-To: Your message of "Mon, 02 Feb 1998 14:59:39 EST." <Pine.BSF.3.96.980202142259.11490A-100000@afpubs.hq.af.mil> 

next in thread | previous in thread | raw e-mail | index | archive | help
>Back in November I asked this very same question.  I set my maxusers to
>256 and nmbclusters to 4096 as suggested.  The server was up for 50+ days
>(taken down due to a scheduled power outage).  I had asked if the max the
>clusters would get to would be 4096 and was told yes, however, before the
>server was taken down it was 4400+.  The number of clusters that had been
>used had gradually increased over the 50+ days and the percentage
>allocated to the network never dropped below 25% (even at 2am when the
>server was answering 1 client request).   
>
>If setting nmbclusters at 4096 didn't stop the system from allocating more
>than 4096, how do I know when the server will reach its maximum?  I think
>that given enough time the server would have crashed like before.  I
>accidently did a "vmstat -m" instead of "netstat -m" and found the
>following (among other stats):
>
>Memory statistics by type                          Type  Kern
>        Type  InUse MemUse HighUse  Limit Requests Limit Limit Size(s)
>         mbuf     1     8K      8K 19661K        1    0     0  8K
>
>
>Is there anything that can clear or deallocate mbuf clusters?  I ran
>something a while ago that (I believe) showed the number of allocated
>mbufs that were active and inactive.  At 2am there was alot more clusters
>active than should have been.

   The vmstat statistics no longer show mbuf usage; mbufs in -current are now
allocated out of the same space as mbuf clusters are allocated. Since both
mbufs and mbuf clusters share the same memory space, the maximum number of
mbuf clusters is somewhat larger than NMBCLUSTERS - it's the sum of the
space for mbufs and mbuf clusters. I'm not aware of any memory leaks and
I do watch for things like that. We've had 4-6 week uptimes on wcarchive
without any visable sign of any leaks. This doesn't mean that there aren't
any, just that they don't occur with the type of traffic we have on that
machine. Mbufs and mbuf clusters are usually most often consumed by buffered
data in sockets. You can look at this with 'netstat -a'; you want to pay
particular attention to the send/recv-q numbers, as this indicates buffered
data. Any "stuck" sockets with non-0 send/recv-q would act similar to a
leak, but wouldn't actually be one. If you are running over the configured
NMBCLUSTERS value, then you should increase it.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802192331.PAA04684>