Docker工具箱无法分配内存

时间:2016-01-05 18:54:00

标签: docker boot2docker

我正在尝试让Docker在我的mac上本地运行一个容器,我一直在云端工作。我做了docker commit / save / load find。但是当我在安装docker工具箱后在本地运行它时,我得到了这个错误

docker logs es-loaded-with-data
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006c5330000, 4207738880, 0) failed; error='Cannot allocate memory' (errno=12)
Starting elasticsearch: #
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 4207738880 bytes for committing reserved memory.
# An error report file with more information is saved as:
# //hs_err_pid16.log

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006c5330000, 4207738880, 0) failed; error='Cannot allocate memory' (errno=12)
Starting elasticsearch: #

如果我docker info 然后我得到

  

总记忆:1.956 GiB

显然2 Gb是不够的。如何增加它以便我的容器运行?

2 个答案:

答案 0 :(得分:2)

Mac OS上的Docker在带有docker-machine(或更旧的boot2docker)的虚拟机VM中运行。我不确定docker-machine是否支持直接修改VM RAM,但您可以直接启动VirtualBox.app并修改VM Memory的数量。重新启动VMetvoilá。

答案 1 :(得分:0)

重启docker服务为我解决了这个问题。

相关问题