From owner-freebsd-questions@FreeBSD.ORG Fri Apr 9 00:59:04 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 9366616A4CF for ; Fri, 9 Apr 2004 00:59:04 -0700 (PDT) Received: from gen129.n001.c02.escapebox.net (gen129.n001.c02.escapebox.net [213.73.91.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0239F43D45 for ; Fri, 9 Apr 2004 00:59:04 -0700 (PDT) (envelope-from gemini@geminix.org) Message-ID: <407657C5.3020506@geminix.org> Date: Fri, 09 Apr 2004 09:59:01 +0200 From: Uwe Doering Organization: Private UNIX Site User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040119 X-Accept-Language: en-us, en MIME-Version: 1.0 Cc: freebsd-questions@freebsd.org References: <004301c41bce$a5a9fb50$0c00a8c0@artem> In-Reply-To: <004301c41bce$a5a9fb50$0c00a8c0@artem> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Received: from gemini by geminix.org with asmtp (TLSv1:AES256-SHA:256) (Exim 3.36 #1) id 1BBqul-000OrV-00; Fri, 09 Apr 2004 09:59:03 +0200 Subject: Re: How to get memory usage for process? 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: Fri, 09 Apr 2004 07:59:04 -0000 Artem Koutchine wrote: > Hi! > > I need to figure out how much memory process really takes. > For example, i am running 100 perl scripts, they are all the > same source and i guess some memory is shared among them > (mostly perl interperter i guess). So, i need to know how much > memory is shared and how much memory is used for each new > running script (including buffers, e.t.c.). What command shoud > do the trick and with what options? In case you have the PROCFS mounted (usually under /proc) you can get a detailed listing of the memory map of a process, together with the relevant flags for the various memory segments that indicate memory sharing etc. Try this: cat /proc//map '' is of course to be replaced by the PID of the process you want to examine. Uwe -- Uwe Doering | EscapeBox - Managed On-Demand UNIX Servers gemini@geminix.org | http://www.escapebox.net