From owner-freebsd-hackers Tue Jun 15 9:54:52 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from dyson.iquest.net. (dyson.iquest.net [198.70.144.127]) by hub.freebsd.org (Postfix) with ESMTP id 3DAD91518F for ; Tue, 15 Jun 1999 09:54:48 -0700 (PDT) (envelope-from toor@dyson.iquest.net) Received: (from toor@localhost) by dyson.iquest.net. (8.9.3/8.9.3) id LAA03905; Tue, 15 Jun 1999 11:54:37 -0500 (EST) (envelope-from toor) Message-Id: <199906151654.LAA03905@dyson.iquest.net.> Subject: Re: Inactive vs. free Memory In-Reply-To: from Arun Sharma at "Jun 15, 1999 08:54:23 am" To: adsharma@home.com (Arun Sharma) Date: Tue, 15 Jun 1999 11:54:37 -0500 (EST) Cc: jim@thehousleys.net (James E. Housley), hackers@FreeBSD.ORG From: "John S. Dyson" Reply-To: dyson@iquest.net X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Arun Sharma said: > "James E. Housley" writes: > > > Just for my infomation. What is the difference between "Inactive" and > > "Free" memory. Right now top says I have 157M Inact and 3260K Free. > > Inactive means the page contains valid data belonging to some file, > but is not mapped into any address space. Free means, the page doesn't > contain valid data. > Trying to be helpful to follow up with more detail, but slightly inprecise due to the fact that there are still some generalizations: Active pages have been recently mapped into a process by the kernel, most often by virtue of a page fault. Sometimes pages are activated, but not initially mapped, and that is a policy decision. Inactive pages might or might not be mapped into a process recently, but those pages have likely been bumped from the Active list by the pageout daemon. Sometimes the system will initially inactivate a page instead of activating it for policy reasons though. Cache pages are not mapped into a process, but are left around for reuse with intact data. Cache pages are VM cached, but a slightly confusing issue is that buffer cache pages are actually wired. Cache pages are in the netherworld of being free and not-free, and can be used as BOTH empty or cache data. Free pages have no data, and might or might not be prezeroed. Wired pages are often directly used by the kernel, and are not available for involuntary reuse by the actions of the pageout daemon. One of the improvements of FreeBSD VM over the old original code is that it has an in-between form of "free" pages called "cache" pages, that are available for immediate reuse both as empty pages or containing their previous contents. This allows for policy mistakes to be buffered further than the LRU-K type algorithm used by the pageout daemon. Adding the cache queue made a significant improvement, over and above the LRU-K style scheme. (Note the FreeBSD implementation of LRU-K is particularly efficient.) -- John | Never try to teach a pig to sing, dyson@iquest.net | it makes one look stupid jdyson@nc.com | and it irritates the pig. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message