Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Oct 1997 17:03:35 +0200 (CEST)
From:      Mikael Karpberg <karpen@ocean.campus.luth.se>
To:        gordon@drogon.net (Gordon Henderson)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Wheres all my memory going?
Message-ID:  <199710081503.RAA00426@ocean.campus.luth.se>
In-Reply-To: <Pine.LNX.3.95.971008144115.26875T-100000@unicorn> from Gordon Henderson at "Oct 8, 97 02:41:56 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
According to Gordon Henderson:
> 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 if some program has allocaed a lot of memory it doesn't use,
then the memory will slowly be written down to swap when there's free time
to do so. This is so that if 200MB memory is needed instantly at a later time
free memory (152 MB) AND inactive memory need to be used. So everything
"inactive" will simply be given to the new user, since the contents of the
memory are already saved to the swap. Otherwise the computer would have to
"sit and wait" when the memory was needed, while the old contents were
written to swap. Now it doesn't have to. It's already written to swap when
the memory is needed elsewere. This makes the operation of the machine
faster. That's why.

Disclaimer: I really am not sure how correct this is, but I think I have
            the right general idea.

  /Mikael



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