Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: memory question
PostPosted: Wed Jan 19, 2011 12:25 pm 
Offline
Senior Member
User avatar

Joined: Tue Mar 17, 2009 5:11 am
Posts: 129
Location: UK
Hi all,

I'm a little confused - I have a Linode 512 and running free -m shows I've only got 498MB:

Code:
[root@li190-223 ~]# free -m
             total       used       free     shared    buffers     cached
Mem:           498         40        458          0          1         22
-/+ buffers/cache:         17        481
Swap:          255          0        255
[root@li190-223 ~]#


However I also have a 512 Burstnet VPS and running the same command gives 512MB:
Code:
linvak:~# free -m
             total       used       free     shared    buffers     cached
Mem:           512         23        489          0          0          0
-/+ buffers/cache:         23        489
Swap:            0          0          0
linvak:~#


Any ideas please?


Top
   
 Post subject:
PostPosted: Wed Jan 19, 2011 12:29 pm 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 569
Website: http://www.mattnordhoff.com/
Shrug. The kernel reserves some memory for itself. Depending on your kernel, it may or may not be subtracted from the total "free -m" lists. Don't worry about it, unless it's like 200 MB or something. :P

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
 Post subject:
PostPosted: Wed Jan 19, 2011 12:39 pm 
Offline
Senior Member
User avatar

Joined: Tue Mar 17, 2009 5:11 am
Posts: 129
Location: UK
Okies thanks for the help.

I thought that the first field in free should display the total physical memory in the machine irrespective of kernel usage.

Guess I'm wrong :wink:


Top
   
 Post subject:
PostPosted: Wed Jan 19, 2011 2:46 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
It depends on the kernel. Kernels marked as "Stable" show the full 512MB. Kernels marked as "Paravirt" (which is required for newer distributions such as Ubuntu 10.04) tend to show a little less.


Top
   
 Post subject:
PostPosted: Wed Jan 19, 2011 7:37 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
And distribution kernels show more!


total used free shared buffers cached
Mem: 527 511 16 0 8 299
-/+ buffers/cache: 203 323
Swap: 255 81 174

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed Jan 19, 2011 8:10 pm 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 569
Website: http://www.mattnordhoff.com/
Mr Nod wrote:
I thought that the first field in free should display the total physical memory in the machine irrespective of kernel usage.

Guess I'm wrong :wink:

Well it probably should, but that doesn't mean it does, and it's not a serious issue.

obs wrote:
And distribution kernels show more!

I bet it's erroneously adding the freed initrd memory to the total.

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
 Post subject:
PostPosted: Wed Jan 19, 2011 10:05 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
The kernel will show its math during boot:

Code:
$ ssh framboise dmesg | grep ^Memory:
Memory: 509956k/524288k available (5104k kernel code, 13672k reserved, 1584k data, 396k init, 0k highmem)


Those numbers don't exactly add up, but 509956 kB + 13672 kB comes up 660 kB short, and.... well, that's close enough to 640 kB that it ought to be close enough for anybody. Other messages spat by the kernel will provide a more detailed, and significantly more confusing, accounting.

Why the difference? Sometime between 2.6.18 ("Latest 2.6 Stable") and a few years back, the formula changed. Dunno where, who, or why, but it's probably more accurate now.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Thu Jan 20, 2011 5:26 am 
Offline
Senior Member
User avatar

Joined: Tue Mar 17, 2009 5:11 am
Posts: 129
Location: UK
Heh what confusion :D

Think it'll be more accurate for me to parse dmesg then instead!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group