Previous page

Next page

Locate page in Contents

Print this page

Managing Container Memory Usage

The SLM mechanism allows you to manage the amount of memory a Container can consume by configuring a single parameter - slmmemorylimit . This significantly simplifies the process of memory management on the server and inside its Containers and represents the main SLM advantage over the old memory management mechanism (implemented on the basis of multiple UBC parameters). You can set or configure the Container memory usage limit by means of the --slmmemorylimit parameter of the pctl set command.

Let us assume that you wish to use SLM to manage the amount of memory which can be consumed by Container 101 and set its memory limit to 100 MB. This can be done by executing the following command:

# pctl set 101 --slmmemorylimit 102400000

Saved parameters for Container 101

By default, the memory limit to be allocated to your Container is set in bytes; however, you can change the default units of measurement by adding the following symbols after the value:

  • K : specifying this symbol after the value allows you to set the Container memory limit in kilobytes (e.g. 1000K ).
  • P : specifying this symbol after the value allows you to set the Container memory limit in pages (e.g. 200P ).
  • M : specifying this symbol after the value allows you to set the Container memory limit in megabytes (e.g. 100M ).
  • G : specifying this symbol after the value allows you to set the Container memory limit in gigabytes (e.g. 1G ).

After the memory limit has been successfully set for Container 101, you can view it by running the free command inside this Container:

# pctl exec 101 free

total used free shared buffers cached

Mem: 102400 46216 56184 0 10532 27748

-/+ buffers/cache: 17936 49748

Swap: 204800 0 204800

As can be seen from the example above, the specified memory limit is shown as the total memory available to Container 101.