LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-07-2010, 06:22 AM   #1
rbeserie
LQ Newbie
 
Registered: May 2010
Posts: 24

Rep: Reputation: 0
Where is my memory gone ? ;-)


Hey every one.

I got a computer working ... not bad hein? it has 2GB Ram. so far so good.

"free -m" reports a little more then 250 free memory.

Quote:

$> free -m
total used free shared buffers cached
Mem: 2028 1767 260 0 309 906
-/+ buffers/cache: 551 1476
Swap: 1906 0 1906
on the other hand, "ps -A u" gives me the list of all the runing processes and the memory each one uses.


Quote:

$> ps -A u
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1848 592 ? Ss 2009 1:04 init [2]
nagios 9279 0.0 0.5 40228 10552 ? Sl 2009 180:08 /usr/bin/perl -w /opt/centreon/ODS/ods
root 1611 0.0 0.0 3696 992 ? Ss Apr08 0:04 /usr/sbin/cron
root 10904 0.0 0.0 5416 1020 ? Ss Apr08 0:00 /usr/sbin/sshd
bind 13912 0.0 0.9 59940 18808 ? Ssl Apr08 0:48 /usr/sbin/named -u bind
snmp 14272 0.0 0.2 10620 4224 ? S Apr08 0:02 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1
root 16127 0.0 0.0 4132 1276 ? S Apr08 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 16164 0.0 4.5 231696 95392 ? Sl Apr08 28:42 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/my
root 16165 0.0 0.0 3252 612 ? S Apr08 0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
nagios 17834 0.0 0.0 2184 660 ? Ss Apr09 0:15 /usr/sbin/nsca --daemon -c /etc/nsca.cfg
root 14289 0.0 0.4 27488 9924 ? Ss Apr20 0:01 /usr/sbin/apache2 -k start
nagios 3046 0.0 0.0 2184 444 ? SL Apr21 0:00 /usr/sbin/nsca --daemon -c /etc/nsca.cfg
nagios 1875 0.1 0.1 15896 2096 ? SNsl May06 1:59 /usr/sbin/nagios3 -d /etc/nagios3/nagios.cfg
www-data 14615 0.1 0.4 27856 9472 ? S May06 1:23 /usr/sbin/apache2 -k start
www-data 24801 0.1 0.4 27864 9524 ? S 06:30 0:40 /usr/sbin/apache2 -k start
www-data 29563 0.1 0.7 34720 16584 ? S 06:45 0:41 /usr/sbin/apache2 -k start
www-data 1052 0.1 0.5 29408 11704 ? S 07:00 0:39 /usr/sbin/apache2 -k start
www-data 9969 0.2 0.4 27876 9472 ? S 07:30 0:42 /usr/sbin/apache2 -k start
www-data 18629 0.1 0.4 27856 9444 ? S 07:59 0:33 /usr/sbin/apache2 -k start
www-data 23724 0.2 0.4 27864 9452 ? S 08:15 0:32 /usr/sbin/apache2 -k start
www-data 27649 0.2 0.6 30140 12524 ? S 08:29 0:36 /usr/sbin/apache2 -k start
www-data 3974 0.2 0.4 28660 10244 ? S 08:59 0:29 /usr/sbin/apache2 -k start
www-data 8981 0.2 0.4 28644 10180 ? S 09:15 0:29 /usr/sbin/apache2 -k start
www-data 12850 0.2 0.4 28644 10144 ? S 09:29 0:28 /usr/sbin/apache2 -k start
www-data 26554 0.2 0.4 27876 9304 ? S 10:14 0:21 /usr/sbin/apache2 -k start
www-data 26594 0.2 0.5 30592 12284 ? S 10:15 0:20 /usr/sbin/apache2 -k start
root 3323 0.0 0.1 8112 2468 ? Ss 10:46 0:00 sshd: root@pts/0
root 3428 0.0 0.0 4500 1740 pts/0 Ss 10:47 0:00 -bash
www-data 7038 0.1 0.4 27856 9244 ? S 11:00 0:11 /usr/sbin/apache2 -k start
www-data 15808 0.1 0.4 28132 9456 ? S 11:29 0:07 /usr/sbin/apache2 -k start
www-data 15921 0.2 0.4 28644 9988 ? S 11:30 0:09 /usr/sbin/apache2 -k start
www-data 20768 0.2 0.4 27856 9052 ? S 11:45 0:08 /usr/sbin/apache2 -k start
www-data 24779 0.2 0.4 28644 9868 ? S 12:00 0:06 /usr/sbin/apache2 -k start
www-data 1102 0.1 0.3 27824 8280 ? S 12:29 0:01 /usr/sbin/apache2 -k start
www-data 1223 0.1 0.4 28584 9592 ? S 12:30 0:01 /usr/sbin/apache2 -k start
root 5930 0.0 0.0 3956 1032 pts/0 R+ 12:44 0:00 ps -A u


if i sum it all up I get a big 16% mem usage...
if my math is all right, 16% of 2048 is 327.
so the free mem should be : 2048 - 327 and that is : 1697MB...

nothing close to what "free" reports. so where is the rest ?

Thanks to any one having an idea to put me back on the trail of my lost memories... ;-)
 
Old 05-07-2010, 08:07 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
www.linuxatemyram.com
 
1 members found this post helpful.
Old 05-07-2010, 08:33 AM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by rbeserie View Post
"ps -A u" gives me the list of all
Please use CODE tags instead of QUOTE tags for things like that. It makes a big difference in readability.

Quote:
Originally Posted by AlucardZero View Post
Cute picture at the top, and a good newbie level answer to the question.

Quote:
Originally Posted by rbeserie View Post
if i sum it all up I get a big 16% mem usage...
if my math is all right, 16% of 2048 is 327.
so the free mem should be : 2048 - 327 and that is : 1697MB.
Adding up the %MEM column and multiplying by total memory, is just an inaccurate way (accumulates rounding errors) of totaling the RSS column.

The total of RSS is itself a fairly bad estimate of the total memory used by all those processes (a better estimate that you get from %MEM, but still fairly bad).

So far as I know, there isn't a better estimate of that total, other than getting it from the other side (which defeats the purpose of comparing it to the other side): From the total subtract kernel memory use, cache, buffers, and free. I think the result would be the true value of what you might expect the total of RSS to represent.

Last edited by johnsfine; 05-07-2010 at 08:54 AM.
 
Old 02-09-2011, 08:31 AM   #4
drsketch1
Member
 
Registered: Apr 2006
Distribution: CentOS 6.X, pclinuxos
Posts: 50

Rep: Reputation: 15
Linux uses ram b4 swap, which is how it should be done. Windows is finally doing this.
 
0 members found this post helpful.
  


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
Two USB memory devies (stick memory/jump drive) one works one not Mark_in_Hollywood Linux - Hardware 5 05-20-2008 07:35 PM
LXer: This week at LWN: Memory part 7: Memory performance tools LXer Syndicated Linux News 0 11-22-2007 08:51 AM
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 04:05 AM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 04:48 PM
RH 8.0 Mapping Virtual Memory to get access to VMIC Reflective Memory PCI card. Merlin53 Linux - Hardware 0 05-05-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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