More RAM than MemTotal

More RAM than MemTotal

Baruch Siach baruch at tkos.co.il
Wed Mar 28 14:46:08 IST 2012


Hi Orna,

On Wed, Mar 28, 2012 at 02:00:25PM +0200, Orna Agmon Ben-Yehuda wrote:
> I am missing 180MB, and would like to know where they are. The problem
> really interests me in the context of virtual machines, but it also exists
> on my laptop  (bare metal installation).
> The size depends on the installation: on my laptop180MB are missing, in two
> virtual machine images the numbers are 134 and 384.
> The difference is between the RAM I know I physically have (or that I know
> KVM was told to allocate the VM):
> 
> ladypine at alice:~/phd/c/moc$ grep RAM /var/log/kern.log
> Mar 26 10:24:45 alice kernel: [34324.028293] 1048576 pages RAM
> 
> This is exactly 4G, since each page is 4k: 1048576*4/1024=4096.
> 
> and the total memory that /proc/meminfo and top think the system has:
> 
> ladypine at alice:~/phd/c/moc$ grep MemTotal /proc/meminfo
> MemTotal:        4009628 kB
> 
> which is a bit less: 4009628/1024=3915.65
> 
> and the gap is:
> 4096-4009628/1024=180.35
> 
> So: 180Mb lost, a reward for an honest finder?

Do 'dmesg |grep Memory:' on your machine. Here is the output of mine:

Memory: 3967520k/5240832k available (3402k kernel code, 1137484k absent, 135828k reserved, 3330k data, 568k init)

The sum of 'absent' and 'reserved' should account for most of the missing RAM.  
See the mem_init() routine in arch/x86/mm/init_64.c (assuming that your laptop 
is x86_64 based).

The (huge) "absent" figure comes from absent_pages_in_range() in 
mm/page_alloc.c which, according to the comment there "returns number of page 
frames in holes" within the entire RAM. I'm not sure what that means exactly.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -



More information about the Linux-il mailing list