# 4GB ram installed, but Gentoo only sees 3GB [solved]

## ianw1974

I'm trying to figure out why my system only sees 3GB of ram, when it has 4GB installed.  If I boot Windows XP Professional x64, it sees the full 4GB of ram.  My laptop supports this amount of memory, but for some reason, Gentoo always sees only 4GB.

The kernel has been configured with the 4GB option, so should be correct?

Any ideas what to check?Last edited by ianw1974 on Tue Oct 23, 2007 4:16 pm; edited 1 time in total

----------

## gerard27

Hi ianw,

I suppose you are on x86 and not x86_64.

Change your kernel .config to 64GB.

I had the same problem and this solved it.

Gerard.

----------

## ianw1974

Hi Gerard,

Thank's for the reply.  Yes it is x86 version and not 64 bit.  I've just recompiled the kernel now for 64GB, so when I reboot hopefully all will be OK.  Will update in a min.

----------

## ianw1974

Yep, that did the trick.  I now see 4GB  :Smile: 

Thanks very much.

----------

## gerard27

You're welcome.

Gerard.

----------

## MetalWarrior

Hi,

I've just added a 2Gb ram module to my laptop, which now has 4Gb of ram... 32-bit winzoz OSs see only 3Gb, should Gentoo (32-bit) see  4 Gb of memory?

```

# cat /proc/meminfo 

MemTotal:      3103432 kB

MemFree:       2619988 kB

Buffers:         13796 kB

Cached:         154528 kB

SwapCached:          0 kB

Active:         361176 kB

Inactive:        75616 kB

HighTotal:     2227008 kB

HighFree:      1784592 kB

LowTotal:       876424 kB

LowFree:        835396 kB

SwapTotal:     2208896 kB

SwapFree:      2208896 kB

Dirty:             116 kB

Writeback:           0 kB

AnonPages:      268468 kB

Mapped:          48196 kB

Slab:            17780 kB

SReclaimable:     4920 kB

SUnreclaim:      12860 kB

PageTables:       2000 kB

NFS_Unstable:        0 kB

Bounce:              0 kB

CommitLimit:   3760612 kB

Committed_AS:   738996 kB

VmallocTotal:   114680 kB

VmallocUsed:     63512 kB

VmallocChunk:    31732 kB

HugePages_Total:     0

HugePages_Free:      0

HugePages_Rsvd:      0

Hugepagesize:     4096 kB

```

Beginning of dmesg output:

```

BIOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 000000000009b800 (usable)

 BIOS-e820: 000000000009b800 - 00000000000a0000 (reserved)

 BIOS-e820: 00000000000d2000 - 00000000000d4000 (reserved)

 BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)

 BIOS-e820: 0000000000100000 - 00000000bfed0000 (usable)

 BIOS-e820: 00000000bfed0000 - 00000000bfee3000 (ACPI NVS)

 BIOS-e820: 00000000bfee3000 - 00000000c0000000 (reserved)

 BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)

 BIOS-e820: 00000000fed00000 - 00000000fed00400 (reserved)

 BIOS-e820: 00000000fed14000 - 00000000fed1a000 (reserved)

 BIOS-e820: 00000000fed1c000 - 00000000fed90000 (reserved)

 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)

 BIOS-e820: 00000000ff000000 - 0000000100000000 (reserved)

 BIOS-e820: 0000000100000000 - 0000000140000000 (usable)

ACPI: Shall use APIC/MADT table 2

Warning only 4GB will be used.

Use a HIGHMEM64G enabled kernel.

3200MB HIGHMEM available.

896MB LOWMEM available.

found SMP MP-table at 000f7bc0

Entering add_active_range(0, 0, 1048576) 0 entries of 256 used

Zone PFN ranges:

  DMA             0 ->     4096

  Normal       4096 ->   229376

  HighMem    229376 ->  1048576

Movable zone start PFN for each node

early_node_map[1] active PFN ranges

    0:        0 ->  1048576

On node 0 totalpages: 1048576

  DMA zone: 32 pages used for memmap

  DMA zone: 0 pages reserved

  DMA zone: 4064 pages, LIFO batch:0

  Normal zone: 1760 pages used for memmap

  Normal zone: 223520 pages, LIFO batch:31

  HighMem zone: 6400 pages used for memmap

  HighMem zone: 812800 pages, LIFO batch:31

  Movable zone: 0 pages used for memmap

```

This other piece of dmesg output says something about 3 of 4 Gb available:

