This image builds eatmemory so that you can specify the amount of MB as a docker env var.
1.6K
eatmemorySimple utility to allocate memory on a computer
cd /tmp
git clone https://github.com/julman99/eatmemory.git
cd eatmemory
sudo make install
eatmemory <size>
Size is in number of bytes, megabytes or gigabytes.
eatmemory 1024
eatmemory 10M
eatmemory 4G
Building the container
$ docker build . -t eatmemory
Running a container to eat 128MB:
$ docker run -d --name mycontainer eatmemory 128M
Check the memory consumption of the container:
$ docker stats --no-stream=true mycontainer
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
mycontainer 0.00% 133.9 MiB / 3.651 GiB 3.58% 2.01 kB / 1.08 kB 1.217 MB / 3.265 MB 4
Bitcoin Address: 14LFRrMX3HmyAH9zQsnzYoVKDH6bVWiBu3
Content type
Image
Digest
Size
38.1 MB
Last updated
almost 6 years ago
docker pull zoobab/eatmemory