How to see memory allotment for Docker Engine?

Viewed 1584
2 Answers

I had same problem, with Docker Desktop on Windows 10 while running Linux containers on WSL2.

I found this issue: https://github.com/elastic/elasticsearch-docker/issues/92 and tried to apply similar logic to the solution of there.

I entered the WSL instance's terminal by wsl -d docker-desktop command. Later I run sysctl -w vm.max_map_count=262144 command to set 'allotted memory'.

After these steps I could run elasticsearch's docker compose example.

I'd like to go about it by just using one command.

 docker stats -all

This will give a output such as following

$ docker stats -all

CONTAINER ID        NAME           CPU%  MEM USAGE/LIMIT   MEM%   NET I/O BLOCK I/O PIDS
5f8a1e2c08ac my-compose_my-nginx_1 0.00% 2.25MiB/1.934GiB 0.11% 1.65kB/0B 7.35MB/0B  2

To modify the limits : when you're making your docker-compose.yml include the following at the end of your file. (if you'd like to set up a 4 GiB limit)

resources:
limits:
memory: 4048m
reservations:
memory: 4048m
Related