From: andrzej-kardas@o2.pl (Andrzej Kardas)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Missing 1GB RAM, where is it?
Date: Wed, 13 Apr 2011 19:20:07 +0200 [thread overview]
Message-ID: <4DA5DB47.9080101@o2.pl> (raw)
In-Reply-To: <BANLkTik3iu2jHNL0BXP7ZFif1dEO7ic2jQ@mail.gmail.com>
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
next prev parent reply other threads:[~2011-04-13 17:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 16:06 Enabling Signals in kernel Vijay Ram Chitrapu
2011-04-13 1:01 ` Haojian Zhuang
2011-04-13 19:30 ` julie Sullivan
2011-04-13 17:20 ` Andrzej Kardas [this message]
2011-04-14 2:42 ` Missing 1GB RAM, where is it? Mulyadi Santosa
2011-04-14 11:27 ` andrzej-kardas
2011-04-14 12:17 ` Mulyadi Santosa
2011-04-14 15:23 ` Andrzej Kardas
2011-04-16 6:07 ` Mulyadi Santosa
2011-04-14 15:09 ` Adrian Cornish
2011-04-14 15:43 ` Andrzej Kardas
2011-04-14 16:12 ` Haojian Zhuang
2011-04-15 0:45 ` Haojian Zhuang
[not found] ` <BANLkTik7g8vEf6X+suzwbXD1b4ow1__2xQ@mail.gmail.com>
2011-04-17 7:58 ` Missing 1GB RAM, where is it? - SUMMARY Andrzej Kardas
2011-04-17 15:31 ` julie Sullivan
2011-04-18 10:17 ` andrzej-kardas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DA5DB47.9080101@o2.pl \
--to=andrzej-kardas@o2.pl \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).