```

Memory: 3101416k/4194304k available (4432k kernel code, 41784k reserved, 1867k data, 312k init, 2227008k highmem)

virtual kernel memory layout:

    fixmap  : 0xffe14000 - 0xfffff000   (1964 kB)

    pkmap   : 0xff800000 - 0xffc00000   (4096 kB)

    vmalloc : 0xf8800000 - 0xff7fe000   ( 111 MB)

    lowmem  : 0xc0000000 - 0xf8000000   ( 896 MB)

      .init : 0xc0730000 - 0xc077e000   ( 312 kB)

      .data : 0xc0554046 - 0xc0726cac   (1867 kB)

      .text : 0xc0100000 - 0xc0554046   (4432 kB)

```

I don't know if I've understood how is linux using the ram.. does it use 3G for userspace and <1G for the kernel?

It seems to see only 3Gb, 2.2 of which are Highmem and 0.8 lowmem..

If you need other info to help me, just ask  :Smile: 

----------

## nixnut

merged above post here.

----------

## MetalWarrior

 *nixnut wrote:*   

> merged above post here.

 

Thanks for the merge... I'm sorry for the duplicated thread..

BTW, thanks for the solution!

----------

## cyrillic

There is a performance hit when you have HIGHMEM64G=y due to the paging tricks involved.

Normally you would want to run a 64bit OS when you have this much RAM installed.

----------

## MetalWarrior

 *cyrillic wrote:*   

> There is a performance hit when you have HIGHMEM64G=y due to the paging tricks involved.
> 
> Normally you would want to run a 64bit OS when you have this much RAM installed.

 

You're right, but now it's too late for me.. unless there is a way to "upgrade" my current install to 64-bit recompiling everything (because a fresh install would mean re-customize everything again, which is too much time-consuming..)

----------

## ianw1974

 *cyrillic wrote:*   

> There is a performance hit when you have HIGHMEM64G=y due to the paging tricks involved.
> 
> Normally you would want to run a 64bit OS when you have this much RAM installed.

 

Providing of course that your system supports 64 bit, otherwise you'd only be able to use a 32 bit version for the 4GB installed  :Wink: 

----------

## cyrillic

I think most people in this situation already have a 64bit capable CPU.

... they just make lame excuses about why they are still using a 32bit OS  :Wink: 

----------

## ianw1974

This is true  :Smile: 

I had 32 bit for a while on my laptop although originally it had only 1GB of RAM before I upgraded to 4GB.  I wasn't sure about 64 bit at first, but now I've moved to it and find it's working well.  Not had any problems yet, other than skype not connecting but the rest of the stuff works fine.

Although, I do have some servers with 4GB of ram that unfortunately won't run a 64 bit OS because of the processor not being 64 bit compatible.

----------

## MetalWarrior

 *cyrillic wrote:*   

> I think most people in this situation already have a 64bit capable CPU.
> 
> ... they just make lame excuses about why they are still using a 32bit OS 

 

I've just finished installing my X86_64 Gentoo  :Wink:  It took only few hours to have a 64-bit fresh Gentoo, with my previous configuration  :Very Happy: 

----------

## feliks

 *Gerard van Vuuren wrote:*   

> Hi ianw,
> 
> I suppose you are on x86 and not x86_64.
> 
> Change your kernel .config to 64GB.
> ...

 

Hi, this didn't help me a bit. I have x86, I configured my kernel with the 64GB option and:

```
$ free

             total       used       free     shared    buffers     cached

Mem:       3505396    2463688    1041708          0        628    2141668

-/+ buffers/cache:     321392    3184004

Swap:      1574360          0    1574360
```

And:

```
$ cat /proc/meminfo 

MemTotal:      3505396 kB

MemFree:        920440 kB

Buffers:           660 kB

Cached:        2261708 kB

SwapCached:          0 kB

Active:         332156 kB

Inactive:      2186892 kB

HighTotal:     2621248 kB

HighFree:       118916 kB

LowTotal:       884148 kB

LowFree:        801524 kB

SwapTotal:     1574360 kB

SwapFree:      1574360 kB

Dirty:           44136 kB

Writeback:          68 kB

AnonPages:      256628 kB

Mapped:          45064 kB

Slab:            27208 kB

SReclaimable:    13068 kB

SUnreclaim:      14140 kB

PageTables:       2572 kB

NFS_Unstable:        0 kB

Bounce:              0 kB

CommitLimit:   3327056 kB

Committed_AS:  1003868 kB

VmallocTotal:   118776 kB

VmallocUsed:     17704 kB

VmallocChunk:   100924 kB
```

