I would like to launch a docker container that requires a lot of memory on a machine that doesn't have much RAM. I tried to increase the swap space available for the container to no avail. Here is the last command I tried:
docker run -d -m 1000M --memory-swap=10000M --name=my_container my_image
After these tips on how to check memory metrics, I found the following:
$ boot2docker ssh docker@boot2docker :~$ cat /sys/fs/cgroup/memory/docker/35af5a072751c7af80ce7a255a01ab3c14b3ee0e3f15341f7bb22a777091c67b/memory.stat cache 454656 rss 65015808 rss_huge 29360128 mapped_file 208896 writeback 0 swap 0 pgpgin 31532 pgpgout 22702 pgfault 49372 pgmajfault 0 inactive_anon 28672 active_anon 65183744 inactive_file 241664 active_file 16384 unevictable 0 hierarchical_memory_limit 1048576000 hierarchical_memsw_limit 10485760000 total_cache 454656 total_rss 65015808 total_rss_huge 29360128 total_mapped_file 208896 total_writeback 0 total_swap 0 total_pgpgin 31532 total_pgpgout 22702 total_pgfault 49372 total_pgmajfault 0 total_inactive_anon 28672 total_active_anon 65183744 total_inactive_file 241664 total_active_file 16384 total_unevictable 0
Is it possible to run a container that requires 5 GB of memory on a computer that has only 4G of physical memory?
memory docker boot2docker
Andrew
source share