# ram limitations in linux



## brokencomputer (Nov 27, 2007)

is there a limit to the usable ram on linux? (i know that windows xp 32bit doesn't support more than 4 gigs)


----------



## wmorri (May 29, 2008)

As far as i am aware you are only limited by the amount of ram that your motherboard will support.


----------



## af3 (Jun 18, 2008)

Just for the record, Windows XP only appears to use 3.5GB of my 4GB. I don't mean to be a smartssa or anything like that. :1angel:


----------



## lensman3 (Oct 19, 2007)

The Following is from John Reisner and the USENET group comp.os.linux.development.system dated March 3, 2008.

> I believed that, using a 32 bits OS, I could use as far as 4 Gbytes.

There must be communication between the user space and the kernel space,
and most applications favor fast communication over any other choice.
The fastest communication requires that the kernel and the user share
a single 4GB address space. The style of sharing is chosen by compile-
time parameters of the Linux kernel itself. The most common choice is
3GB user and 1GB kernel, although some servers having much RAM, and running
many hundreds of simultaneous small- and medium-sized processes, choose 2GB
user and 2GB kernel. The kernel must use its space to keep track of physical
RAM; 12GB of RAM requires lots of space for bookkeeping (3M entries
to track the pages of 4KB, etc.)

In the last few years there has been a "4G/4G" option which allows
something like (4GB - 16MB) of user space and (4GB - 16MB) of kernel space,
but it slows down system calls. Depending on load, the slowdown is often
10% to 25%. Most users who say that they want a full 4GB of user space
have been unwilling to pay that much in speed, and the 4G/4G split
is not used often.

Anyone who is really serious about processes running with more than
about 2.8GB of address space should use a 64-bit machine such as x86_64.
If you absolutely must use every last byte of address space on a 32-bit
machine, then you must pay close attention to fragmentation of the address
space. Consult /proc/<pid>/maps to see what happening, and
http://BitWagon.com/tub/tub.html for how to control it. 


So! Ultimately the about of memory depends on how your kernel was compiled.


----------



## af3 (Jun 18, 2008)

The ultimate answer, thanks!


----------



## LoneWolf071 (Nov 10, 2004)

It's not so much that OS as more the processor type. 32-bit Processors can only handle up to 4 billion addresses, which is roughly 4gig(With byte conversions it's less then 4gig). If you have a 32-bit OS, and a 64-bit processor it will still limit your RAM ability. Install a 64-bit OS and you will be able to use something like up to 2 Terabytes of RAM.


----------



## shuuhen (Sep 4, 2004)

Technically the number's a lot bigger than two terabytes. The theoretical limit to how much RAM a 64-bit processor can use should be something like 16 exabytes (about 16 million terabytes) of RAM. Worry less about how much Linux can handle and more about how much your motherboard can handle. :wink:

Although note that to get past 4 GB of RAM you need a 64-bit operating system. 32-bit operating systems will only address 4 GB (and as stated above, not all of it will be available for your programs - the OS and the addressing process need some of it).


----------



## af3 (Jun 18, 2008)

My question is, who would use more than 4GB besides someone running a huge server?


----------



## shuuhen (Sep 4, 2004)

af3 said:


> My question is, who would use more than 4GB besides someone running a huge server?


More of a question for the Offline section... 

I'm sure I'm not the only *nix user that wants more than 4 GB of RAM (currently only have 4 GB in my home machine). Most average users don't take full advantage of 4+ GB of RAM and new multicore processors. Some applications of having both of those are development (compiling large programs takes long time on low spec machines), scientific processing, film processing, etc.


----------



## lensman3 (Oct 19, 2007)

I use AutoCAD at work. Unfortunately, it only runs on 32 bit XP. When I do large 3-D renderings, I could use the non-paged ram so that the image is plotted quickly. AutoCAD (ver 2008) hasn't been ported to XP64 (yet).

The place it could and would be used is in large 3D image renderings.


----------



## brokencomputer (Nov 27, 2007)

so you guys basically mean that 4gb is slighty better than 3gb but 5gb is equivalent to 4gb (on a standard 32 bit machine)


----------



## af3 (Jun 18, 2008)

I believe that if you try to put 5GB into it, the software will only be able to use 4GB. (This is what I gather from the discussion)


----------



## shuuhen (Sep 4, 2004)

Yep. 4 GB is the limit for a 32-bit system. It'll probably just ignore the rest.

A 64-bit operating system will use more than 4 GB.


----------



## lensman3 (Oct 19, 2007)

brokencomputer said:


> so you guys basically mean that 4gb is slighty better than 3gb but 5gb is equivalent to 4gb (on a standard 32 bit machine)


A process can only use 4-gig. But I think the OS can swap processes into the 5-gig and use it all. The OS will keep track of which memory segments are being used for which process. I don't know is a 4 gig OS can use the swap space over 5 gig. The extra gig could be used for I/O buffers.

Don't know.


----------

