Why is my system ignoring vm.swappiness?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have previously set vm.swappiness to 0, which should mean my system only swaps when RAM is totally full.



$ cat /etc/sysctl.d/99-sysctl.conf
kernel.sysrq = 1
vm.swappiness=0
$ sysctl vm.swappiness
vm.swappiness = 0


However, recently it's started swapping aggressively, even seconds after clearing swap with sudo swapoff -a; sudo swapon -a. For example, after a few hours,



$ free -m
total used free shared buff/cache available
Mem: 32047 7914 325 1509 23807 22177
Swap: 1974 1974 0


Hence, I have 22177 MiB available. From man free:




available



Estimation of how much memory is available for starting new applications, without swapping.




However, my system is still swapping heavily, using 1974 MiB of swap space and slowing everything down.



I've also tried setting vm.swappiness to 1, with similar results. I've also tried different kernels, including the recent 4.18.16.arch1-1, the LTS 4.14.78-1, and the previous few LTS versions. How can I prevent my system swapping unnecessarily?










share|improve this question



























    up vote
    0
    down vote

    favorite












    I have previously set vm.swappiness to 0, which should mean my system only swaps when RAM is totally full.



    $ cat /etc/sysctl.d/99-sysctl.conf
    kernel.sysrq = 1
    vm.swappiness=0
    $ sysctl vm.swappiness
    vm.swappiness = 0


    However, recently it's started swapping aggressively, even seconds after clearing swap with sudo swapoff -a; sudo swapon -a. For example, after a few hours,



    $ free -m
    total used free shared buff/cache available
    Mem: 32047 7914 325 1509 23807 22177
    Swap: 1974 1974 0


    Hence, I have 22177 MiB available. From man free:




    available



    Estimation of how much memory is available for starting new applications, without swapping.




    However, my system is still swapping heavily, using 1974 MiB of swap space and slowing everything down.



    I've also tried setting vm.swappiness to 1, with similar results. I've also tried different kernels, including the recent 4.18.16.arch1-1, the LTS 4.14.78-1, and the previous few LTS versions. How can I prevent my system swapping unnecessarily?










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have previously set vm.swappiness to 0, which should mean my system only swaps when RAM is totally full.



      $ cat /etc/sysctl.d/99-sysctl.conf
      kernel.sysrq = 1
      vm.swappiness=0
      $ sysctl vm.swappiness
      vm.swappiness = 0


      However, recently it's started swapping aggressively, even seconds after clearing swap with sudo swapoff -a; sudo swapon -a. For example, after a few hours,



      $ free -m
      total used free shared buff/cache available
      Mem: 32047 7914 325 1509 23807 22177
      Swap: 1974 1974 0


      Hence, I have 22177 MiB available. From man free:




      available



      Estimation of how much memory is available for starting new applications, without swapping.




      However, my system is still swapping heavily, using 1974 MiB of swap space and slowing everything down.



      I've also tried setting vm.swappiness to 1, with similar results. I've also tried different kernels, including the recent 4.18.16.arch1-1, the LTS 4.14.78-1, and the previous few LTS versions. How can I prevent my system swapping unnecessarily?










      share|improve this question















      I have previously set vm.swappiness to 0, which should mean my system only swaps when RAM is totally full.



      $ cat /etc/sysctl.d/99-sysctl.conf
      kernel.sysrq = 1
      vm.swappiness=0
      $ sysctl vm.swappiness
      vm.swappiness = 0


      However, recently it's started swapping aggressively, even seconds after clearing swap with sudo swapoff -a; sudo swapon -a. For example, after a few hours,



      $ free -m
      total used free shared buff/cache available
      Mem: 32047 7914 325 1509 23807 22177
      Swap: 1974 1974 0


      Hence, I have 22177 MiB available. From man free:




      available



      Estimation of how much memory is available for starting new applications, without swapping.




      However, my system is still swapping heavily, using 1974 MiB of swap space and slowing everything down.



      I've also tried setting vm.swappiness to 1, with similar results. I've also tried different kernels, including the recent 4.18.16.arch1-1, the LTS 4.14.78-1, and the previous few LTS versions. How can I prevent my system swapping unnecessarily?







      swap sysctl






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday

























      asked yesterday









      Sparhawk

      8,81863789




      8,81863789

























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481822%2fwhy-is-my-system-ignoring-vm-swappiness%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481822%2fwhy-is-my-system-ignoring-vm-swappiness%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown






          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)