我已在 Ubuntu 服务器(1 GB 内存/30 GB 磁盘/NYC2 - Ubuntu 14.04.4 x64)上成功安装 JRuby 9.0.5.0
。当我尝试安装一些 gem 时在命令提示符下。例如 bundler
gem install bundle
它返回内存不足错误:
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00, 65536, 1) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 65536 bytes for committing reserved memory.
如何增加内存设置以安装所需的 gem?
感谢您的帮助。
最佳答案
您以 Java 方式增加 head,并添加 -J 前缀...例如-J-Xmx624M
话虽这么说,JRuby(至少 9.0.5)会自动设置 500MB 上限,这似乎与分配 native 内存有关。很难确切地说出发生了什么,也许如果还有其他进程在运行,那么 JRuby 就没有足够的内存来启动和加载 RG(在 gem install ...
上)
关于rubygems - JRuby 内存不足,无法支持 Java 运行时环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36789627/