Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Jan 1998 02:16:37 -0800
From:      David Greenman <dg@root.com>
To:        grobin@accessv.com
Cc:        questions@FreeBSD.ORG
Subject:   Re: Something is very wrong. Memory leak? 
Message-ID:  <199801311016.CAA16970@implode.root.com>
In-Reply-To: Your message of "Sat, 31 Jan 1998 05:04:50 EST." <34D2F742.5BE6A334@accessv.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>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=<n>"

   ...where <n> 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



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