
报错二
root@temp redis-3.0.4# pwd
/usr/local/src/redis-3.0.4
root@temp redis-3.0.4# make
cd src && make all
make1: Entering directory `/usr/local/src/redis-3.0.4/src'
CC adlist.oIn file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make1: *** adlist.o Error 1
make1: Leaving directory `/usr/local/src/redis-3.0.4/src'
make: *** all Error 2
root@temp redis-3.0.4# echo $?
2
root@temp redis-3.0.4#
此问题是 Redis 默认会使用 jemalloc , 因为 jemalloc 被证明比 libc 有更少的碎片问题,但是我的系统中没有 jemalloc ,所以会出错
下面是来自源码中 README 的申明
Allocator
Selecting a non-default memory allocator when building Redis is done by setting
the MALLOC environment variable. Redis is compiled and linked against libc
malloc by default, with the exception of jemalloc being the default on Linux
systems. This default was picked because jemalloc has proven to have fewer
fragmentation problems than libc malloc.
To force compiling against libc malloc, use:
% make MALLOC=libcTo compile against jemalloc on Mac OS X systems, use:
% make MALLOC=jemalloc本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。