LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-03-2010, 12:36 AM   #1
koshihaku
Member
 
Registered: Aug 2010
Posts: 50

Rep: Reputation: 0
Question how to get the physical memory used by a couple of processes?


I am doing a test to get the memory used by apache`s apache2 processes. I used a script to get VmSize and VmRss from /proc/pid/status, and loop through that to get the sum of VmSize and VmRss of all the apache2 processes.

I found the VmSize (about 4GB) and VmRss (about 3.4GB) are much larger than the physical memory (1GB) when apache server was saturated. It was said because of the multi-counted libiraries size used by many processes simultaneously.

Then , how to get the physical memory used by apache2 processes? Or how to get a more reasonable memory data?
 
Old 09-04-2010, 12:15 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Hi koshihaku,

As i know you are not able to find physical memory used by process you get overall used memory of process.

take a look here it might help you

http://www.linuxquestions.org/questi...y-swap-663109/
 
Old 09-04-2010, 12:37 AM   #3
koshihaku
Member
 
Registered: Aug 2010
Posts: 50

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sem007 View Post
Hi koshihaku,

As i know you are not able to find physical memory used by process you get overall used memory of process.

take a look here it might help you

http://www.linuxquestions.org/questi...y-swap-663109/
Thank you very much!

It was said that there are large scale of virtual memory occupied by some shared libraries. So the VmSize is much larger than the physical memory.

I have got a program written by someone which can get the phisical memory used by a program with some processes.
 
Old 09-04-2010, 12:40 AM   #4
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by koshihaku View Post
I have got a program written by someone which can get the phisical memory used by a program with some processes.
Great!!
I would like to test that one if you share name or link of that program.

Regards,
 
Old 09-04-2010, 12:44 AM   #5
koshihaku
Member
 
Registered: Aug 2010
Posts: 50

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sem007 View Post
Great!!
I would like to test that one if you share name or link of that program.

Regards,
http://www.pixelbeat.org/scripts/ps_mem.py

This is the python script. I have no knowledge of python. I embeded it in a very simple shell script to run it every 30 seconds. I think it is ok .


Is it possible to re-write it in shell?
 
Old 09-16-2010, 08:09 PM   #6
koshihaku
Member
 
Registered: Aug 2010
Posts: 50

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sem007 View Post
Great!!
I would like to test that one if you share name or link of that program.

Regards,
How do you find the script? Does it work well?
 
Old 09-17-2010, 01:44 AM   #7
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by koshihaku View Post
How do you find the script? Does it work well?
Hi koshihaku,

I'm in the middle of a one important task and i did not test that script yet. so little patience i will test it as soon as possible and give comment.

Regards,
 
Old 09-19-2010, 10:03 PM   #8
koshihaku
Member
 
Registered: Aug 2010
Posts: 50

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by sem007 View Post
Hi koshihaku,

I'm in the middle of a one important task and i did not test that script yet. so little patience i will test it as soon as possible and give comment.

Regards,
thanks a lot!
 
  


Reply



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
PCIe dma-able memory location in physical memory for Intel Nehalem / Tylersburg arch robvoo Linux - Kernel 4 07-31-2009 06:21 AM
Physical memory ronlau9 Linux - Hardware 4 04-28-2008 06:41 AM
Physical Memory and Virtual Memory Murdock1979 Linux - General 1 01-28-2008 07:35 AM
Less physical memory? ariek Debian 5 07-21-2005 02:23 PM
get Physical memory in C/C++ Dreampainter Programming 1 10-30-2004 08:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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