[systemd-devel] nspawn container sees total host memory instead of MemoryMax value
Paulo Coghi - Coghi IT
paulocoghi at gmail.com
Sun Aug 6 22:33:44 UTC 2023
Ok, thanks for the clarification.
On Sun, Aug 6, 2023 at 10:32 PM Mantas Mikulėnas <grawity at gmail.com> wrote:
> As far as I know, that's normal – /proc/meminfo always reflects the total
> amount of memory, regardless of cgroup limits. LXC uses lxcfs to mount a
> fake meminfo file there, nspawn doesn't have an equivalent.
>
> On Sun, Aug 6, 2023, 18:55 Paulo Coghi - Coghi IT <paulocoghi at gmail.com>
> wrote:
>
>> I used "systemctl set-property
>> systemd-nspawn at my-container-real-name.service MemoryMax=2G", to test
>> defining a limit on RAM usage of a nspawn container.
>>
>> But after setting the limit, with the config being created at
>> "/etc/systemd/system.control/" correctly, when I start the container and
>> enter on it, the "free" command still shows the memory info from the host.
>>
>> Is this correct? If yes, is there a way to make the container to show
>> only the memory separated to it?
>>
>> Paulo Coghi
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20230807/e5495961/attachment.htm>
More information about the systemd-devel
mailing list