-   Linux - Software (
-   -   Memory Used by a process in Linux (

kishore_mca 05-23-2006 03:39 AM

Memory Used by a process in Linux
How to find the memory utilized by a parent process in Linux?

If there is 1 main process and 3 child processes for that, I want to know how much memory is being used in total by the 1 parent and 3 child processes. I know only PPID.

We are using Redhat AS 2.1. In our application, one Java process is creating 100s of threads. I want to know the total amount of memory is being used by that process.

Thanks in advance,

spirit receiver 05-23-2006 04:48 AM

How about the following?

(size=0; count=0; for i in $(ps --no-headers --pid=PPID --ppid=PPID -o rss); do (( size += i, count++ )); done; echo "$size KB in $count processes.")

All times are GMT -5. The time now is 05:32 AM.