*BSD News Article 84523


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!news.sprintlink.net!news-peer.sprintlink.net!news.sprintlink.net!news-hub.sprintlink.net!news.sprintlink.net!news-fw-6.sprintlink.net!coopnews.coop.net!super.zippo.com!zdc!szdc!szdc-e!news
From: "John S. Dyson" <dyson@freebsd.org>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: memory allocation problem
Date: Sun, 08 Dec 1996 15:19:56 -0500
Organization: John S. Dyson's home machine
Lines: 24
Message-ID: <32AB22EC.167EB0E7@freebsd.org>
References: <58e60m$pg8@nerd.apk.net> <58f2bn$br2@dismay.ucs.indiana.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.01 (X11; I; FreeBSD 3.0-CURRENT i386)

John Fieber wrote:
> 
> In article <58e60m$pg8@nerd.apk.net>,
>         droberts@apk.net (Dan Roberts) writes:
> > Why is everything being allocated to cache??  It works fine as if it were
> > actually free.  Seems to reallocate well, but why does it do it in the
> > first place?
> 
> Because "free" memory is wasted resource.  FreeBSD tries to make the
> best use of all available memory.  When it isn't needed for active
> processes, it gets used for other things like cache.
> 
Following up, the memory in the cache queue is immediately available
for reuse.  There is no reclaimation process needed to use the
pages.  There are kind-of two kinds of caches on FreeBSD, but they
are coherent (exactly the same data, just with a different
view.)  The page cache is a VM cache, while the VFS (block-buffer)
cache is the commonly known buffer cache.  The VM cache backs the
block buffer cache.  The parameter "NBUF(S)" as used in older
U**X type kernels is less meaningful on FreeBSD, because a buffer
header is not needed for read caching on files.  The VM system
can provide the cache transparently.

John