# 4GB ram on AMD64

## CiSC

Hello,

   I just tried to compile an AMD64 gentoo-sources but Linux sees only 3GB of ram instead of 4GB (which is the correct size). I don't think it is an hardware limitation or bios one because:

- I have updated the bios to the last version (for Asus M2N Sli Deluxe)

- Booting with the live CD of Gentoo for x86_64 I correctly see 4 GB of ram.

What could be the problem?

Thanks in advance

Francesco

----------

## E001754

Correct me if I'm wrong, but the "x86" (which stands for 32 bits) and "amd64" which stands for 64 bits whatever the brand of your process goes in /etc/make.conf, not in the kernel options.

The gcc compiler must be told to compile for amd64 instead of x86.

There is also kernel options to select, for compatibility reasons with 32 bits libraries.

----------

## CiSC

Yes but the /etc/make.conf is not involved in kernel compilation (i think). In the kernel configuration I have selected the processor type (Athlon64 or something like that) and I have also enabled the compatilibity for 32 bit applications.

I think that my problem is in the kernel configuration, not in /etc/make.conf

Thanks

Francesco

----------

## Veldrin

A quick google returned, that the mainboard should support 8GB....

What is you RAM configuration - module type and numbers (e.g 2x 2GB, 4x 1GB...)

Please post emerge --info, uname -a and free -mLast edited by Veldrin on Tue Nov 03, 2009 10:24 am; edited 1 time in total

----------

## sera

You are right /etc/make.conf is not involved in kernel compilation.

There are different reasons why you would see only 3GB of your RAM.

If the kernel on the live cd-works I recommend a look at a "diff" of the both .config.

There are also many threads dealing with similar problems like this one for example:

https://forums.gentoo.org/viewtopic-t-797565-highlight-3gb.html

----------

## CiSC

I have 4x1GB ram modules (yes my mobo supports 8gb)

Ok I will take the diff between kernel .config(s)

Thanks

Francesco

----------

## snIP3r

hi cisc!

i have the same mobo and use 6gb of ram (2x1gb + 2x2gb) - no problem. please post your kernel config so we can check it.

HTH

snIP3r

----------

## Veldrin

Where do those 3GB come from? (just post the command, including results; or the screenshot)

I start to think, that this is a rounding error (or more cropping error), in which 3.9GB get returned a 3GB, instead of 4....

----------

## jw5801

 *CiSC wrote:*   

> Yes but the /etc/make.conf is not involved in kernel compilation (i think). In the kernel configuration I have selected the processor type (Athlon64 or something like that) and I have also enabled the compatilibity for 32 bit applications.
> 
> I think that my problem is in the kernel configuration, not in /etc/make.conf
> 
> Thanks
> ...

 

You are correct, however gcc is built with reference to make.conf, and I believe a 32-bit gcc will make 32-bit binaries. So this might mean you've actually built a 32-bit kernel? I'm by no means sure of that, however.

----------

## Veldrin

I think he is referring to the kernel 32-bit compat mode... without it, you cannot run 32-bit binaries.

But you have a valid point (if there are some leftovers from a 32-bit system) - and this is why I request all this information: to get a full picture.

----------

## gringo

this smells like you don´t have the "interleaved mode" option enabled in your bios.

cheers

----------

## Anon-E-moose

post "emerge --info" and see what is set

----------

## E001754

 *Veldrin wrote:*   

> I think he is referring to the kernel 32-bit compat mode... without it, you cannot run 32-bit binaries.

 

Yes, that's what I'm refering to !

 :Very Happy: 

----------

## lowsfer

a 32 bit gcc will generate 32 bit binary code when compiling a kernel. It seems that you are using a i686 kernel on your 64 bits processor.

If you really want to use 4GB memory, you have 2 options:

1)do a 64-bits installation

2)use PAE in your kernel if your CPU support PAE. Most CPUs today support PAE.

to enable it, you need to compile the kernel with this option

```

Processor type and feature->

        High Memory Support (64GB)->

                        (X) 64GB

```

Don't use 4GB in this option, or it will still support only 3GB memory.

But you really need to consider twice before doing the 2nd.

If your applications will only occupy less than 1GB memory (excude cache), PAE may *lower* the performance because PAE require one more layer for your system to access the memory resource. You have to choose between higher memory accessing speed and larger memory.

I am also running an x86 kernel on my thinkpad with a 64bits processor and 4GB memory. But I am using only 3GB, without 64GB PAE.

----------

## CiSC

Hi All,

 i finally found the time to recompile a new kernel from scratch. I don't know what was the problem but now i correctly see 4GB of ram

Thanks  :Wink: 

cisc@power ~ $ cat /proc/meminfo 

MemTotal:        4043596 kB

MemFree:         3701520 kB

Buffers:           39084 kB

Cached:           153100 kB

SwapCached:            0 kB

Active:           158392 kB

Inactive:         128836 kB

Active(anon):      96676 kB

Inactive(anon):        0 kB

Active(file):      61716 kB

Inactive(file):   128836 kB

Unevictable:           0 kB

Mlocked:               0 kB

SwapTotal:       8393952 kB

SwapFree:        8393952 kB

Dirty:              4140 kB

Writeback:             0 kB

AnonPages:         95112 kB

Mapped:            35428 kB

Slab:              32192 kB

SReclaimable:      23844 kB

SUnreclaim:         8348 kB

PageTables:         5508 kB

NFS_Unstable:          0 kB

Bounce:                0 kB

WritebackTmp:          0 kB

CommitLimit:    10415748 kB

Committed_AS:     266096 kB

VmallocTotal:   34359738367 kB

VmallocUsed:      152080 kB

VmallocChunk:   34359578107 kB

DirectMap4k:        4992 kB

DirectMap2M:     4188160 kB

----------

