{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/20144","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/20144/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/20144/comments","events_url":"https://api.github.com/repos/docker/docker/issues/20144/events","html_url":"https://github.com/docker/docker/issues/20144","id":132408333,"number":20144,"title":"Docker update memory constraints not honored","user":{"login":"wouterhund","id":976667,"avatar_url":"https://avatars.githubusercontent.com/u/976667?v=3","gravatar_id":"","url":"https://api.github.com/users/wouterhund","html_url":"https://github.com/wouterhund","followers_url":"https://api.github.com/users/wouterhund/followers","following_url":"https://api.github.com/users/wouterhund/following{/other_user}","gists_url":"https://api.github.com/users/wouterhund/gists{/gist_id}","starred_url":"https://api.github.com/users/wouterhund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wouterhund/subscriptions","organizations_url":"https://api.github.com/users/wouterhund/orgs","repos_url":"https://api.github.com/users/wouterhund/repos","events_url":"https://api.github.com/users/wouterhund/events{/privacy}","received_events_url":"https://api.github.com/users/wouterhund/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-09T12:30:30Z","updated_at":"2016-03-01T23:42:33Z","closed_at":"2016-03-01T23:42:33Z","body":"# BUG REPORT INFORMATION\r\n\r\n`docker version`:\r\n````\r\nClient:\r\n Version:      1.10.0\r\n API version:  1.22\r\n Go version:   go1.5.3\r\n Git commit:   590d5108\r\n Built:        Thu Feb  4 18:36:33 2016\r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      swarm/1.1.0\r\n API version:  1.22\r\n Go version:   go1.5.3\r\n Git commit:   a0fd82b\r\n Built:        Thu Feb  4 08:55:18 UTC 2016\r\n OS/Arch:      linux/amd64\r\n````\r\n`docker info`:\r\n````\r\nContainers: 7\r\n Running: 5\r\n Paused: 0\r\n Stopped: 2\r\nImages: 27\r\nRole: primary\r\nStrategy: spread\r\nFilters: health, port, dependency, affinity, constraint\r\nNodes: 1\r\n REDACTED: REDACTED:2376\r\n  └ Status: Healthy\r\n  └ Containers: 7\r\n  └ Reserved CPUs: 0 / 8\r\n  └ Reserved Memory: 12 GiB / 8.174 GiB\r\n  └ Labels: executiondriver=native-0.2, kernelversion=3.13.0-71-generic, operatingsystem=Ubuntu 14.04.3 LTS, storagedriver=aufs\r\n  └ Error: (none)\r\n  └ UpdatedAt: 2016-02-09T12:34:01Z\r\nPlugins: \r\n Volume: \r\n Network: \r\nKernel Version: 3.13.0-65-generic\r\nOperating System: linux\r\nArchitecture: amd64\r\nCPUs: 8\r\nTotal Memory: 8.174 GiB\r\nName: REDACTED\r\n````\r\n\r\nProvide additional environment details (AWS, VirtualBox, physical, etc.): Using Docker Swarm, but Swarm contains only one node so far\r\n\r\nList the steps to reproduce the issue:\r\n\r\n1. Create container with memory constraint of 2g (`docker run -m 2g ...`)\r\n2. Stop the container\r\n3. `docker update -m 4m containerId`\r\n4. `docker update -m 4g containerId`\r\n5. `docker start containerId`\r\n6. Repeat these steps until you have more containers running than your host can support. In my case 3*4g=12gb on a host with 8gb of memory.\r\n\r\nDescribe the results you received: Docker will start more containers than host has available memory\r\n\r\nDescribe the results you expected: Docker should not start more containers than the host has resources available for"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/190970272","html_url":"https://github.com/docker/docker/issues/20144#issuecomment-190970272","issue_url":"https://api.github.com/repos/docker/docker/issues/20144","id":190970272,"user":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"created_at":"2016-03-01T23:42:33Z","updated_at":"2016-03-01T23:42:33Z","body":"This is not a bug; memory limits apply to containers individually, i.e., it only limits what a container is allowed to consume. The total limit of all containers can exceed the available of the system. I don't think the documentation suggests that this isn't possible, but perhaps a note can be added if you think that'd clarify this; https://docs.docker.com/engine/reference/run/#user-memory-constraints\r\n\r\nI'll close this issue, because I think this works correctly, but feel free to comment here after I've closed"}}