# Problem with memory detection (4GB ram not all detected)

## kik0r

Hi

I just upgraded my memory from 2GB to 4GB and I can't make the full amount detected by the system.

My hardware is : C2D E4300 on Asus P5B with 4 sticks of 1GB OCZ.

I'm running an up to date gentoo with x86 profil (32 bits)

I tried different solutions, none seems to work.

I have identified the following elements which have an influence on the problem :

- Remap PCI memory option in bios 

- Kernel .config option

- Kernel options in grub

- Grub itself

1st try : 3GB detected in bios only, so I set the option Remap PCI to enable in bios

2nd try : 4GB detected in bios, the gentoo start but freeze before the kernel loads the tux logo

3rd try : I add in grub options mem=4096M and highmem=4096M for my current kernel, the computer boot, but the system saw only 2GB of ram (while the bios said 4GB).

4th try : I check my .config option I was on the setting CONFIG_HIGHMEM4G so I try CONFIG_HIGHMEM64G. I also tried to use CONFIG_HIGHPTE. The option CONFIG_X86_PAE was set. Nothing change.

5th try : I reboot again and notice that grub menu was displaying the amount of memory at 2GB. So it's maybe not a kernel problem, but a grub problem to detect the right amount of memory ? I setup again in the bios the option Remap PCI. The bios detect 3GB, so do grub, and so does my system.

I'm currently using the computer like this, I'm still looking for a solution fo use the full 4GB of memory.

So is it a grub problem ?

