API to find the memory usage of a process.

Charlie Kester corky1951 at comcast.net
Fri Mar 19 04:53:17 UTC 2010


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



More information about the freebsd-questions mailing list