From owner-freebsd-questions@FreeBSD.ORG Fri Feb 2 23:35:48 2007 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF8F916A402 for ; Fri, 2 Feb 2007 23:35:48 +0000 (UTC) (envelope-from nomadlogic@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.freebsd.org (Postfix) with ESMTP id 772DE13C4A3 for ; Fri, 2 Feb 2007 23:35:46 +0000 (UTC) (envelope-from nomadlogic@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so878328uge for ; Fri, 02 Feb 2007 15:35:45 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uV57bEHnD7pFHhKs1Sg/sK9iIt9DfNUwOjEx9+xs0ec8Hkoq/pXFun3lV0nc0367lmkKgx4obncRE5g+oM2G4BMjDASORlFtCxPpkelhs4t5llBkj6RBrkt+kQmCZRzj2kb8aQbvY8pwMwC7qHLLkJR2olMnnIjMrJspP8bF5Lk= Received: by 10.78.180.18 with SMTP id c18mr864291huf.1170459341468; Fri, 02 Feb 2007 15:35:41 -0800 (PST) Received: by 10.78.195.14 with HTTP; Fri, 2 Feb 2007 15:35:41 -0800 (PST) Message-ID: <57d710000702021535j52da89e5m94cd01e57c1b177a@mail.gmail.com> Date: Fri, 2 Feb 2007 15:35:41 -0800 From: "pete wright" To: "Mark Jayson Alvarez" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: questions@freebsd.org Subject: Re: interpreting "top" output (computing n% cpu usage in actual megahertz) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2007 23:35:49 -0000 On 2/1/07, Mark Jayson Alvarez wrote: > Hi, > > > My goal is to find out how much CPU a program consumes when I execute it. > In the manual, it says I can toggle from "raw cpu" mode to "weighted cpu". > However, I can't still understand the difference between the two and how it > has something to > do with my goal. Suppose my computer has a 1.6Ghz pentium 4 processor. > I want to know how much is already in use or what percent. I also want to > know how much it has increased > when I run a particular program so that I can decide if this I can install > this program without affecting other > existing critical programs. this link should be helpful regarding the cpu utilization: http://students.cs.unipi.gr/pub/docs/sysadmin-1992-1998/html/v07/i05/a7.htm from the article: "On AIX 4 systems, CPU% is computed by dividing the time the process uses the CPU by the elapsed time of the process. For example, if a process was started 60 minutes ago, and has so far used 60 seconds of the CPU, then its CPU% is 1 2/3%. This is sometimes called the "weighted CPU%"." which i believe gives a rough idea of how a weighted cpu average is calculated. hopefully someone more familiar with bsd internals can comment on how we arrive at this value. > The same goes with memory usage.. "Free doesn't > mean that that are all my > memory left that is useable right? > The "Description of Memory" section just says: > Active: number of pages active > Inactive: number of pages inactive > > and so on and so forth without telling what the heck does it mean when a > page is inactive and just what does pages > means.. > > Buf, Free, Wired, Cache... don't know what are these either.. Perhaps I > should consult wiki or google for this. > yea that might be a good place to start. these are fairly common terms used when talking about the state of memory in operating systems. another excellent source is this book: http://www.amazon.com/Design-Implementation-FreeBSD-Operating-System/dp/0201702452 it's an excellent reference for any OS in my opinion, but is obviously very pertinent to FreeBSD. this URL may also be a decent place to start: http://en.wikipedia.org/wiki/Memory_management HTH -pete -- ~~o0OO0o~~ Pete Wright www.nycbug.org NYC's *BSD User Group