Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Apr 2004 09:59:01 +0200
From:      Uwe Doering <gemini@geminix.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to get memory usage for process?
Message-ID:  <407657C5.3020506@geminix.org>
In-Reply-To: <004301c41bce$a5a9fb50$0c00a8c0@artem>
References:  <004301c41bce$a5a9fb50$0c00a8c0@artem>

next in thread | previous in thread | raw e-mail | index | archive | help
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/<pid>/map

'<pid>' 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?407657C5.3020506>