# the maximum memory that Gentoo can support?

## knighterrant

this is the hardware of my server:

```
Machine: HP ProLiant DL380 

CPU: Intel(R) Xeon(R) CPU E5420 @ 2.50GHz x 4 

MEMORY: 2G 
```

because of insufficient memory, I planned to add memory to my machine.

before doing that, I want to know what is the maximum memory that gentoo can support.

and need not to re-install gentoo, does it?

anybody can help me?

----------

## xaviermiller

Hello,

The maximum is

```
min(

   max memory supported by the kernel, depending if you are in 32 or 64 bits, 

   max memory sopported by your mother board)
```

What are your needs : 

- surf, read mails

- heavy video editing

- gaming

...

----------

## CurtE

What makes you think that's not enough memory?  I think my two servers are close to that and I've had no problems.

As Xavier said, what do you plan to run on the computer?

----------

## i92guboj

The maximum ram that Gentoo can handle is the same than any other Linux. It's the Linux kernel which handles that, and it certainly depends on the architecture that your kernel was compiled for. Your cpu could be using an x86 (32 bits) or x86_64 (64 bits) kernel. 

If you are into the 64 bits wagon, then you probably don't have to worry, because with 64 bits you can address directly 2^64 bytes, 1.84467440737e+19, which are 18.4 millions of terabytes. That's much more than what hardware supports nowadays. However, 64 bits cpus nowadays have artificial limits, and they don't use this full address range, I think that currently amd64 cpus only use 48 bytes for indirections. Which is still a lot. like 281 terabytes or so.

In 32 bits you can directly address 4 gb or ram, however linux can use a trick called PAE to deference up to 64 gb of ram in 32 bits, that comes at a cost though (in performance). And in any case, a single process will never be able to use more than 4gb or ram.

----------

## Naib

