如何检查 ruby​​-2.6.3 是否使用 jemalloc ?我将 ruby​​-2.6.3 安装为 $ rvm install 2.6.3 -C --with-jemalloc [英] How to check ruby-2.6.3 is using jemalloc ? I installed ruby-2.6.3 as $ rvm install 2.6.3 -C --with-jemalloc

查看:43
本文介绍了如何检查 ruby​​-2.6.3 是否使用 jemalloc ?我将 ruby​​-2.6.3 安装为 $ rvm install 2.6.3 -C --with-jemalloc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个命令应该显示 -ljemalloc 但它不是.我可以用 ruby​​-2.4.3 和 ruby​​-2.5.x 看到它,但用 ruby​​-2.6.x 看不到

This command should show -ljemalloc but it is not. I could see it with ruby-2.4.3 and ruby-2.5.x but not with ruby-2.6.x

$ ruby -r rbconfig -e "puts RbConfig::CONFIG['LIBS']"
-lm                                                                                                                                    
$ cat /etc/environment


PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1

我正在使用 ubuntu 18 LTS 和其他 ruby​​ 版本,我得到了上面提到的 jemalloc 文件库

I am using ubuntu 18 LTS and with other ruby version , I am getting the jemalloc file library as mention above

推荐答案

在 ruby​​ 2.6.x 中,你必须检查 MAINLIBS,像这样:

In ruby 2.6.x, you have to check MAINLIBS, like this:

$ irb -rrbconfig
irb(main):004:0> RbConfig::CONFIG['MAINLIBS']
=> "-lz -lpthread -lrt -lrt -ljemalloc -lgmp -ldl -lcrypt -lm "

或者,当然,用你的单线:

or, of course, with your one-liner:

$ ruby -r rbconfig -e "puts RbConfig::CONFIG['MAINLIBS']"
-lz -lpthread -lrt -lrt -ljemalloc -lgmp -ldl -lcrypt -lm

这篇关于如何检查 ruby​​-2.6.3 是否使用 jemalloc ?我将 ruby​​-2.6.3 安装为 $ rvm install 2.6.3 -C --with-jemalloc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