LinuxQuestions.org
Review your favorite Linux distribution.
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 11-20-2008, 07:58 PM   #1
landysaccount
Member
 
Registered: Sep 2008
Location: Dominican Republic
Distribution: Debian
Posts: 188

Rep: Reputation: 18
Question RAM used by process


Good evening.

I would like to know how much memory a process is utilizing. I have a system with 1G RAM when it boots up and all the processes or daemons or applications are running free -m tells me that there is aprox. 500M free. But, after a couple of days continuously running it drops down to about 8M. How do I find out which program is eating all that memory? I run top but can't really tell how much exactly each process is consuming. I know squid uses a lot of memory but, damn!


top - 20:56:21 up 3 days, 3:28, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 42 total, 2 running, 40 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 906792k total, 897712k used, 9080k free, 27104k buffers
Swap: 979924k total, 44k used, 979880k free, 786492k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7115 proxy 15 0 36048 31m 2276 S 0.0 3.6 0:07.77 squid3
1995 root 18 0 17184 5884 3448 S 0.0 0.6 0:00.01 apache2
2011 www-data 15 0 17316 4700 2184 S 0.0 0.5 0:00.00 apache2
2475 www-data 15 0 17316 4668 2160 S 0.0 0.5 0:00.00 apache2
5289 www-data 15 0 17316 4668 2160 S 0.0 0.5 0:00.00 apache2
2012 www-data 15 0 17316 4664 2156 S 0.0 0.5 0:00.00 apache2
2013 www-data 15 0 17316 4664 2156 S 0.0 0.5 0:00.00 apache2
2015 www-data 15 0 17316 4660 2156 S 0.0 0.5 0:00.00 apache2
6183 www-data 15 0 17316 4656 2152 S 0.0 0.5 0:00.01 apache2
2014 www-data 18 0 17316 4640 2140 S 0.0 0.5 0:00.00 apache2
7127 root 15 0 7864 2396 1920 R 0.0 0.3 0:00.07 sshd
7129 root 15 0 4008 1724 1320 S 0.0 0.2 0:00.16 bash
1962 root 15 0 5900 1408 556 S 0.0 0.2 0:00.00 squid3
1949 ntp 15 0 4128 1328 1020 S 0.0 0.1 0:00.12 ntpd
7182 root 15 0 2232 1112 860 R 0.0 0.1 0:00.00 top
1934 root 15 0 4932 1096 756 S 0.0 0.1 0:00.14 sshd
7116 proxy 18 0 2824 924 784 S 0.0 0.1 0:00.03 unlinkd
1979 root 18 0 2196 872 684 S 0.0 0.1 0:00.04 cron
1 root 15 0 1944 648 552 S 0.0 0.1 0:00.83 init
1893 root 18 0 1624 636 512 S 0.0 0.1 0:00.29 syslogd
1076 root 20 -4 2180 596 340 S 0.0 0.1 0:00.08 udevd
1913 root 18 0 1752 576 480 S 0.0 0.1 0:00.00 inetd
2168 root 18 0 1576 496 424 S 0.0 0.1 0:00.00 getty
2169 root 18 0 1576 496 424 S 0.0 0.1 0:00.00 getty
2175 root 18 0 1576 496 424 S 0.0 0.1 0:00.00 getty
2167 root 15 0 1572 492 424 S 0.0 0.1 0:00.00 getty
2176 root 18 0 1572 492 424 S 0.0 0.1 0:00.00 getty
2170 root 18 0 1572 488 424 S 0.0 0.1 0:00.00 getty
1899 root 15 0 1576 380 308 S 0.0 0.0 0:00.00 klogd
2 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
3 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/0
4 root 16 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
8 root 20 -5 0 0 0 S 0.0 0.0 0:00.03 kblockd/0
25 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
92 root 25 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
93 root 15 0 0 0 0 S 0.0 0.0 0:00.24 pdflush
94 root 17 -5 0 0 0 S 0.0 0.0 0:03.12 kswapd0
95 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
536 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
1404 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
1643 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kmirrord
 
Old 11-20-2008, 08:07 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,842

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
Seems you're not understanding what you're reading. Have a look at this thread, and re-post if you still have questions.

Edit: link in the referenced thread has a bad link - seems the gentoo wiki has been lost. Here is a copy of the article.

Last edited by syg00; 11-20-2008 at 08:21 PM.
 
Old 11-20-2008, 08:25 PM   #3
landysaccount
Member
 
Registered: Sep 2008
Location: Dominican Republic
Distribution: Debian
Posts: 188

Original Poster
Rep: Reputation: 18
Thank you for your quick reply.

After reading that post I have a better understanding of how programs utilize RAM. Thank you for clarifying.

After running that script of yours I get: Memory usage: 93 of 885 MegaBytes

Thank you again.
 
Old 11-27-2008, 07:51 AM   #4
korexmohan
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Rep: Reputation: 0
Squid performance slow down after blocking sites

Hi pals,
To block the porn sites downloaded the list of porn sites from net and linked the file to my squid.conf for blocking thru acl. After making this change my system works fine for 20 mins after that the mem usage become 904MB out of availabel 1 GB and the system become very slow. I am even not able to type something in terminal window.
When i remove this line from squid.conf it works fine again.
Please help...Any changes need to be done in Squid.conf???
The blocked site file size is 6MB and contains some 1,71,252 sites listed in this file.
 
  


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
how to check ram usage by process christopher_c Linux - Newbie 3 04-30-2008 03:58 PM
IPP process eats too much RAM bruno321 Linux - Newbie 2 09-21-2007 10:43 PM
child process usses same amount of ram as parent process socialjazz Programming 7 10-19-2006 06:48 PM
ram, cpu and process quotas Mig21 Linux - Security 3 07-25-2005 04:12 AM
process to use more than 2GB RAM simplyrahul Linux - General 12 10-27-2004 09:17 PM


All times are GMT -5. The time now is 02:44 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