Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-23-2006, 04:39 AM   #1
LQ Newbie
Registered: May 2006
Posts: 1

Rep: Reputation: 0
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,
Old 05-23-2006, 05:48 AM   #2
spirit receiver
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
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.")


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to list the process using most memory adoyee Linux - Newbie 3 09-06-2012 04:11 AM
Process cannot get more memory kutta_kamina Programming 3 12-08-2005 02:41 PM
process memory ecampos02 Linux - Newbie 5 11-18-2005 05:42 PM
Help Configuring the Memory Used by a Process in RedHat? (Cache Memory on CPU) geogecko Linux - General 3 02-23-2005 04:32 PM
Maximum Memory PER PROCESS anewsome Linux - General 1 03-08-2004 03:29 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration