LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 02-03-2005, 06:11 PM   #1
hegedus
LQ Newbie
 
Registered: Feb 2005
Posts: 16

Rep: Reputation: 0
Angry memory usage problem


Hi,

I am using RedHat Enterprise on Dell Precision workstation.
Linux 2.4.21-20.ELsmp #1 SMP Wed Aug 18 20:46:40 EDT 2004 i686 i686 i386 GNU/Linux

My shmmin and max is set to 64MB.

After starting the system the used memory is below 200MB from the 1GB.
Later on my programs consumes my memory close to complete.
Even if I exit all the running programs (only X (gnome) is running) the memory usage do not decrease.

I could not figure out wich is this program, why does it happen. I try to do this with 'top' and grafical system tool.

Thanks for your help in advance,
Tamas
 
Old 02-03-2005, 06:28 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
That is a result of the way Linux does memory cleanup. In short, it doesn't actually go through the process of freeing space unless it needs to (because it is a waste of time).

So long as you always have a little bit of free physical memory your system is just fine. Rest assured most of the memory isn't really in use. If you notice your machine starts to use a lot of swap (which it should hardly ever use with that much ram unless you are running quite a lot of memory intensive software) then start worrying about it.
 
Old 02-03-2005, 06:35 PM   #3
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Just to add to that, I'll give you a case and point.

Here are the processes running on one of my servers:

