zoukankan      html  css  js  c++  java
  • redis 安装报错 jemalloc/jemalloc.h: No such file or directory。

    转:https://www.cnblogs.com/operationhome/default.html?page=3

    原作者:

    ------------------------------------------------------------

    对于redis安装的这个错误,我在博客redis 安装 与错误解决办法最后有提及,但是网上大部分文章的对这个问题的解答都是有误的。所以在这里单列出来。

    错误内容:

    jemalloc/jemalloc.h: No such file or directory。
    image

    文档

    针对这个错误,我们可以在README.md 文件中看到解释。

    ---------
    
    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
    
    Verbose build
    -------------

    网上错误解决办法

    网上大部分解决办法都是错误的,如下文:

    (错误解决办法)
    
    make MALLOC=libc

    正确解决办法

    正确解决办法(针对2.2以上的版本)
    清理上次编译残留文件,重新编译

    make distclean  && make

    导致出现这个错误的原因

      错误的本质是我们在开始执行make 时遇到了错误(大部分是由于gcc未安装),然后我们安装好了gcc 后,我们再执行make ,这时就出现了jemalloc/jemalloc.h: No such file or directory。这是因为上次的

    编译失败,有残留的文件,我们需要清理下,然后重新编译就可以了。

    网上的解决办法是有什么错误吗?

      网上的解决办法虽然最后也是可以成功安装好 redis ,但是是有一些隐患的,首先我们要知道redis 需要使用内存分配器的, make MALLOC=jemalloc 就是指定内存分配器为 jemalloc ,make MALLOC=libc 就是指定内存分配器为 libc ,这个是有安全隐患的,jemalloc 内存分配器在实践中处理内存碎片是要比libc 好的,而且在README.md 文档也说明到了,jemalloc内存分配器也是包含在源码包里面的,可以在deps 目录下看到 jemalloc 目录。

  • 相关阅读:
    Go语言踩过的坑---记录GOPATH在GOLAND中的坑
    反射小例子
    制作pip包
    mac常用软件安装链接
    YCSB压测elasticsearch
    SSO和Auth2.0
    JAVA内部类的四大作用
    修改fastadmin,添加模糊查询
    AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.2. Set the 'ServerName' directive globally to suppress this message
    taro3.x: 封装实现chat emit on
  • 原文地址:https://www.cnblogs.com/oxspirt/p/11392437.html
Copyright © 2011-2022 走看看