Because Ubuntu 21.10 ship with Cgroup V2 and my project seems to need memory limitations I decided to use it, but I have some problems. I need a lot of RAM to test an idea, so because my processor can't accept more than 128G ram I decided to get some RAM from another server as SWAP.
So I mounted a partition from 512G RAM on second server, and used NFS-server to let my first server to access it as a client. Those two servers have a 40Gbps connection between them so is enough speed for me to make the test. On the first server I mounted the NFS partition from the second server and made a swap file on it and I was ready to go with 128G ram and 512G swap.
After I started the test and past over the 128G ram, my server freeze because running utilities have no room to work in ram and I decided to limit the usage of memory with cgroup.

The problem: When I set MemoryHigh limit is working nice, after the limit, is going and fill the swap but is stops at the same limit as RAM. Somehow cgroup limit the use of SWAP at exactly same capacity as RAM memory. So if I set MemoryHigh=110G, I can go 110G on ram and 110G on swap, anyone knows how to config cgroup to let the swap unlimited ?
paint description image

  • My gut feeling is that if your project uses 110G RAM and 110G Swap, your project has a real problem... or has a memory leak. Are you manipulating large datasets in RAM? Or using a miner app?
    – heynnema
    Nov 24, 2021 at 14:24
  • No, is intend to use 450G ram. Is nothing wrong with it. At this moment i try to figure out how to unlimit swap memory from cgroup and I downgraded to ubuntu 20.04 to use older version of cgroup, maybe i have luck with it.
    – sniper
    Nov 24, 2021 at 18:21
  • @sniper Did you ever find a solution?
    – ATLief
    Mar 20, 2023 at 2:16


You must log in to answer this question.

Browse other questions tagged .