Large memory support
Brad Fitzpatrick
brad@danga.com
Wed, 18 Feb 2004 21:37:36 -0800 (PST)
Jason,
I've built and run memcached on 64-bit machines.
On a 32-bit machine you won't be able to store more memory than your
operating system is giving you address space for. (Not sure if
your OS is giving you a 2G/2G, 3G/1G, or 3.5G/0.5G split)
I assume you're on 32-bit? Otherwise, isn't an "unsigned long" just a
uint64 on 64-bi machines? Or should we be using void* somewhere we're
using unsigned int?
Let me know your OS, arch, and the contents of "stats maps" (if on Linux):
$ telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
stats maps
08048000-08050000 r-xp 00000000 03:03 2167117 /usr/local/bin/memcached-1.1.10pre2
08050000-08051000 rw-p 00008000 03:03 2167117 /usr/local/bin/memcached-1.1.10pre2
08051000-09c02000 rwxp 00000000 00:00 0
40000000-40011000 r-xp 00000000 03:03 165006 /lib/ld-2.3.1.so
40011000-40012000 rw-p 00011000 03:03 165006 /lib/ld-2.3.1.so
40017000-4011f000 r-xp 00000000 03:03 165009 /lib/libc-2.3.1.so
4011f000-40125000 rw-p 00107000 03:03 165009 /lib/libc-2.3.1.so
40125000-40128000 rw-p 00000000 00:00 0
40128000-40131000 r-xp 00000000 03:03 165014 /lib/libnss_compat-2.3.1.so
40131000-40132000 rw-p 00009000 03:03 165014 /lib/libnss_compat-2.3.1.so
40132000-40142000 r-xp 00000000 03:03 165013 /lib/libnsl-2.3.1.so
40142000-40143000 rw-p 00010000 03:03 165013 /lib/libnsl-2.3.1.so
40143000-80946000 rw-p 00000000 00:00 0
bfffc000-c0000000 rwxp ffffd000 00:00 0
END
- Brad
On Wed, 18 Feb 2004, Jason Titus wrote:
> Looks like we just stumbled onto some 32 bit limits in memcached. Just
> wondering how you guys want to deal with supporting >2GB per cache. We
> have experimented with switching some of the unsigned ints into unsigned
> long longs and it seemed to work (>4GB seemed ok. No thorough testing
> yet though). A cleaner solution might be adjusting the memory related
> variables to size_t or some such so that they work well on 32 and 64 bit
> systems.
>
> What makes the most sense to you folks?
>
> Jason
>
>