Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Oct 1997 07:50:00 -0700
From:      David Greenman <dg@root.com>
To:        Gordon Henderson <gordon@drogon.net>
Cc:        Mike Smith <mike@smith.net.au>, hackers@FreeBSD.ORG
Subject:   Re: Wheres all my memory going? 
Message-ID:  <199710081450.HAA20067@implode.root.com>
In-Reply-To: Your message of "Wed, 08 Oct 1997 14:41:56 BST." <Pine.LNX.3.95.971008144115.26875T-100000@unicorn> 

next in thread | previous in thread | raw e-mail | index | archive | help
>On Wed, 8 Oct 1997, Mike Smith wrote:
>
>> > Mem: 242M Active, 50M Inact, 26M Wired, 34M Cache, 1726K Buf, 152M Free
>> > Swap: 64M Total, 53M Used, 11M Free, 83% Inuse
>> ...
>> > And that just does now add up!!! (Yes, named is supposed to be that large,
>> > but it's no-where near the total memory of the machine)
>> 
>> Yes it does: 242 + 50 + 26 + 34 + 1.762 + 152 ~= 512.
>
>But if theres 152MB of free memory then why is it ever pushing stuff out
>into swap???

   Because there was something that took lots of memory and triggered a
pageout. The system "caches" the data written out to swap - it isn't freed
up just by being paged back in again. This is why it is so important that
you have at least as much swap as you have main memory. The weird thing isn't
the memory totals - these make perfect sense to those of us who understand
what they mean...but what's quite unusual is the size of your named process:

  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
    0   287     1   9   2  0 290060  840 select Ss    ??  237:40.19 named

   ...almost 300MB of virtual memory? Wow! I'd ask just what you were
primary/secondary for, but I don't think I want to know. :-) It's also
strange that the RSS is so small given the VSZ. Your pagedaemon is also
consuming a lot of CPU, which probably means that the system is paging
a lot...you apparantly have other things on the system competing for
memory as well. "top" is a poor utility for looking at this sort of thing
since this shows top CPU consumers, not top memory consumers. You really
should be using 'ps -alx' to look at this stuff.

-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?199710081450.HAA20067>