Or is it because my system is 32 bits (I don't think so, I thought 4GB should work with 32 bits sytem)

If someone has a clue, thanks !  :Smile: 

----------

## mb1248

The 32bit Windows has this problems but I thought Linux doesn't.

A 32bit system should be able to address 4GB including the swap!

So if you have 4GB you cannot use swap.

----------

## kik0r

That's interesting because my system use 2GB of swap.

So that would make sense because i have 4GB total memory less 2GB of swap, there is 2GB of physical memory available ?

Hum I'm not sure because with almost the same setting, with 3GB of memory, my system sees 3GB of memory and use 2GB

of swap, so it's able to address 5GB ?

My kernel is setup with option HIGHMEM64G, so the kernel should be able to address 64GB of memory. I'm not sure it is the

right direction.

Thanks anyway

Any other suggestion ?

----------

## x22

Have you tried booting with HIGHMEM64G and without any mem= or similar parameter?

You can check if memory is OK with memtest86+.

----------

## PaulBredbury

Just to confuse us, the kernel config needs to be set up for 64gb rather than 4gb, to be able to use all of the 4gb. Crazy but true. Set this in the kernel's "Processor type and features" menu:

```
High Memory Support (64GB)
```

Here's my "before" and "after" views, if it's useful. I did not add any mem lines in grub.

Before:

```
$ grep HIGHMEM /boot/config

# CONFIG_NOHIGHMEM is not set

CONFIG_HIGHMEM4G=y

# CONFIG_HIGHMEM64G is not set

CONFIG_HIGHMEM=y

$ dmesg | grep "MEM avail"

3200MB HIGHMEM available.

896MB LOWMEM available.

$ cat /proc/meminfo | grep MemTotal

MemTotal:      3106424 kB
```

After:

```
$ grep HIGHMEM /boot/config

# CONFIG_NOHIGHMEM is not set

# CONFIG_HIGHMEM4G is not set

CONFIG_HIGHMEM64G=y

CONFIG_HIGHMEM=y

$ dmesg | grep "MEM avail"

4224MB HIGHMEM available.

896MB LOWMEM available.

$ cat /proc/meminfo | grep MemTotal

MemTotal:      4146804 kB
```

This enables PAE, which has a minor performance penalty.

This is on an x86 (i.e. 32-bit) installation. Asus P5WDH motherboard, Core 2 Duo processor.

----------

## kik0r

Hi thanks for the answers

PaulBredbury> do you have the remap memory option on in your bios on the P5W ?

I tried both settings but, with the first one report 3GB, the second one is reporting 2GB. The weird thing is that the bios shows 4GB, but grub shows 2GB only (at the grub boot screen it says how much upper memory detected). How does look your grub ?

thank you !

----------

## PaulBredbury

 *kik0r wrote:*   

> do you have the remap memory option on in your bios on the P5W ?

 

Yes, use whatever option that makes your BIOS show 4gb. I wouldn't trust grub to show the right amount. It's between the BIOS and the Linux kernel - grub doesn't matter.

It is possible that the RAM chips are faulty/unstable - the best way to test them is to run memtest+ overnight (i.e. several hours). For instance, my expensive/stupid motherboard has got a strange quirk that it can't run 4-4-4-12-4 fast RAM reliably, and that was a big pain to discover   :Sad:   So my best compromise that actually works is to specify 4-4-4-16-4.

----------

## gerard27

Hi all,

Thanks for the info.

I changed my .config as per PaulBredbury and sure enough

I now have 4G available to Linux.

The funny thing is that when you have mem=4096M in grub Linux shows 3.1G.

I am sorry I bought this overpriced mobo but will have to live with it.

Gerard.

----------

## kik0r

Update, still running with 3gb.

Actually I'm running with 3 sticks instead of 4.

I came back from week end, and the pc was unstable to hell. Segfault all over the place.

I checked the sticks and it appears one of new stick is giving me error on memtest86+.

That sux.

I hope I can resolve asap to test again the 4GB.

----------

## drescherjm

At work I have just added 2 1GB dimms to the system to bring the total to 4GB however 64 bit gentoo only sees 3.5GB. I believe this is because of the io being mapped in the first 4GB and I need to enable a memory hole. The problem is that my bios (dated some time last year) has no remap option that I can find. Should I flash to the latest? Does anyone have this option in their bios for this board?

----------

## nixnut

merged above post here.

----------

## gerard27

Hi drescherjm,

If you have a P5B board and it has an AMI bios like in the P5W DH that I own

go to "Advanced->Memory-Remap-Feature" and set it to Enabled.

I don't think this would have changed in a newer bios.

Gerard.

----------

## drescherjm

It's a M2N SLI Deluxe board. I guess I should have put that in the body instead of the title as after merging threads that was less obvious...

I do not appear to have that setting anywhere but I will look harder as there are 20+ memory settings which are mostly timings.

----------

## vertaxis

Gentoo is not seeing all the RAM on my system.

I have the following config:

AMD Athlon64 3200+ (single core)

Biostar 6100-M9 mATX board - BIOS fully patched

4x 1GB DDR400 Ram = 4GB

Installing 32-bit Gentoo with the 2007.0-r1 x86 Minimal CD

The BIOS posts with 4GB of Ram, yet both the Minimal CD and my compiled kernel only see 3GB of Ram even though it's a 4 GB system.  No more than 300MB is being reserved by the hardware for video and housekeeping.

-I have set a "mem=" value in my grub.conf, with no effect.

-I have run 2 different Ram testing apps for about 12 hours and the Ram passed without any errors.  Both test tools did see 4GB of Ram.

-I did compile in the 4GB option for memory when building a new kernel

Any ideas?

Here are some more vitals:

livecd / # free

             total       used       free     shared    buffers     cached

Mem:       3041568      83148    2958420          0      10948      45440

-/+ buffers/cache:      26760    3014808

Swap:            0          0          0

===========================================================

top - 18:30:06 up 9 min,  1 user,  load average: 0.00, 0.10, 0.08

Tasks:  47 total,   2 running,  45 sleeping,   0 stopped,   0 zombie

Cpu(s):  0.0% us,  0.0% sy,  0.0% ni, 99.7% id,  0.0% wa,  0.3% hi,  0.0% si

Mem:   3041568k total,    83272k used,  2958296k free,    10948k buffers

Swap:        0k total,        0k used,        0k free,    45440k cached

===========================================================

livecd / # lspci

00:00.0 RAM memory: nVidia Corporation C51 Host Bridge (rev a2)

00:00.1 RAM memory: nVidia Corporation C51 Memory Controller 0 (rev a2)

00:00.2 RAM memory: nVidia Corporation C51 Memory Controller 1 (rev a2)

00:00.3 RAM memory: nVidia Corporation C51 Memory Controller 5 (rev a2)

00:00.4 RAM memory: nVidia Corporation C51 Memory Controller 4 (rev a2)

00:00.5 RAM memory: nVidia Corporation C51 Host Bridge (rev a2)

00:00.6 RAM memory: nVidia Corporation C51 Memory Controller 3 (rev a2)

00:00.7 RAM memory: nVidia Corporation C51 Memory Controller 2 (rev a2)

00:03.0 PCI bridge: nVidia Corporation C51 PCI Express Bridge (rev a1)

00:04.0 PCI bridge: nVidia Corporation C51 PCI Express Bridge (rev a1)

00:05.0 VGA compatible controller: nVidia Corporation C51G [GeForce 6100] (rev a2)

00:09.0 RAM memory: nVidia Corporation MCP51 Host Bridge (rev a2)

00:0a.0 ISA bridge: nVidia Corporation MCP51 LPC Bridge (rev a3)

00:0a.1 SMBus: nVidia Corporation MCP51 SMBus (rev a3)

00:0a.2 RAM memory: nVidia Corporation MCP51 Memory Controller 0 (rev a3)

00:0b.0 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3)