Code:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   1484   504 ?        S    Jan24   0:00 init [3]  
root         2  0.0  0.0      0     0 ?        SN   Jan24   0:01 [ksoftirqd/0]
root         3  0.0  0.0      0     0 ?        S<   Jan24   0:00 [events/0]
root         4  0.0  0.0      0     0 ?        S<   Jan24   0:00 [khelper]
root        16  0.0  0.0      0     0 ?        S<   Jan24   0:02 [kblockd/0]
root        29  0.0  0.0      0     0 ?        S    Jan24   0:00 [khubd]
root       114  0.0  0.0      0     0 ?        S<   Jan24   0:00 [aio/0]
root       113  0.0  0.0      0     0 ?        S    Jan24   0:30 [kswapd0]
root       706  0.0  0.0      0     0 ?        S    Jan24   0:00 [kseriod]
root       768  0.0  0.0      0     0 ?        S<   Jan24   0:02 [reiserfs/0]
root     23485  0.0  0.0   1492   376 ?        S<s  Jan24   0:00 udevd
root     10450  0.0  0.1   1856   788 ?        Ss   Jan24   0:49 /usr/sbin/syslog-ng
root     25631  0.0  0.2   2352  1124 ?        Ss   Jan24   0:00 /bin/sh /usr/bin/mysqld_safe
mysql     8868  0.0  1.2  38376  6332 ?        S    Jan24   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.
root      3482  0.0  0.2   3404  1488 ?        Ss   Jan24   0:00 /usr/sbin/sshd
mysql    20890  0.0  1.2  38376  6332 ?        S    Jan24   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.
mysql    13339  0.0  1.2  38376  6332 ?        S    Jan24   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.
mysql     6267  0.0  1.2  38376  6332 ?        S    Jan24   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.
root      2774  0.0  1.5  19244  7788 ?        Ss   Jan24   0:00 /usr/sbin/apache2 -k start -D PHP4 -D SSL
root      7917  0.0  1.3   9280  6908 ?        Ss   Jan24   0:03 /usr/sbin/clamd
root     13981  0.0  0.1   1808   600 ?        S    Jan24   0:00 /usr/sbin/crond
apache   17128  0.0  1.2  18532  6352 ?        S    Jan24   0:00 /usr/sbin/apache2 -k start -D PHP4 -D SSL
mailman   9472  0.0  1.0   7708  5396 ?        Ss   Jan24   0:00 /usr/bin/python bin/mailmanctl -s start
ntp      28009  0.0  0.8   4196  4196 ?        SLs  Jan24   0:00 /usr/bin/ntpd -p /var/run/ntpd.pid -u ntp:ntp
root     16732  0.0  1.3   9280  6908 ?        S    Jan24   0:00 /usr/sbin/clamd
stunnel  16156  0.0  0.3   3608  1824 ?        Ss   Jan24   0:00 /usr/sbin/stunnel /etc/stunnel/stunnel.conf
root      6429  0.0  0.1   2144   904 ?        Ss   Jan24   0:00 /usr/sbin/xinetd -pidfile /var/run/xinetd.pid -stayalive -reuse
root      4575  0.0  0.1   1584   656 tty1     Ss+  Jan24   0:00 /sbin/agetty 38400 tty1 linux
root     31622  0.0  0.1   1620   656 tty2     Ss+  Jan24   0:00 /sbin/agetty 38400 tty2 linux
root      2796  0.0  0.1   1628   656 tty3     Ss+  Jan24   0:00 /sbin/agetty 38400 tty3 linux
root     24430  0.0  0.1   1596   656 tty4     Ss+  Jan24   0:00 /sbin/agetty 38400 tty4 linux
root     30146  0.0  0.1   1608   660 tty5     Ss+  Jan24   0:00 /sbin/agetty 38400 tty5 linux
root     18102  0.0  0.1   1580   652 tty6     Ss+  Jan24   0:00 /sbin/agetty 38400 tty6 linux
root     23625  0.0  0.0      0     0 ?        S    Jan25   0:00 [pdflush]
root     16194  0.0  0.0      0     0 ?        S    Jan25   0:25 [pdflush]
root     30591  0.0  0.3   6916  2060 ?        Ss   Jan26   1:53 /usr/sbin/smbd -D
root      5967  0.0  0.3   6916  2044 ?        S    Jan26   0:00 /usr/sbin/smbd -D
root      8073  0.0  0.2   3628  1432 ?        Ss   Jan26   1:05 /usr/sbin/nmbd -D
apache    4572  0.0  2.4  25196 12876 ?        S    Jan26   3:07 /usr/sbin/apache2 -k start -D PHP4 -D SSL
stunnel  12569  0.0  0.3   3608  1824 ?        S    Jan27   0:00 /usr/sbin/stunnel /etc/stunnel/stunnel.conf
root      5331  0.0  0.0   1516   320 ?        S    Jan27   0:00 /usr/bin/svscan /service
root     30106  0.0  0.0   1372   288 ?        S    Jan27   0:00 supervise qmail-smtpd
qmaild    5027  0.0  0.1   2800   808 ?        S    Jan27   0:02 /usr/bin/tcpserver -p -v -R -x /etc/tcp.smtp.cdb -c 40 -u 201 -g 200 0.0.0.0 smtp /var/qmail/bin/qmail-s
root     10855  0.0  0.0   1324   288 ?        S    Jan27   0:00 supervise log
qmaill    1429  0.0  0.0   1484   352 ?        S    Jan27   0:02 /usr/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd
root     27550  0.0  0.0   1352   288 ?        S    Jan27   0:00 supervise qmail-send
qmails   10786  0.0  0.0   1524   444 ?        S    Jan27   2:42 qmail-send
root     30759  0.0  0.0   1336   288 ?        S    Jan27   0:00 supervise log
root      7787  0.0  0.0   1500   332 ?        S    Jan27   0:02 qmail-lspawn ./.maildir/
qmailr   24729  0.0  0.0   1484   344 ?        S    Jan27   0:01 qmail-rspawn
qmailq   24057  0.0  0.0   1460   324 ?        S    Jan27   0:06 qmail-clean
qmaill    2900  0.0  0.0   1500   352 ?        S    Jan27   0:02 /usr/bin/multilog t s2500000 /var/log/qmail/qmail-send
root     17754  0.0  0.3   4860  1724 ?        Ss   Jan27   0:00 /usr/sbin/cupsd
clamav    2009  0.0  0.2   4240  1292 ?        Ss   Jan27   0:00 /usr/bin/freshclam -d -c 2 -l /var/log/clam-update.log
mailman  15721  0.0  1.0   7436  5240 ?        S    Jan27   0:00 /usr/bin/python /usr/local/mailman/bin/qrunner --runner=CommandRunner:0:1 -s
mailman   3774  0.0  1.0   7552  5268 ?        S    Jan27   0:00 /usr/bin/python /usr/local/mailman/bin/qrunner --runner=NewsRunner:0:1 -s
mailman  15127  0.0  1.0   7556  5248 ?        S    Jan27   0:00 /usr/bin/python /usr/local/mailman/bin/qrunner --runner=BounceRunner:0:1 -s
mailman  13962  0.0  1.2   8492  6400 ?        S    Jan27   0:15 /usr/bin/python /usr/local/mailman/bin/qrunner --runner=IncomingRunner:0:1 -s
mailman  18675  0.0  1.0   7488  5228 ?        S    Jan27   0:00 /usr/bin/python /usr/local/mailman/bin/qrunner --runner=RetryRunner:0:1 -s
mailman    471  0.0  1.3   8920  6740 ?        S    Jan27   1:11 /usr/bin/python /usr/local/mailman/bin/qrunner --runner=ArchRunner:0:1 -s
mailman  30335  0.0  1.2   8556  6384 ?        S    Jan27   0:13 /usr/bin/python /usr/local/mailman/bin/qrunner --runner=OutgoingRunner:0:1 -s
mailman   3542  0.0  1.1   8048  5784 ?        S    Jan27   0:02 /usr/bin/python /usr/local/mailman/bin/qrunner --runner=VirginRunner:0:1 -s
apache    5909  0.0  2.5  25208 12880 ?        S    Jan28   2:00 /usr/sbin/apache2 -k start -D PHP4 -D SSL
apache   19976  0.0  2.5  25632 13264 ?        S    Jan29   1:39 /usr/sbin/apache2 -k start -D PHP4 -D SSL
apache   25049  0.0  2.5  25608 13252 ?        S    Jan29   1:28 /usr/sbin/apache2 -k start -D PHP4 -D SSL
apache    9043  0.0  2.3  24560 12196 ?        S    Jan29   1:15 /usr/sbin/apache2 -k start -D PHP4 -D SSL
apache    6731  0.0  2.5  25256 12908 ?        S    Jan29   1:28 /usr/sbin/apache2 -k start -D PHP4 -D SSL
apache   15661  0.0  2.4  25180 12828 ?        S    Jan30   1:18 /usr/sbin/apache2 -k start -D PHP4 -D SSL
apache    6700  0.0  2.4  25100 12728 ?        S    Jan30   1:03 /usr/sbin/apache2 -k start -D PHP4 -D SSL
apache   17939  0.0  2.5  25636 13272 ?        S    Jan30   1:13 /usr/sbin/apache2 -k start -D PHP4 -D SSL
root      6554  0.0  4.3  24292 22228 ?        Ss   Jan30   0:02 /usr/sbin/spamd -d -r /var/run/spamd.pid -m 5 -c -H
apache    9457  0.0  2.3  24340 11904 ?        S    Feb02   0:15 /usr/sbin/apache2 -k start -D PHP4 -D SSL
root      8749  0.0  4.7  26636 24620 ?        S    15:05   0:09 spamd child
root      8544  0.0  4.6  26092 24028 ?        S    15:13   0:07 spamd child
root     27161  0.0  4.5  25224 23240 ?        S    15:15   0:05 spamd child
root      1638  0.0  4.6  25860 23836 ?        S    15:26   0:06 spamd child
root     31697  0.0  4.5  25556 23524 ?        S    15:37   0:06 spamd child
root     14113  0.0  0.3   6052  1828 ?        Ss   18:44   0:00 sshd: jshaw [priv]
jshaw    12133  0.0  0.3   6384  2016 ?        S    18:44   0:00 sshd: jshaw@pts/0
jshaw    13871  0.0  0.2   2648  1296 pts/0    Ss   18:44   0:00 -bash
root     12654  0.0  0.1   2172   980 pts/0    S    18:44   0:00 su -
root      1271  0.0  0.2   2348  1336 pts/0    S    18:45   0:00 -bash
root       696  0.0  0.1   2432   832 pts/0    R+   19:29   0:00 ps aux
Now, if you add up the memory fields there then you'll get a % of the memory in use. However, according to top I only have 12MB of my 512MB of RAM free and I'm using 0k of my swap.
 
