From owner-freebsd-questions@FreeBSD.ORG Tue Aug 17 13:39:44 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AFF9D16A4CE for ; Tue, 17 Aug 2004 13:39:44 +0000 (GMT) Received: from ux11.ltcm.net (ux11.ltcm.net [64.215.98.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE8C943D5E for ; Tue, 17 Aug 2004 13:39:43 +0000 (GMT) (envelope-from mipam@ibb.net) Received: from ux11.ltcm.net (mipam@localhost.ltcm.net [IPv6:::1]) by ux11.ltcm.net (8.12.9/8.12.9/UX11TT) with ESMTP id i7HDdfIo030103 for ; Tue, 17 Aug 2004 15:39:42 +0200 (MEST) Received: from localhost (mipam@localhost) by ux11.ltcm.net (8.12.9/8.12.9/Submit) with ESMTP id i7HDdeq6011400 for ; Tue, 17 Aug 2004 15:39:41 +0200 (MEST) X-Authentication-Warning: ux11.ltcm.net: mipam owned process doing -bs Date: Tue, 17 Aug 2004 15:39:40 +0200 (MEST) From: Mipam X-X-Sender: mipam@ux11.ltcm.net To: freebsd-questions@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: memory usage question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2004 13:39:44 -0000 Hi, I have a question about usage of memory. Despite the well documented articles about it some things are still unclear. In top we see memory devided in several items: Active, inactive, buffered, wired and free. The active memory is clear, it's what is in use by programs now. Wired mem is also clear, it's for the kernel data structs. When a program ends, the mem is put in the inactive part right? So when the program is run 10 minutes after it can be started very quickly, also because the data used from the disk of that program is still in the cache part right? However, suppose the program isnt run in 2 hours, will there be a timeout in the parts which are being put in inactive and in cache? Suppose the timeout has occured, will the mem be added to free mem or? What is the difference between buffered mem and cached mem? Both represent data which is recently being called from the disk, so that next time when the file is called again, no disk access, needs to be made in order to save time right? However, suppose i have little mem free, say 7 mb and still 200 in inactive. Then a program needs to start which needs say 30 mb on mem, will also mem be taken from the inactive part and discard the cache? Some ppl only look at how much free mem is available on their system and then sound the alarm, however, shouldnt they add inactive and free together in order to see how much mem can be used for newly used programs (which didnt run before?). Bye, Mipam.