From owner-freebsd-questions Sat Jan 31 02:15:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA20978 for questions-outgoing; Sat, 31 Jan 1998 02:15:04 -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 CAA20972 for ; Sat, 31 Jan 1998 02:15:00 -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 CAA16970; Sat, 31 Jan 1998 02:16:38 -0800 (PST) Message-Id: <199801311016.CAA16970@implode.root.com> To: grobin@accessv.com cc: questions@FreeBSD.ORG Subject: Re: Something is very wrong. Memory leak? In-reply-to: Your message of "Sat, 31 Jan 1998 05:04:50 EST." <34D2F742.5BE6A334@accessv.com> From: David Greenman Reply-To: dg@root.com Date: Sat, 31 Jan 1998 02:16:37 -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe questions" >I'm running a FreeBSD 2.2.5RELEASE server using Apache 1.3a1 on a P-200 >with 128MB RAM that gets 80k to 100k hits a day and I seem to be >experiencing a serious memory problem. > >When the server boots I have about 109MB free memory. As time goes by >the free memory slowly disappears at the rate of about 40MB a day. Most >of the missing memory is listed under active in top but the sum of >memory used by the process isn't anywhere near that much. > >And it gets worse... > >If I don't reboot every two days and the free memory gets below 15MB the >systems seems to go into a sort of 'dormant' state. It stops processing >requests from the web and telnet becomes very slow even though the load >average is below 0.2. Luckily I am still able to reboot when it is in >this state. > >I've been very careful about rebooting regularly so this 'dormant' state >has only occurred twice, but it seems to be directly related to the loss >of memory. > >The server was installed from the same FreeBSD CD that I installed on my >home system, but I haven't had any memory problems at home. > >Dose anybody know what is going on? "Free memory" is memory that is completely unused and contains no useful data. As the system runs and files are accessed, the file data is cached and is no longer "free". It will then show up in the statistics of 'active', 'inactive', and 'cached'. I suspect your problem is caused by running out of networking buffers (mbuf clusters). If you haven't specifically tuned this on your system, then this is likely. You can increase the number of buffers by either increasing the value of "maxusers" in the kernel config file, or by adding: options "NMBCLUSTERS=" ...where is something like 4000. I would suggest that you do both of these - set maxusers to at least 64, and NMBCLUSTERS to 4000. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project