LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-06-2008, 05:44 AM   #1
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Rep: Reputation: 30
free -m command displays less RAM size


hi
my RAM size is 512MB but the command free -m shows 494

Code:
[babu@localhost ~]$ free -m
             total       used       free     shared    buffers     cached
Mem:           494        382        112          0          9        104
-/+ buffers/cache:        267        226
Swap:          991          1        990
Is it the right command.
 
Old 05-06-2008, 01:23 PM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
Well, AFAIK, some of the RAM is reserved by BIOS and other things, and cannot be used by the OS. That could explain it. And on many laptops the memory is shared with graphics card, for example here on my laptop with 1 GB RAM I get:

Code:
             total       used       free     shared    buffers     cached
Mem:          1009        517        492          0          0        276
-/+ buffers/cache:        240        768
Swap:         1921          0       1921
 
Old 05-06-2008, 03:15 PM   #3
viron
Member
 
Registered: Dec 2005
Location: McKinney, Texas
Distribution: Slackware
Posts: 40

Rep: Reputation: 15
Quote:
Originally Posted by babu198649 View Post
hi
my RAM size is 512MB but the command free -m shows 494

Code:
[babu@localhost ~]$ free -m
             total       used       free     shared    buffers     cached
Mem:           494        382        112          0          9        104
-/+ buffers/cache:        267        226
Swap:          991          1        990
Is it the right command.


It all has to do with how one defines a kilo...1000 or 1024 (1024 is the correct binary measurement). If you take the total mem from the free command (no -m switch) and divide that by 1024, you'll come up with 494. However...if you take that same total and divide it by 1000 (metric), you'll come up with the amount you're looking for. =)
 
Old 05-07-2008, 01:11 PM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
Quote:
Originally Posted by viron View Post
It all has to do with how one defines a kilo...1000 or 1024 (1024 is the correct binary measurement). If you take the total mem from the free command (no -m switch) and divide that by 1024, you'll come up with 494. However...if you take that same total and divide it by 1000 (metric), you'll come up with the amount you're looking for. =)
Are you sure ? Thought that was only true for HDDs. For example take my case:

1058439168 bytes reported by 'free -b', divide that by 1000000 and you get 1058, which is too much. When I run just 'free' I get 1033632 ko, divide that by 1000 and you get 1033, still too much.
 
Old 05-08-2008, 03:45 AM   #5
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
Thanks for replys

Quote:
It all has to do with how one defines a kilo...1000 or 1024 (1024 is the correct binary measurement). If you take the total mem from the free command (no -m switch) and divide that by 1024, you'll come up with 494. However...if you take that same total and divide it by 1000 (metric), you'll come up with the amount you're looking for. =)

[bala@localhost ~]$ free
total used free shared buffers cached
Mem: 506436 492432 14004 0 16048 222372
-/+ buffers/cache: 254012 252424
Swap: 1015800 0 1015800


506436/1000 = 506.436 which is != 512 as expected.



Quote:
Well, AFAIK, some of the RAM is reserved by BIOS and other things, and cannot be used by the OS.
how to find how much memory has been used by BIOS.
 
Old 05-08-2008, 07:13 AM   #6
premnarayan
LQ Newbie
 
Registered: Jan 2008
Location: noida
Distribution: archlinux, slackware
Posts: 21

Rep: Reputation: 15
Your RAM has 506436 kB = 506436/1024 MB = 494.5 MB. That's what free -m says.
 
Old 05-08-2008, 12:51 PM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
Quote:
Originally Posted by babu198649 View Post
how to find how much memory has been used by BIOS.
run:

Code:
cat /proc/iomem
 
  


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
Linux/Unix Command to find RAM size? ssnkumar Linux - General 9 09-09-2009 09:38 AM
Refreshing RAM -- software or command? Trying to free up memory hyphae Slackware 26 03-10-2007 05:11 AM
ps command displays multiple processes mghiya Linux - Software 0 07-28-2006 04:28 AM
/proc/kcore size doesn't match with physical ram size cash_05 Linux - Newbie 2 06-01-2005 01:23 PM
Why should you give the size of the swap disk as twice the size of RAM vmniza Linux - Newbie 3 09-17-2004 02:13 AM


All times are GMT -5. The time now is 07:58 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration