Date: Thu, 8 Mar 2001 17:26:21 -0800 (PST) From: Matt Dillon <dillon@earth.backplane.com> To: Jesper Skriver <jesper@skriver.dk> Cc: Dan Phoenix <dphoenix@bravenet.com>, freebsd-hackers@FreeBSD.ORG Subject: Re: systat -vmstat or iostat IO help Message-ID: <200103090126.f291QLO05885@earth.backplane.com> References: <Pine.BSO.4.21.0103051732370.6833-100000@gandalf.bravenet.com> <200103060208.f2628PT49635@earth.backplane.com> <20010308213722.A83857@skriver.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
: :On Mon, Mar 05, 2001 at 06:08:25PM -0800, Matt Dillon wrote: :> :> :I am trying to figure out corelation between Inactive and Free then. :> :Inact would be unused ram right? :> :Free would be what how much of Active is being used? So what you are :> :saying is if there is to much free then alot of active pages are being :> :killed for some reason...as seen in error logs etc? ....just trying to get :> :a quick overview of what a good accessment that was...never thought of :> :that. :> :> 'free' (from systat -vm or top) is all that matters in your case. :> Active/Inactive/Cache are best simply added together. Their :> individual values will depend heavily on the load on the machine :> because the VM system doesn't bother to keep things in their :> proper queues if the memory load is low. : :Could you please give a pointer to a description of the meaning of :Active, Inactive and Cache, on a machine I see this : :Mem: 138M Active, 661M Inact, 114M Wired, 48M Cache, 112M Buf, 44M Free :Swap: 1612M Total, 16K Used, 1612M Free : :Yes I know it has too much memory, but I'm surprised why more isn't used :for disk caching .... : :/Jesper : :-- :Jesper Skriver, jesper(at)skriver(dot)dk - CCIE #5456 It will use all available memory for disk caching if possible, but it only caches things you've accessed at least once so I would say you simply haven't accessed more then 650MB or so worth of file data. Active This queue represents pages that are in active use by programs. The pages may be clean or dirty. Inactive This queue represents pages that are not being actively used but have not been idle long enough to be considered truely idle. These pages may be clean or dirty. The system may choose to 'launder' dirty pages by writing them to their backing store, then marking them clean. A user program may access these pages, causing them to eventually be moved back into the Active queue. Or memory pressure may cause clean pages in this queue to be moved to the Cache. Cache This queue represents pages that are totally idle and clean, but still contain valid data associated with some file or directory. If a program accesses a Cached page it will be moved back into the Active queue. If the system cannot find enough free pages in the Free list the system can reuse pages from this queue for other purposes, destroying any data previously cached in the page. Free This queue represents pages that are totally free, meaning that they are not associated with anything at all, not even as a cache for something. Pages are freed by the system under two conditions: (1) when a program frees general memory, and (2) when the system is under memory pressure and needs more free pages then pages are taken from the cache queue and placed in the free queue. Pages used to hold file and directory information requested by programs are typically not freed. Instead they are eventually moved into the Cache queue where they might reside for long periods of time. The system only reuses these pages when under memory pressure. FreeBSD does not waste time moving pages between queues unless it is under some sort of memory pressure. FreeBSD will happily keep the pages where they fall, be it in the Active queue, Inactive queue, or Cache queue (except for the case when a program accesses such a page, at which point a Cache page will be immediately moved into the Active queue). In an extremely lightly loaded system you cannot really garner anything about memory load by looking at how many pages are in any given queue. In a normal system you can generally assume that Inactive + Cache is the real count of the number of 'cached' pages. In a more heavily loaded system Active really does mean Active, Inactive really does mean Inactive, and Cache really does mean cached. In a very heavily loaded environment the system is forced to recycle pages so quickly that pages residing in the Inactive or Cache queues could actually still be in active use (though if in the Cache queue they are guarenteed to be marked clean so they can be reused immediately without further laundering). The movement, under load, of dirty pages from the Inactive queue to the Cache queue generates the swap paging activity that you see in more heavily loaded system. This is the 'laundering' that the system performs in order to clean a dirty page in order to be able to move it from Inactive to Cache. There are other types of memory load as well.. for example, it is possible to be 'loaded down' with mostly clean pages but the active dataset is too large to fit in memory, so the system is forced to discard clean pages sooner then it would otherwise discard them. This type of load is visible by noting the amount of page scanning the system does (the 'sr' field in vmstat) and the number of reactivations (the 're' field in vmstat). A reactivation occurs when the system has moved a page (typically) to the Inactive or Cache queue, but then some program accesses it again and forces the system to take a VM fault and put the page back into the Active queue. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103090126.f291QLO05885>