As mentioned its more a linux thing then a gentoo thing (when you start thinking distro's are pretty much the same linux becomes so much simpler)

HOWEVER... there is hardware limitations. number of slots, whether the BIOS supports

----------

## knighterrant

TO XavierMiller:

Intel(R) Xeon(R) CPU E5420 is 64bits, isn't it?

I plan to expand the memory to 16GB, need I re-install gentoo?

TO CurtE:

I have a website(apache+php) running on my server.

the website traffic ervery day is over 10 gb!

the peak value of memory usage is over 2,010,000k, at that time the website have not any response...Last edited by knighterrant on Fri Sep 04, 2009 9:01 am; edited 1 time in total

----------

## knighterrant

 *i92guboj wrote:*   

> The maximum ram that Gentoo can handle is the same than any other Linux. It's the Linux kernel which handles that, and it certainly depends on the architecture that your kernel was compiled for. Your cpu could be using an x86 (32 bits) or x86_64 (64 bits) kernel. 
> 
> If you are into the 64 bits wagon, then you probably don't have to worry, because with 64 bits you can address directly 2^64 bytes, 1.84467440737e+19, which are 18.4 millions of terabytes. That's much more than what hardware supports nowadays. However, 64 bits cpus nowadays have artificial limits, and they don't use this full address range, I think that currently amd64 cpus only use 48 bytes for indirections. Which is still a lot. like 281 terabytes or so.
> 
> In 32 bits you can directly address 4 gb or ram, however linux can use a trick called PAE to deference up to 64 gb of ram in 32 bits, that comes at a cost though (in performance). And in any case, a single process will never be able to use more than 4gb or ram.

 

The gentoo installed on my server is x86(linux-2.6.27-gentoo-r8 ).

If I expand memory to 16 gb, how can I enable PAE in my kernel?

or I need to re-install gentoo ia64? ( CPU: Intel(R) Xeon(R) CPU E5420 @ 2.50GHz )

----------

## xaviermiller

Hello,

If you have so much memory, it is recommanded you switch to AMD64 (not ia64 which is for Itanium processors, not the Xeon).

----------

## knighterrant

 *XavierMiller wrote:*   

> Hello,
> 
> If you have so much memory, it is recommanded you switch to AMD64 (not ia64 which is for Itanium processors, not the Xeon).

 

but my CPU is not AMD, does that have any problem?

----------

## xaviermiller

AMD64 is in fact x86_64. The first x86 CPU supporting 64 bits instructions was the AMD64, 2 years before the other Intels.

So, the "AMD64" is the good architecture for you  :Wink: 

(maybe it is, or will be renamed to "x86_64")

----------

## knighterrant

 *XavierMiller wrote:*   

> AMD64 is in fact x86_64. The first x86 CPU supporting 64 bits instructions was the AMD64, 2 years before the other Intels.
> 
> So, the "AMD64" is the good architecture for you 
> 
> (maybe it is, or will be renamed to "x86_64")

 

I see!  I change it to AMD64 this week end!

Thank you very much! Thanks to CurtE, i92guboj, and Naib too!

----------

## i92guboj

Yep, you need amd64/x86_64. It's named after amd just like i386 is named after intel, just because on each respective case they were the first to implement it. Migrating to amd64 will give you full access to your 16 gb of memory without any further doing.

ia64 is not for your machine.

----------

## eccerr0r

I've been seeing motherboards that don't support more than 3.25GB of RAM so watch out for that.

Otherwise default 32-bit Linux (no highmem): ~896M

32-bit Highmem: ~3.25GB

32-bit PAE: ~63GB

64-bit (x86_64, amd64, em64t,...): As much as the motherboard and the phys address bits the processor can support.

With the highmem/PAE options, you're still limited per process (shared with lightweight threads in each process) to natural 32-bit limits.

For curiosity, older p4s have 40 bit physical address; as stated before, core2 em64t has 48 bits; and ia64 (2002 Itanium2 McK core, 900MHz+) has 50 bits. Though even with 40 bits, that's 1TB of RAM...  Though some of the address space is shared with MMIO.  (I guess ia64 wanted to be a 1PB processor...)

And switching to 64-bit mostly means a reinstall.  If you opt to use 32-bit PAE/Higmem support, binaries mostly run just as before.  You can run 32-bit software under a 64-bit kernel, but I believe it runs as if highmem is on and emulated.

Looks like the HP Proliant DL380 uses Intel's 5000P MCH, which supports all 64GB of PAE unlike i945...

----------

## John R. Graham

 *knighterrant wrote:*   

> ...the peak value of memory usage is over 2,010,000k, at that time the website have not any response...

 Look at where the memory is being used (you can use top for this).  Linux uses memory that isn't being used for anything else for page swap cache.  This memory is available to applications to allocate.  

I'm with CurtE:  what makes you think that 2GiB is not enough memory?  Is the hard drive thrashing?  With only 10 meg of your swap drive in use, I don't think so.  And, if it's not, then adding more memory isn't going to improve the performance a whole lot.

- John

----------

## BitJam

A busy Apache server can chew up memory in order to stay fast.  If you don't want to add more memory then you could investigate ways of tuning Apache.

If you do want to upgrade your memory, upgrading to amd64 means a complete re-install.  Can you afford/schedule downtime?

----------

## i92guboj

 *BitJam wrote:*   

> A busy Apache server can chew up memory in order to stay fast.  If you don't want to add more memory then you could investigate ways of tuning Apache.
> 
> If you do want to upgrade your memory, upgrading to amd64 means a complete re-install.  Can you afford/schedule downtime?

 

Lighttpd is worth checking for a domestic server. Your ram will be grateful.

----------

## Naib

 *i92guboj wrote:*   

>  *BitJam wrote:*   A busy Apache server can chew up memory in order to stay fast.  If you don't want to add more memory then you could investigate ways of tuning Apache.
> 
> If you do want to upgrade your memory, upgrading to amd64 means a complete re-install.  Can you afford/schedule downtime? 
> 
> Lighttpd is worth checking for a domestic server. Your ram will be grateful.

 

unless you use fast-cgi where it will just spawn a load of fcgi process and munch your CPU  :Wink:  although that can be brought under control

but yer lighty

----------

## jcat

..so, to but in quickly..

If you you have 4Gig of RAM, is it recommended to use PAE?

I just realised that one of my machines with 4Gig was only using 3284Mg, now after enabling PAE it's 4040Mg  :Smile: 

Are there any down sides to enabling PAE if you only have 4Gig?

Cheers,

Just

----------

## i92guboj

 *jcat wrote:*   

> ..so, to but in quickly..
> 
> If you you have 4Gig of RAM, is it recommended to use PAE?
> 
> I just realised that one of my machines with 4Gig was only using 3284Mg, now after enabling PAE it's 4040Mg 
> ...

 

PAE takes some overhead. If you never fill those 3gb of ram then you'll be fine without PAE. If you fill them then you have to enable PAE since paging to disk will harm more than PAE does.

----------

## jcat

Well, it's always going to fill up with disk cache on this system at least, so I guess I'll stick with PAE.

Thanks for the info  :Smile: 

Cheers,

Just

----------

