-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reserved Memory not release #1217
Comments
Hi @kevinsimper, Yes if you want that chunk of memory to be released you need to explicitly remove the container. The reason why is that a container might have a |
Okay, that makes sense, but I can't read that anywhere? I did From what i read here, memory is not calculated together either? Or am i wrong? https://docs.docker.com/reference/run/#memory-constraints |
@kevinsimper I admit that somehow this should be configurable but as of now, resource accounting was conservative regarding the container state. You can put 10 containers on a 2GB machine but just make sure that some containers are not lurking around holding up resources. Usually you would like to clean and remove containers in the In the meantime I'm migrating the resource accounting to be done by the Swarm Manager directly in #1212 so there might be a window to allow a resource chunk to be released on container |
Okay that sounds good! However, I was not talking about containers that has For an example, 10 golang web servers could only take up 1 GB, so they could easily fit on a 2 GB server, I just don't one 1 golang server to leak and take up all 2 GB. |
@kevinsimper You can put soft memory limits on a container, docker allows that (so you put a lower/upper bound memory limit to your container). This might help in this case. Haven't tried on swarm though, this might require a change on the client. Curious to see! |
I just tried, and docker puts the soft limit on, but does not limit the overall system. So docker swarm needs a option to allow that :) |
+1 for overall limitation config |
this was documented in #1520 I'm not sure such a flag makes sense in a clustering environment. |
Closing: the question was answered and the docs were updated (#1520) |
@amitshukla This should be reopened because it was not solved in #1520. #1520 only talks about how containers are placed but nothing about memory How is a server with 1 GB of ram and 2 GB swap used and calculated? |
Containers that have exited still take up reserved memory, is that correct?
Exited (137) 35 minutes ago
The text was updated successfully, but these errors were encountered: