-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lxc-start cannot allocate memory when free memory is available but no swap is available #2495
Comments
What are the values of |
ubuntu@ip-10-245-18-178: |
Okay, that's the reason why. This is explained in kernel docs (look for the documentation related to the You can address the issue by setting You can also allocate swap space; in that case, processes won't be killed, but if the memory usage grows too much, the system might become unresponsive. Btw, this is not specific to Docker; it's the case on any system with processes allocating (but not using) large amounts of memory (compared to the available physical memory+swap space). |
Awesome, thanks for clearing this up. I figured something in the kernel was preventing containers but I didn't have the ref. Thanks again. |
I have a similar problem, but "overcommit"-stuff doesn't help:
|
Never mind, sorry. The problem line was (in the config file):
|
At the moment my system has 6 GB of RAM available (free and cached) for applications. There is a running container launched from Docker consuming a fair amount of resources, about 7 GB of RAM resident. It's an GNU R process loading a bunch of data into memory. There is plenty of memory to start new containers but when I do so, I get the following error
docker run -i -t ubuntu /bin/bash
2013/10/31 17:54:15 Error: Error starting container 9ce27eb4f188: fork/exec /usr/bin/lxc-start: cannot allocate memory
From this point forward, no process on this host can start containers.
Notably, this host OS has no swap allocated. I assumed this wouldn't be necessary since there is so much RAM available. I allocated 15 GB of swap to test if this effects LXC and thus Docker. The memory allocation error disappeared.
Is there a connection between swap and container initialization?
The text was updated successfully, but these errors were encountered: