问题:

[root@localhost redis-4.0.0]# make 

cd src && make all
make[1]: Entering directory `/root/data/redis-4.0.0/src'
CC Makefile.dep
make[1]: Leaving directory `/root/data/redis-4.0.0/src'
make[1]: Entering directory `/root/data/redis-4.0.0/src'
CC adlist.o
In 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"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/root/data/redis-4.0.0/src'
make: *** [all] Error 2

 

解决方法:

# cd deps/

# make hiredis jemalloc linenoise lua geohash-int

#cd ..

#make

 

不要使用这样的解决方式:make MALLOC=libc

原因(摘自:http://www.jb51.net/article/100575.htm):

于tcmalloc,jemalloc和libc对应的三个内存分配器。其性能和碎片率如何呢?

下面是一个简单测试结果,使用Redis自带的redis-benchmark写入等量数据进行测试,数据摘自采用不同分配器时Redis info信息。

我们可以看到,采用tcmalloc时碎片率是最低的,为1.01,jemalloc为1.02,而libc的分配器碎片率为1.31,

 

相关文章:

  • 2022-01-08
  • 2021-05-01
  • 2021-11-28
  • 2018-07-25
  • 2022-12-23
  • 2022-01-08
  • 2022-02-07
  • 2021-10-06
猜你喜欢
  • 2022-01-03
  • 2022-12-23
  • 2019-01-09
  • 2021-07-14
  • 2021-07-16
  • 2022-01-04
相关资源
相似解决方案