Date: Wed, 2 Sep 2009 16:24:37 +0200 From: Mel Flynn <mel.flynn+fbsd.questions@mailing.thruhere.net> To: freebsd-questions@freebsd.org Cc: Michael David Crawford <mdc@prgmr.com> Subject: Re: memory usage displsy Message-ID: <200909021624.38655.mel.flynn%2Bfbsd.questions@mailing.thruhere.net> In-Reply-To: <4A9D8FDB.9040908@prgmr.com> References: <4A9D8057.8020307@intersonic.se> <4A9D89CB.6060206@intersonic.se> <4A9D8FDB.9040908@prgmr.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 01 September 2009 23:19:23 Michael David Crawford wrote: > Per olof Ljungmark wrote: > > Well, my problem is that if I add up all I *can* see in top or ps it > > never gets near the by now 3G plus memory shown as "Active". Maybe one > > gig is accounted for, > > I'm not that familiar with FreeBSD yet, but the kernel uses memory which > might not be charged against any process. > > For example, to map some virtual memory requires memory to store the > mappings in. > > Open files have kernel structures, as do filesystems. > > If top or ps were only to show userspace memory allocations, then you're > right, a lot of memory would be unaccounted for. It doesn't for the Active to Free states. For individual processes, everything is shown that the process allocates. So for a file descriptor, an int would be allocated, where the kernel holds the real info. This is one cause for filled Active memory: a process polling multiple file descriptors, like a File Alteration Monitor under current desktops. The other, as Dan Nelson described, is file cache. If you want to be sure it's this, then reboot the machine and run: /etc/periodic/security/100.chksetuid You should see memory usage going up. If this causes a performance problem (i.e. You sometimes are subject to heavily increasing loads on a mailserver, that causes a lot of forks and file cache memory isn't unloaded fast enough), then you should either disable the security check or properly seperate data from binaries using partitions and mount data partitions with nosuid/noexec, so that these are omitted from the daily checks. -- Mel
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909021624.38655.mel.flynn%2Bfbsd.questions>