These values don't seem to have changed a byte from the 4GB kernel config option... Any ideas?

----------

## ShinyThings

 *feliks wrote:*   

>  *Gerard van Vuuren wrote:*   Hi ianw,
> 
> I suppose you are on x86 and not x86_64.
> 
> Change your kernel .config to 64GB.
> ...

 

I have the same problem. It is caused by the fact that some resources other than RAM have to be mapped in those 4GB. PCI-express, other devices, etc. In your BIOS, there may be an option for memory remapping. If there is, enable it. If not (like is the case for my chipset) you may be out of luck.

----------

## PaulBredbury

See thread.

Dammit people, there's a Search button - use it.

----------

## feliks

 *PaulBredbury wrote:*   

> See thread.
> 
> Dammit people, there's a Search button - use it.

 

Dammit, if you had actually *read* my posting, you'd know that I have the correct kernel config options *set*, and that this didn't help. Apart from that, the search functionality on this forum engine is next to useless, but this is off-topic. Here's the relevant bit from my kernel configuration.

```
$ zcat /proc/config.gz | grep HIGHMEM

# CONFIG_NOHIGHMEM is not set

# CONFIG_HIGHMEM4G is not set

CONFIG_HIGHMEM64G=y

CONFIG_HIGHMEM=y

CONFIG_DEBUG_HIGHMEM=y
```

 *Quote:*   

> It is caused by the fact that some resources other than RAM have to be mapped in those 4GB. PCI-express, other devices, etc. In your BIOS, there may be an option for memory remapping. If there is, enable it. If not (like is the case for my chipset) you may be out of luck.

 

As to this suggestion, I can't understand why it would reserve such a big amount of memory for those things, when it obviously did *not* when I had 1GB. Unfortunately, this is a laptop with very limited tweaking options in the BIOS. So if it reserves an amount of memory proportional to the total amount, than I'm truly out of luck.

----------

## blu3bird

Does your command line contain any "mem=" option?

You can try to force the kernel to detect all your memory by setting "mem=4G". This would help if you bios is bugged.

(grep -i mem /proc/cmdline)

Does your mainboard support 4GB of memory? Eg does the BIOS display 4194304KB when it boots?

Does your CPU support PAE?

I'm not sure if > 3GB of memory work on x86 without pae...

(grep -i pae /proc/cpuinfo)

----------

## Monkeh

feliks: Is your CPU a Pentium-M?

----------

## feliks

 *blu3bird wrote:*   

> Does your command line contain any "mem=" option?
> 
> You can try to force the kernel to detect all your memory by setting "mem=4G". This would help if you bios is bugged.
> 
> (grep -i mem /proc/cmdline)
> ...

 

Yeah, the processor of course supports PAE, it's a Core Duo T2400 (and as shown above, PAE is also enabled in the kernel). The BIOS says 4096M, when I check “memory installed” in the BIOS. Otherwise, there's no mention of the amount of memory installed. http://h18002.www1.hp.com/products/quickspecs/12427_na/12427_na.HTML#Memory ← this page shows this laptop supports 4GB, even though there's the “Above 3-GB, all memory may not be available due to system resource requirements.” warning, whatever that means (especially the “may”. May? Maybe? Maybe not?).

I tried running the kernel with the mem option but it just won't load (neither with 4G nor slightly lesser values).

Best,Last edited by feliks on Mon Dec 31, 2007 8:22 am; edited 2 times in total

----------

## feliks

 *Monkeh wrote:*   

> feliks: Is your CPU a Pentium-M?

 

It's a Core Duo T2400.

----------

## Monkeh

Sounds like the BIOS is terminally braindead.

----------

## feliks

 *Monkeh wrote:*   

> Sounds like the BIOS is terminally braindead.

 

Probably. Unfortunately this is the latest version and otherwise the best.

----------

## Zucca

 *cyrillic wrote:*   

> I think most people in this situation already have a 64bit capable CPU.
> 
> ... they just make lame excuses about why they are still using a 32bit OS :wink:

 \o I have 32-bit Core Duo. And enabling 64Gb support does not help. I still see ~3Gb.

EDIT: My CPU has the PAE flag.

EDIT2: Here's a part of my dmesg:

```
[   12.711703] Memory: 3101648k/3144256k available (5520k kernel code, 41476k reserved, 1822k data, 312k init, 2226752k highmem)
```

 That's strange.

----------

