Search code examples
memorydebianlimit

Enable memory limitation without grub


on my server

Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-1 (2016-03-06) unknown GNU/Linux

i want to turn on memory limitation (to limit memory usage by docker containers). All instructions how to do it refer to grub( e.g. ) and it works fine on all servers but one without grub installed. What is solution for enabling memory limitation without installing grub on this server? Subject of managing servers memory is quite new to me, so I will appreciate any help. Thanks in advance!


Solution

  • From the Docker documentation, you can see there is a --memory parameter you can specify which will limit the amount of memory that's available to Docker containers.

    -m, --memory="" Memory limit (format: []). Number is a positive integer. Unit can be one of b, k, m, or g. Minimum is 4M.

    Also, all this GRUB-related information you're reading is actually not about GRUB itself, it's about kernel boot parameters. They may be provided by any bootloader, such as LILO, it's just that GRUB is very common. You can read more on kernel parameters and how to set them using a variety of bootloaders here: https://wiki.archlinux.org/index.php/Kernel_parameters