Date: Wed, 16 Feb 2005 15:45:50 -0600 From: Eric Anderson <anderson@centtech.com> To: Brooks Davis <brooks@one-eyed-alien.net> Cc: current@freebsd.org Subject: Re: where did all my memory go? Message-ID: <4213BF0E.1080608@centtech.com> In-Reply-To: <20050216214031.GA2787@odin.ac.hmc.edu> References: <1108584730.95661.12.camel@server.mcneil.com> <20050216201716.GA28436@odin.ac.hmc.edu> <4213B3C8.3090508@centtech.com> <1108588393.12275.9.camel@server.mcneil.com> <20050216214031.GA2787@odin.ac.hmc.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Brooks Davis wrote: > On Wed, Feb 16, 2005 at 01:13:13PM -0800, Sean McNeil wrote: > >>On Wed, 2005-02-16 at 14:57 -0600, Eric Anderson wrote: >> >>>Brooks Davis wrote: >>> >>>>On Wed, Feb 16, 2005 at 12:12:10PM -0800, Sean McNeil wrote: >>>> >>>> >>>>>With a system built yesterday on my amd64, I had plenty of memory >>>>>showing as free when the system completely started up. Even after >>>>>intense usage I showed lots of free memory in top. Over night at some >>>>>point all my memory is no longer free but inactive. Is there anything >>>>>wrong here or is this expected behavior? ps doesn't show any serious >>>>>usage by any particular process. Also, if disk caches or something were >>>>>taking up the memory, I would expect it to have shown a lot earlier. >>>> >>>> >>>>On a system that has been up for any significant time, free memory >>>>should be very small since free memory is wasted. My guess is that it >>>>is disk cache and that one of the nightly jobs accessed enough stuff to >>>>fill it. >>> >>>Speaking of this - is there a way to flush the disk cache? [..snip..] > Sync writes dirty pages, it does not return pages to the free list. > There is no reason to agressivly return pages to the free list under > normal load, the system knows which pages have not been modified and > thus can be added to the free list at virtual no cost so why free pages > that might be used again. There's little cost in defering that and very > large potential savings if the data is accessed again later. One way > this can happen is if you mmap a file and read it, those pages will be > mapped and will remain mapped until something pushes them out. If they > are unmodifed, another process that has access to the same data can use > the cached copy rather then doing a read from disk. Thanks Brooks for the simple explanation! Makes total sense to me, and is pretty much what I had understood - I was mostly curious :) On that same topic - let's say someone has a 1TB file, and is using that with geom gate - would portions of that file still be cached as said above, or would they somehow be bypassing the potential caching abilities of the system? What about a geom gate connected directly to a device? Is those cases, would there be any benefit to having a large amount of memory available for caching? Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology I have seen the future and it is just like the present, only longer. ------------------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4213BF0E.1080608>
