Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Sep 2009 17:13:52 +0200
From:      Per olof Ljungmark <peo@intersonic.se>
To:        Mel Flynn <mel.flynn+fbsd.questions@mailing.thruhere.net>
Cc:        freebsd-questions@freebsd.org, Michael David Crawford <mdc@prgmr.com>
Subject:   Re: memory usage displsy
Message-ID:  <4A9E8BB0.1020107@intersonic.se>
In-Reply-To: <200909021624.38655.mel.flynn%2Bfbsd.questions@mailing.thruhere.net>
References:  <4A9D8057.8020307@intersonic.se> <4A9D89CB.6060206@intersonic.se> <4A9D8FDB.9040908@prgmr.com> <200909021624.38655.mel.flynn%2Bfbsd.questions@mailing.thruhere.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Mel Flynn wrote:
> 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.

Thank you all for the informative answers, helped a lot to understand 
better what is going on.

I cannot run 100.chksetuid on a production server but I will definitely 
do it on the testing one.

Cheers,
--
per



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