From owner-freebsd-questions Mon Oct 22 15:41:46 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.radzinschi.com (cc222717-a.owml1.md.home.com [65.8.33.207]) by hub.freebsd.org (Postfix) with ESMTP id 9D59837B401 for ; Mon, 22 Oct 2001 15:41:40 -0700 (PDT) Received: from localhost (localhost.radzinschi.com [127.0.0.1]) by mail.radzinschi.com (8.11.6/8.11.6) with ESMTP id f9MMfQa03097; Mon, 22 Oct 2001 18:41:27 -0400 (EDT) (envelope-from marco@radzinschi.com) Date: Mon, 22 Oct 2001 18:41:26 -0400 (EDT) From: Marco Radzinschi To: Bob Johnson Cc: Subject: Re: Q: Inactive vs. free memory? In-Reply-To: <3BD47BC1.310AF913@garbonzo.hos.ufl.edu> Message-ID: <20011022182357.X3056-100000@mail.radzinschi.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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