From owner-freebsd-questions@FreeBSD.ORG Fri Mar 19 04:53:17 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F631106566C for ; Fri, 19 Mar 2010 04:53:17 +0000 (UTC) (envelope-from corky1951@comcast.net) Received: from qmta06.emeryville.ca.mail.comcast.net (qmta06.emeryville.ca.mail.comcast.net [76.96.30.56]) by mx1.freebsd.org (Postfix) with ESMTP id 069248FC13 for ; Fri, 19 Mar 2010 04:53:16 +0000 (UTC) Received: from omta09.emeryville.ca.mail.comcast.net ([76.96.30.20]) by qmta06.emeryville.ca.mail.comcast.net with comcast id usZZ1d0010S2fkCA6stHTC; Fri, 19 Mar 2010 04:53:17 +0000 Received: from comcast.net ([98.203.142.76]) by omta09.emeryville.ca.mail.comcast.net with comcast id ustF1d00E1f6R9u8VstGAC; Fri, 19 Mar 2010 04:53:17 +0000 Received: by comcast.net (sSMTP sendmail emulation); Thu, 18 Mar 2010 21:53:14 -0700 Date: Thu, 18 Mar 2010 21:53:13 -0700 From: Charlie Kester To: freebsd-questions@freebsd.org Message-ID: <20100319045313.GA29575@comcast.net> Mail-Followup-To: freebsd-questions@freebsd.org References: <4cac4bed1003181028h74aff209y31e9c70bfb6ec367@mail.gmail.com> <4BA2D398.6000104@stormy.smart-serv.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <4BA2D398.6000104@stormy.smart-serv.net> X-Mailer: Mutt 1.5.20 X-Composer: VIM 7.2 User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: API to find the memory usage of a process. 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, 19 Mar 2010 04:53:17 -0000 On Thu 18 Mar 2010 at 18:30:00 PDT J. Johnston wrote: >On 03/18/10 10:28, Jayadev Kumar wrote: >>Hi, >> >> I need to find the memory usage of a process, from inside the process. >>Is there any system call >>do this ? I was trying to find it from 'top' utility source code. I couldn't >>find the port which it is coming >>from yet. >> >>Thanks, >>Jayadev. > >the source for top is located in /usr/src/usr.bin/top whereis -sq foo will get you the source directory for foo, assuming you installed the system sources, or if "foo" is also the name of the port. If foo was installed by a port with some other name, you can find it with pkg_info -W foo