最新消息:vps推荐

Redis编译zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory错误

redis Terry 470浏览 0评论

编译安装Redis时报zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory错误如图:

redis编译错误

解决方案:编译时使用如下命令

make MALLOC=libc

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=libc

To compile against jemalloc on Mac OS X systems, use:

% make MALLOC=jemalloc

Redis默认情况下使用jemalloc内存分配器,因为jemalloc的碎片问题比libc要少,如果没有jemalloc就会编译报错,使用libc就可以了

转载请注明:Terry's blog » Redis编译zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory错误

发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址