LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 01: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, 01:15 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
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, 01: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, 01:40 AM   #4
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
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, 01: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, 09: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, 02:44 AM   #7
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
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, 11: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


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


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration