From owner-freebsd-questions Thu Feb 19 15:33:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA16058 for freebsd-questions-outgoing; Thu, 19 Feb 1998 15:33:38 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA15912 for ; Thu, 19 Feb 1998 15:33:06 -0800 (PST) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id PAA04684; Thu, 19 Feb 1998 15:31:54 -0800 (PST) Message-Id: <199802192331.PAA04684@implode.root.com> To: SrA Scott Gregory cc: freebsd-questions@FreeBSD.ORG, grobin@accessv.com Subject: Re: FW: Something is very wrong. Memory leak? (fwd) In-reply-to: Your message of "Mon, 02 Feb 1998 14:59:39 EST." From: David Greenman Reply-To: dg@root.com Date: Thu, 19 Feb 1998 15:31:54 -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >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