Old 02-04-2005, 09:16 AM   #4
hegedus
LQ Newbie
 
Registered: Feb 2005
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks! I did not know how it is work.
My swap is OK.
Regards
 
Old 03-04-2005, 06:10 AM   #5
ERBRMN
Member
 
Registered: Mar 2005
Location: Japan
Distribution: TurboLinux, RHEL, SUSE
Posts: 96

Rep: Reputation: 15
HOW TO CLEAN MEMORY and SWAP

I seems My Linux server is memory is full, so how could I clean memory. Also swap disk is full.
Big problem is it is very very slow when i do something on my server.

WHAT CAN I DO? Please help me.

I have attached image current process , current memory and disk space and running process, ...

http://www.geocities.com/erbrmn/CleanMemory.jpg
 
Old 03-04-2005, 07:00 AM   #6
ERBRMN
Member
 
Registered: Mar 2005
Location: Japan
Distribution: TurboLinux, RHEL, SUSE
Posts: 96

Rep: Reputation: 15
HOW TO CLEAN MEMORY and SWAP

I seems My Linux server is memory is full, so how could I clean memory. Also swap disk is full.
Big problem is it is very very slow when i do something on my server.

WHAT CAN I DO? Please help me.

I have attached image current process , current memory and disk space and running process, ...

http://www.geocities.com/erbrmn/CleanMemory.jpg
 
  


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
Memory Usage novice26 SUSE / openSUSE 2 03-31-2005 04:28 AM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM
memory usage problem vcheah Linux - Hardware 1 12-05-2002 01:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 11:53 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
Open Source Consulting | Domain Registration