You are not logged in.

#1 2012-02-20 16:00:21

pntruongan
Member
Registered: 2011-01-31
Posts: 63

Linux 64-bit cannot use all of my 4GiB RAM.

Well, please forgive my nooby-ness but here is my problem:

Long ago I heard that 32-bit system cannot use 4GiB or more of RAM unless we turn on PAE option in kernel and 64-bit system can avoid this. So I installed 64-bit linux since I planned to upgrade my box to 4GiB Ram in the future. But somehow linux refuse to recognize all of my 4GiB Ram. I can only get 3.7GiB when run cat /proc/meminfo

[pntruongan@myhost ~]$ cat /proc/meminfo 
MemTotal:        3720600 kB
MemFree:         2406720 kB
Buffers:           85732 kB
Cached:           588172 kB
SwapCached:            0 kB

Given that intergrated VGA took away roughly 256MiB of Ram then if I do the math right, I still have 3932160 kB left. Where is the rest?

Offline

#2 2012-02-20 16:05:11

toofishes
Developer
From: Chicago, IL
Registered: 2006-06-06
Posts: 602
Website

Re: Linux 64-bit cannot use all of my 4GiB RAM.

You might want to check the settings in your BIOS, some have an option that limits the amount of RAM visible to the OS because 32-bit systems cannot address more than 4GB.

Offline

#3 2012-02-20 16:42:51

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: Linux 64-bit cannot use all of my 4GiB RAM.

Offline

#4 2012-02-20 16:56:07

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Linux 64-bit cannot use all of my 4GiB RAM.

pntruongan wrote:

Given that intergrated VGA took away roughly 256MiB of Ram then if I do the math right, I still have 3932160 kB left. Where is the rest?

Seems about right to me.. your BIOS and the kernel reserve some amount of RAM that will never be presented to the user as useful memory.

Offline

#5 2012-02-20 18:50:35

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Linux 64-bit cannot use all of my 4GiB RAM.

falconindy wrote:
pntruongan wrote:

Given that intergrated VGA took away roughly 256MiB of Ram then if I do the math right, I still have 3932160 kB left. Where is the rest?

Seems about right to me.. your BIOS and the kernel reserve some amount of RAM that will never be presented to the user as useful memory.

Windows does the same thing: if you look at your system specs under Control Panel in Vista/Win7, you'll see that not all physical RAM is made readily available to the user, for the reasons falconindy states.  Your operating system needs some of that RAM to boot and run a working interface, and won't ever let other processes appropriate it.

Offline

#6 2012-02-20 21:15:50

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Linux 64-bit cannot use all of my 4GiB RAM.

Shared video memory perhaps?  Reserved memory by BIOS?  I wouldn't worry about it.

Offline

#7 2012-02-20 21:45:59

apow
Member
Registered: 2012-02-20
Posts: 1

Re: Linux 64-bit cannot use all of my 4GiB RAM.

well, I can tell you where you probably lost 64 MB. See if your dmesg output has something like this:

[    0.000000] Node 0: aperture @ f800000000 size 32 MB
[    0.000000] Aperture beyond 4GB. Ignoring.
[    0.000000] Your BIOS doesn't leave a aperture memory hole
[    0.000000] Please enable the IOMMU option in the BIOS setup
[    0.000000] This costs you 64 MB of RAM

Offline

#8 2012-02-21 00:00:35

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Linux 64-bit cannot use all of my 4GiB RAM.

memory hole?

Offline

#9 2012-02-22 13:31:23

pntruongan
Member
Registered: 2011-01-31
Posts: 63

Re: Linux 64-bit cannot use all of my 4GiB RAM.

apow wrote:

well, I can tell you where you probably lost 64 MB. See if your dmesg output has something like this:

[    0.000000] Node 0: aperture @ f800000000 size 32 MB
[    0.000000] Aperture beyond 4GB. Ignoring.
[    0.000000] Your BIOS doesn't leave a aperture memory hole
[    0.000000] Please enable the IOMMU option in the BIOS setup
[    0.000000] This costs you 64 MB of RAM

No, my dmesg output don't show anything quite like this. The BIOS reserve memory sound reasonable. The laptop come with a weird BIOS that won't allow me to do any tweak besides changing boot order and I don't have the tool as well as the nerves to change it's BIOS so I guess this thread will come to an abrupt end here.

Thanks you all very much.

Offline

#10 2012-02-22 15:28:50

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Linux 64-bit cannot use all of my 4GiB RAM.

See how BIOS report memory (e820 messages on dmesg)

Example in my system with 4GiB of RAM

 BIOS-e820: 0000000000000000 - 000000000009f000 (usable)
 BIOS-e820: 000000000009f000 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 00000000dfee0000 (usable)
 BIOS-e820: 00000000dfee0000 - 00000000dfee3000 (ACPI NVS)
 BIOS-e820: 00000000dfee3000 - 00000000dfef0000 (ACPI data)
 BIOS-e820: 00000000dfef0000 - 00000000dff00000 (reserved)
 BIOS-e820: 00000000f0000000 - 00000000f4000000 (reserved)
 BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved)
 BIOS-e820: 0000000100000000 - 0000000120000000 (usable) <- Remapped memory above 4GiB via AMD DRAM Controller DCT (internally called "memory hoisting")

Only "usable" areas are used as "memory" smile

Sometimes, these usables areas are set to reserved by kernel:

e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved) <- First 64KiB marked as reserved to avoid unwanted memory modifications surprise by BIOS.
e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
e820 update range: 00000000dff00000 - 0000000100000000 (usable) ==> (reserved)

Just sum these areas and you get available memory, and ahead you can see how from this memory, some ranges are used for kernel only.

Offline

Board footer

Powered by FluxBB