Missing 1GB RAM, where is it?

Andrzej Kardas andrzej-kardas at o2.pl
Wed Apr 13 13:20:07 EDT 2011


Hi,

I'm little confused about amount of RAM memory in my computer and I 
can't figure out where disappear about 1GB memory. I need yours help to 
explain this, because i can't sleep :). Here is background:

I've plugged into my computer 2x2GB RAM. In BIOS screen i see:

Amount of available RAM: 4096MB

so BIOS recognizes all 4GB, but my OS(*32bit*)

uname -a
Linux lpt 2.6.33.1 #1 SMP Thu Mar 18 23:32:41 CET 2010 i686 GNU/Linux

sees only 3014MB

free -m
              total       used       free     shared    buffers     cached
Mem: *3014*       1756       1258          0        456        918

first, i thought that most of this missing memory is not available 
because of mapped IO, so i decided to count this by using addresses from 
/proc/iomem (where the actual memory map is). I've wrote piece of code 
like this to count all memory seen by OS:

for i in `cat /proc/iomem | grep -P "^[^\s]" | awk '{ print $1}' | sort 
| uniq`; do  startAddr=$(echo $i | awk -F "-" '{print $1}') && 
endAddr=$(echo $i | awk -F "-" '{print $2}'); bytes=$(calc 
"(0x$endAddr-0x$startAddr)"); ((sum+=${bytes})); done; echo "TotalMB: " 
; calc "$sum/(1024*1024)";
*TotalMB:
     3745.726528167724609375*

There is still missing almost 400MB. If i think correct, in /proc/iomem 
should be map of all memory, so it should cover all 4096 MB, right ??

Lets, count amount of ram not available for user, reserved for (mapped 
IO) ACPI, PCI bus etc:

for i in `cat /proc/iomem | grep -v "System RAM" | grep -P "^[^\s]" | 
awk '{ print $1}' | sort | uniq`; do  startAddr=$(echo $i | awk -F "-" 
'{print $1}') && endAddr=$(echo $i | awk -F "-" '{print $2}'); 
bytes=$(calc "(0x$endAddr-0x$startAddr)"); ((sum+=${bytes})); done; echo 
"TotalMB: " ; calc "$sum/(1024*1024)";
*TotalMB:
     683.65817165374755859375*

Only 683MB, so if my calculation are correct, where disappear 400MB?? It 
seems to be that OS doesn't even sees this 400MB. Any idea?


Extra logs:

CPU is able to handle 36bit address size:

cat /proc/cpuinfo | grep address
address sizes    : 36 bits physical, 48 bits virtual
address sizes    : 36 bits physical, 48 bits virtual


Enabled PAE in kernel - but in this case there should not be difference 
(RAM isn't above 4GB)

cat /boot/config-2.6.33.1 | grep PAE
CONFIG_X86_PAE=y


My iomem:

root at lpt:~# cat /proc/iomem
00000000-00001fff : System RAM
00002000-0000ffff : reserved
00010000-0009f7ff : System RAM
0009f800-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000cf000-000d07ff : Adapter ROM
000e0000-000fffff : reserved
   000f0000-000fffff : System ROM
00100000-bf67ffff : System RAM
   00100000-005951c8 : Kernel code
   005951c9-007be6e7 : Kernel data
   00854000-008dfadb : Kernel bss
bf680000-bf6fffff : ACPI Non-volatile Storage
bf700000-bfffffff : reserved
c0000000-c3ffffff : PCI Bus 0000:06
   c0000000-c3ffffff : PCI CardBus 0000:07
c4000000-c41fffff : PCI Bus 0000:02
c4200000-c43fffff : PCI Bus 0000:02
c4400000-c45fffff : PCI Bus 0000:03
c4600000-c47fffff : PCI Bus 0000:03
c4800000-c49fffff : PCI Bus 0000:04
c4a00000-c4bfffff : PCI Bus 0000:04
c4c00000-c4dfffff : PCI Bus 0000:05
c4e00000-c4e00fff : Intel Flush Page
c8000000-cbffffff : PCI CardBus 0000:07
d0000000-dfffffff : 0000:00:02.0
e0000000-efffffff : PCI MMCONFIG 0000 [bus 00-ff]
   e0000000-efffffff : reserved
     e0000000-efffffff : pnp 00:01
f0000000-f007ffff : 0000:00:02.0
f0080000-f00fffff : 0000:00:02.1
f0100000-f01fffff : PCI Bus 0000:05
   f0100000-f0100fff : 0000:05:00.0
     f0100000-f0100fff : iwl3945
f0200000-f02fffff : PCI Bus 0000:06
   f0200000-f0201fff : 0000:06:01.0
     f0200000-f0201fff : 0000:06:01.0
   f0202000-f0202fff : 0000:06:04.0
     f0202000-f0202fff : yenta_socket
   f0203000-f020307f : 0000:06:04.1
   f0203100-f02031ff : 0000:06:04.4
     f0203100-f02031ff : mmc1
   f0203400-f02034ff : 0000:06:04.2
     f0203400-f02034ff : mmc0
   f0203800-f020387f : 0000:06:04.3
f0300000-f033ffff : 0000:00:02.0
f0340000-f0343fff : 0000:00:1b.0
   f0340000-f0343fff : ICH HD audio
f0544000-f05443ff : 0000:00:1d.7
   f0544000-f05443ff : ehci_hcd
fec00000-fec0ffff : reserved
   fec00000-fec003ff : IOAPIC 0
fed00000-fed003ff : HPET 0
   fed00000-fed003ff : reserved
     fed00000-fed003ff : pnp 00:04
fed14000-fed19fff : reserved
   fed14000-fed17fff : pnp 00:01
   fed18000-fed18fff : pnp 00:01
   fed19000-fed19fff : pnp 00:01
fed1c000-fed8ffff : reserved
   fed1c000-fed1ffff : pnp 00:01
   fed20000-fed3ffff : pnp 00:01
fee00000-fee00fff : Local APIC
   fee00000-fee00fff : reserved
ff000000-ffffffff : reserved


--
regards
Andrzej Kardas
http://www.linux.mynotes.pl























-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110413/c7009d76/attachment.html 


More information about the Kernelnewbies mailing list