简体   繁体   中英

available memory when attached to docker container is less than container limit

when i start a container like this:

docker run -d --memory=6g $image ,

docker stats $container_id shows that it has a memory limit of 6gb, which is expected.

however, when i connect into that container ( docker exec -it $container_id /bin/bash ), my shell is limited to only 1gb. (which is confirmed by calling free -m as well as some testing in allocating objects in python [it fails at around 1gb]).

my question is: how can i get access to all of the memory available in the container?

thank you.

ok, in this case, even though docker stats was showing that my container had 6gbs, the virtual machine on which docker was running was limited to 1gb. so i changed my virtual machine limitations and solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM