about 2G memory problem and connection memory usage

Ryan Ordway ryan.ordway at oregonstate.edu
Wed Aug 8 01:54:03 UTC 2007

On 8/7/07 6:28 PM, "John.H" <xiaocong.hust at gmail.com> spake:

> Thanks Ryan.
So what will happen when I open the -m option with a number
> larger than 2G?
By the way,is that mean if I run memcached in a 64-bit OS,I
> should not open
-m option larger than 4G?

2007/8/8, Ryan Ordway
> <ryan.ordway at oregonstate.edu>:
> On 8/7/07 6:18 PM, "John.H"
> <xiaocong.hust at gmail.com> spake:
> > So,in a 32-bit OS ,it does have the 2G
> barrier?
> Why?
> Can you give some detail
> > infomation?
> Thanks, Ask.
> 2007/8/8, Ask Bjørn Hansen
> > <ask at develooper.com>:
> >
> >
> > On Aug 7,
> 2007, at 10:28, Brian P Brooks wrote:
> >
> > > Is there a reason why there
> is a 2G barrier?
> >
> > There isn't if you use a 64-bit OS.
> With a
> 32-bit OS, you cannot address more than 2GB of memory for a given
> process.
> Hence, the 2GB memory limit for memcached on a 32-bit OS.

Actually, I misspoke. The system itself is capable of addressing 4GB of RAM
with a 32-bit architecture. The 2GB limit is an OS imposed limit, depending
on your OS version. The 2.4 kernel had a 2GB/2GB split between kernel memory
and user space memory. Newer Linux kernels are able to address more. But you
still cannot address more than 2GB per process.

32-bit == 2^32 or ~ 4GB
64-bit == 2^64 or ~ 16 exabytes

64-bit OS/hardware gives you up to 17179869184 gigabytes or 16 exabytes of
addressable memory. I think you'll be good for a year or two, until the next
version of Windows comes out.

I've not tried it but you *might* be able to run multiple instances of
memcached on your system to utilize all of your memory. But remember that
the kernel needs memory too, so don't try to run a pair of 2GB memcached
instances. :-)

Ryan Ordway                          E-mail:   rordway at oregonstate.edu
Unix Systems Administrator             rordway at library.oregonstate.edu
OSU Libraries, Corvallis, OR 97370        Office: Valley Library #4657

More information about the memcached mailing list