On (24/01/10 18:35), pmarin wrote:
> Date: Sun, 24 Jan 2010 18:35:31 +0100
> From: pmarin <pacog...@gmail.com>
> To: dev@suckless.org
> Subject: [dev] [OFFTOPIC] How to know the size of a process?
> List-Id: dev mail list <dev.suckless.org>
> 
> Hi all.
> Anyone know how to know the size (kb) of a process in Linux?
> using the proc filesystem I can know the number of pages that it uses
> (/proc/pid/statm). How I can convert
> it to kb? Any posix way?
> 
> pmarin
> 

You can get size of page very easily, man sysconf and search for
PAGESIZE. Btw, There's one issue with trying to get size of process --
shared memory. To which process should it count? And how? Or count only
fraction for each of process using that shared memory ... Not easy. :-)

-Ph

-- 
Premysl "Anydot" Hruby, https://www.redrum.cz/
-
I'm a signature virus. Please add me to your signature and help me spread!

Reply via email to