Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Oct 2001 18:41:26 -0400 (EDT)
From:      Marco Radzinschi <marco@radzinschi.com>
To:        Bob Johnson <bob89@garbonzo.hos.ufl.edu>
Cc:        <questions@freebsd.org>
Subject:   Re: Q: Inactive vs. free memory?
Message-ID:  <20011022182357.X3056-100000@mail.radzinschi.com>
In-Reply-To: <3BD47BC1.310AF913@garbonzo.hos.ufl.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 22 Oct 2001, Bob Johnson wrote:

[snip!]

> The relatively short answer is that "Inactive" memory is dirty
> memory that needs to be written to swap before it can be reallocated.
> "Cache" is memory that can be reallocated immediately, either because
> it has already been written to swap, or for some reason it can be
> reused without doing so (I suppose an example of this would be
> executable code that will be re-read from the original file if it
> is needed again).
>
> Memory gets into the "Inactive" or "Cache" queue by not being accessed
> for a while.  Something is still claiming it, but since it hasn't been
> accessed recently, it is considered a good candidate for re-use
> when something else needs some physical memory.  If the process that
> owns the memory accesses it, it will be moved back to "Active" without
> any swapping being necessary.


	I thought that it was unlikely that my system had 174 MB of memory
that would need to be swapped out before being reclaimed, since I am sure
it did not actually NEED that much memory.  That is, there is no way it
was working with that large a data set.

I wanted to see what would happen if it was needed, so I started enough
processes to eat up 200+ MB of RAM, and what I observed was that the
system first used the cache memory, as you said it would.  Then the inactive
memory started dropping fast, and the active memory count started going
up.  It DID NOT, however, start paging until the inactive memory was down
to a few megabytes.  From this I conclude that inactive memory need not
necessarily be paged out in order to be reclaimed.

In my particular case, I believe Samba eats up RAM when I transfer several
gigabytes over the network, which ends up as inactive.  It still seems odd
to me that it does not end up as cache memory, but it seems to work just
as well.

Thanks for the input,

Marco Radzinschi

E-Mail: marco@radzinschi.com
AOL IM: CrackedBoy

Running FreeBSD 4.4-RELEASE i386
 6:23PM  up 1 day,  4:32, 1 user, load averages: 1.00, 1.00, 1.00



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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