00:0b.1 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3)

00:0d.0 IDE interface: nVidia Corporation MCP51 IDE (rev a1)

00:0e.0 IDE interface: nVidia Corporation MCP51 Serial ATA Controller (rev a1)

00:10.0 PCI bridge: nVidia Corporation MCP51 PCI Bridge (rev a2)

00:14.0 Bridge: nVidia Corporation MCP51 Ethernet Controller (rev a3)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

03:06.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 74)

==========================================================

Thanks for any help.

----------

## deno

You can try some other live distro like ubuntu and see if you have the same situation. Further you can try to use some patched kernels like kamikaze-sources, ragnarok-sources which offer some more options. 

i.e 

 *Quote:*   

> High Memory Support ------------------------+
> 
>                       |  Use the arrow keys to navigate this window or press the hotkey of |  
> 
>                       |  the item you wish to select followed by the <SPACE BAR>. Press    |  
> ...

 

 *Quote:*   

>                       +--------------------------- Memory split ---------------------------+
> 
>                       |  Use the arrow keys to navigate this window or press the hotkey of |  
> 
>                       |  the item you wish to select followed by the <SPACE BAR>. Press    |  
> ...

 

If I understand this correct one can have up to 3GB of mem with high memory support off... But am not sure if this is the reason for your problem because you shouldn't have this feature. Do you have high memory on? In case you check 64 GB option you'll probably have all 4 GB addressed but that will probably have some impact on performance.

EDIT:

didn't notice that you have 64 bit arch. Maybe that could have something to do with it. With patch (or already mentioned kernels) you could have this option  [ ] 64 bit Memory and IO resources (EXPERIMENTAL) .

----------

## vertaxis

I'm building a 32-bit system.  Some of the apps I'm running on the image may not be supported as a 64-bit compile.  Once the source of this missing memory problem is found, I plan on converting the system into a pure Xen machine.

As for the kamikaze-sources, ragnarok-sources...I assume that I can get them via Portage?

----------

## GWilliam

#NULLLast edited by GWilliam on Sun Jul 25, 2010 4:35 am; edited 1 time in total

----------

## PaulBredbury

Edit: Removed now-useless post.Last edited by PaulBredbury on Fri Sep 28, 2007 4:29 am; edited 1 time in total

----------

## hexstar

Hello, you'll need to install 64bit linux to support 4gb+ of ram, unfortunately people tend to experience more problems then usual with 64bit linux builds so...

----------

## PaulBredbury

 *hexstar wrote:*   

> need to install 64bit linux to support 4gb+ of ram

 

Wrong. Read about PAE.

----------

## hexstar

 *PaulBredbury wrote:*   

>  *hexstar wrote:*   need to install 64bit linux to support 4gb+ of ram 
> 
> Wrong. Read about PAE.

 Ah that's a nice feature, thanks for informing about that  :Smile: 

----------

## Cyker

Getting past the 4GB barrier is a PITA.

Firstly, you NEED to enable 64GB mode in the kernel - With 4GB RAM, you're actually accessing MORE than 4GB because lots of memory is MMIO'd to various PCI/PCIe etc. devices on the system. Got a 256MB Graphics card? That's 256MB of your memory address space gone right there.

Unfortunately, 64GB mode works like EMS memory, which is slow and sucks.

Second, because this address space is used, you may need to set something in your BIOS - Look for something mentioning Memory Holes (Not 15-16 MB, but 4GB one if you can find!). Almost everyone I know has had to mess about with this setting to access more than 4GB RAM properly, even on 64-bits.

Also, yo

----------

## nixnut

merged above nine posts here.

----------

## vertaxis

First the Ram is missing, then my post goes missing   :Razz: 

Recompiling with 64GB mode has revealed the missing Ram.  We'll see how it goes after some testing, but otherwise, my problem is solved.

----------

## hexstar

 *vertaxis wrote:*   

> First the Ram is missing, then my post goes missing  
> 
> Recompiling with 64GB mode has revealed the missing Ram.  We'll see how it goes after some testing, but otherwise, my problem is solved.

 Glad to hear that  :Smile: 

----------

