# Why is my system only detecting 3 GB of my 4 GB memory

## profox

Hey, I just upgraded my notebook from 2 GB to 4 GB, the only problem is that Gentoo only sees 3 GB.

```

$: free -m

             total       used       free     shared    buffers     cached

Mem:          3016        683       2333          0          9        176

-/+ buffers/cache:        497       2518

Swap:         3388          0       3388

$: cat /proc/meminfo  | grep MemTotal

MemTotal:      3089264 kB

```

I tested the memory and everything looked fine. I am also sure my notebook support memory up to 4 GB. I am running amd64, and just did a clean build of my kernel, but without any success.

```

$: uname -a

Linux daan-laptop 2.6.24-gentoo-r8 #9 SMP Mon Jun 2 15:06:53 CEST 2008 x86_64 Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz GenuineIntel GNU/Linux

```

Why is Gentoo only sees 3 GB of my memory?

----------

## massimo

Does your kernel support this amount of memory? Check your kernel configuration (High memory support).

----------

## profox

I cannot find the high mem support (it used to be in Processor types & features right?). I think that is only for the 32-bit kernel.

----------

## gerard27

Are you sure your bios is set for 4GB?

Geard.

----------

## profox

Yes I am sure. My BIOS is showing 4 GB and if I use a Ubuntu Live CD I can also use 4 GB.

----------

## muhsinzubeir

i do remember somebody(veteran) here in the forums explained this, but cant find this topic was that...sorry but he actually explained even the calculation of that memory loss...

my appology tht i couldnt provide u with the link..but i did try to search it  :Smile: 

----------

## gentoo_ram

My understanding is that the memory difference has to do with how the BIOS/chipsets map various memory-mapped devices (like video cards, etc) to physical memory spaces.  Video memory "overlays" parts of where your physical RAM would be, thus it isn't usable.  There really isn't anything you're going to be able to do about it.  It's just how the BIOS implements the memory map.  I think it only recently started being an issue once 4GB became common.  You may be able to reduce the losses if you reduce the amount of video memory that's mapped by your video card.  If your BIOS even gives you that option.  My experience with laptops is that you can't do much tweaking.  

Do you run Windows on that laptop as well?  It's going to have the same issue.  Note that Vista SP1 will still report "4GB" even though it can only use about 3GB of the memory.  Earlier versions of Windows would probably report the 3GB value.

----------

## tgR10

cd /usr/src/linux && make menuconfig

```
    Processor type and features  --->  

            High Memory Support (4GB)  --->    
```

maybe try this ? but i'm not sure this is posible to use 4 gb ram on x86 system :> i tink it's caused by the architecture of procesors

----------

## AllenJB

 *tgR10 wrote:*   

> cd /usr/src/linux && make menuconfig
> 
> ```
>     Processor type and features  --->  
> 
> ...

 

This needs to be set to the next value up (64GB IIRC). Even tho it's set to 4GB, there's some overhead involved that reduces the amount of usable memory (the same reason why you'll only see ~840MB if you're running more than 1GB when that option is set to 1GB)

----------

## muhsinzubeir

https://forums.gentoo.org/viewtopic.php?t=175419

----------

## Anarcho

In 64Bit Systems there is no need for "High Mem" so there is no such kernel option.

The Problem most likely will be your mainboard which might support 4GB and 64Bit but it is not well designed. The Problem is that not only your RAM needs physical addresses but nearly all other hardware, too. When the mainboard is not well designed these other hardware (like PCI Cards, RAM of your Graphics Card, etc.) gets addresses in the range of 3-4 GB. This has the consequence that the real RAM which would fall in this range can't be accessed anymore because the addresses are reserved for the other hardware. If your BIOS doesn't offer the possibility of remapping to other addresses there will be no possibililty to get the full 4 GB RAM for any OS.

You can check your mappings with

cat /proc/mtrr

There are some ways to manipulate the MTRRs but I'm not sure if there is a way to resolv this memory hole.

EDIT:

See for example: http://forums.fedoraforum.org/archive/index.php/t-68859.html

----------

