Memory immediately available in linux memory management system

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











up vote
0
down vote

favorite












This is the output of free -h command on my Ubuntu 18.04 laptop:



$ free -hg
total used free shared buff/cache available
Mem: 11G 4,2G 3,4G 801M 4,0G 6,3G
Swap: 11G 0B 11G


From what I understand after a short research using mostly stackexchange sites (e.g. this elaboration), the main difference among free and available memory is that free is actually free and available can become free if the need arises



What is the process via which the available memory is allocated to a task that creates the relevant need?



Does flushing dirty pages and freeing up cache, (to allocate the memory freed up to a process that requires it) constitute part of such a process?



In such a case I assume available should always be > cache.










share|improve this question



























    up vote
    0
    down vote

    favorite












    This is the output of free -h command on my Ubuntu 18.04 laptop:



    $ free -hg
    total used free shared buff/cache available
    Mem: 11G 4,2G 3,4G 801M 4,0G 6,3G
    Swap: 11G 0B 11G


    From what I understand after a short research using mostly stackexchange sites (e.g. this elaboration), the main difference among free and available memory is that free is actually free and available can become free if the need arises



    What is the process via which the available memory is allocated to a task that creates the relevant need?



    Does flushing dirty pages and freeing up cache, (to allocate the memory freed up to a process that requires it) constitute part of such a process?



    In such a case I assume available should always be > cache.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      This is the output of free -h command on my Ubuntu 18.04 laptop:



      $ free -hg
      total used free shared buff/cache available
      Mem: 11G 4,2G 3,4G 801M 4,0G 6,3G
      Swap: 11G 0B 11G


      From what I understand after a short research using mostly stackexchange sites (e.g. this elaboration), the main difference among free and available memory is that free is actually free and available can become free if the need arises



      What is the process via which the available memory is allocated to a task that creates the relevant need?



      Does flushing dirty pages and freeing up cache, (to allocate the memory freed up to a process that requires it) constitute part of such a process?



      In such a case I assume available should always be > cache.










      share|improve this question















      This is the output of free -h command on my Ubuntu 18.04 laptop:



      $ free -hg
      total used free shared buff/cache available
      Mem: 11G 4,2G 3,4G 801M 4,0G 6,3G
      Swap: 11G 0B 11G


      From what I understand after a short research using mostly stackexchange sites (e.g. this elaboration), the main difference among free and available memory is that free is actually free and available can become free if the need arises



      What is the process via which the available memory is allocated to a task that creates the relevant need?



      Does flushing dirty pages and freeing up cache, (to allocate the memory freed up to a process that requires it) constitute part of such a process?



      In such a case I assume available should always be > cache.







      linux-kernel memory free






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 17 at 20:16

























      asked Nov 17 at 18:25









      pkaramol

      430216




      430216




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          It’s a bit more complicated than that. Available memory is memory which is immediately reclaimable, i.e. can be re-purposed without losing data, minus certain thresholds below which the system swaps. This doesn’t include dirty pages, since they need to be written out, and that can take a lot of time.



          See the above link for details. In particular, the existence of thresholds, and the fact that “buff/cache” includes dirty pages, means that there is no guarantee that the available memory is larger than the amount given under “buff/cache”.






          share|improve this answer




















          • However can't the mmanagement module free memory from inactive(file), thus by flushing cache to hard disk? "inactive :The amount of inactive memory (in KB), or memory that has not been used for a while and is eligible to be swapped to disk." (from: bit.ly/2OTM4VW)
            – pkaramol
            Nov 17 at 20:17







          • 1




            “Inactive(file)” represents the inactive part of the page cache, i.e. file-backed memory which hasn’t been used recently. It isn’t dirty, so it can be discarded at any time (the data is stored elsewhere already).
            – Stephen Kitt
            Nov 17 at 22:17










          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%2f482373%2fmemory-immediately-available-in-linux-memory-management-system%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          It’s a bit more complicated than that. Available memory is memory which is immediately reclaimable, i.e. can be re-purposed without losing data, minus certain thresholds below which the system swaps. This doesn’t include dirty pages, since they need to be written out, and that can take a lot of time.



          See the above link for details. In particular, the existence of thresholds, and the fact that “buff/cache” includes dirty pages, means that there is no guarantee that the available memory is larger than the amount given under “buff/cache”.






          share|improve this answer




















          • However can't the mmanagement module free memory from inactive(file), thus by flushing cache to hard disk? "inactive :The amount of inactive memory (in KB), or memory that has not been used for a while and is eligible to be swapped to disk." (from: bit.ly/2OTM4VW)
            – pkaramol
            Nov 17 at 20:17







          • 1




            “Inactive(file)” represents the inactive part of the page cache, i.e. file-backed memory which hasn’t been used recently. It isn’t dirty, so it can be discarded at any time (the data is stored elsewhere already).
            – Stephen Kitt
            Nov 17 at 22:17














          up vote
          2
          down vote



          accepted










          It’s a bit more complicated than that. Available memory is memory which is immediately reclaimable, i.e. can be re-purposed without losing data, minus certain thresholds below which the system swaps. This doesn’t include dirty pages, since they need to be written out, and that can take a lot of time.



          See the above link for details. In particular, the existence of thresholds, and the fact that “buff/cache” includes dirty pages, means that there is no guarantee that the available memory is larger than the amount given under “buff/cache”.






          share|improve this answer




















          • However can't the mmanagement module free memory from inactive(file), thus by flushing cache to hard disk? "inactive :The amount of inactive memory (in KB), or memory that has not been used for a while and is eligible to be swapped to disk." (from: bit.ly/2OTM4VW)
            – pkaramol
            Nov 17 at 20:17







          • 1




            “Inactive(file)” represents the inactive part of the page cache, i.e. file-backed memory which hasn’t been used recently. It isn’t dirty, so it can be discarded at any time (the data is stored elsewhere already).
            – Stephen Kitt
            Nov 17 at 22:17












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          It’s a bit more complicated than that. Available memory is memory which is immediately reclaimable, i.e. can be re-purposed without losing data, minus certain thresholds below which the system swaps. This doesn’t include dirty pages, since they need to be written out, and that can take a lot of time.



          See the above link for details. In particular, the existence of thresholds, and the fact that “buff/cache” includes dirty pages, means that there is no guarantee that the available memory is larger than the amount given under “buff/cache”.






          share|improve this answer












          It’s a bit more complicated than that. Available memory is memory which is immediately reclaimable, i.e. can be re-purposed without losing data, minus certain thresholds below which the system swaps. This doesn’t include dirty pages, since they need to be written out, and that can take a lot of time.



          See the above link for details. In particular, the existence of thresholds, and the fact that “buff/cache” includes dirty pages, means that there is no guarantee that the available memory is larger than the amount given under “buff/cache”.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 17 at 18:40









          Stephen Kitt

          157k23343418




          157k23343418











          • However can't the mmanagement module free memory from inactive(file), thus by flushing cache to hard disk? "inactive :The amount of inactive memory (in KB), or memory that has not been used for a while and is eligible to be swapped to disk." (from: bit.ly/2OTM4VW)
            – pkaramol
            Nov 17 at 20:17







          • 1




            “Inactive(file)” represents the inactive part of the page cache, i.e. file-backed memory which hasn’t been used recently. It isn’t dirty, so it can be discarded at any time (the data is stored elsewhere already).
            – Stephen Kitt
            Nov 17 at 22:17
















          • However can't the mmanagement module free memory from inactive(file), thus by flushing cache to hard disk? "inactive :The amount of inactive memory (in KB), or memory that has not been used for a while and is eligible to be swapped to disk." (from: bit.ly/2OTM4VW)
            – pkaramol
            Nov 17 at 20:17







          • 1




            “Inactive(file)” represents the inactive part of the page cache, i.e. file-backed memory which hasn’t been used recently. It isn’t dirty, so it can be discarded at any time (the data is stored elsewhere already).
            – Stephen Kitt
            Nov 17 at 22:17















          However can't the mmanagement module free memory from inactive(file), thus by flushing cache to hard disk? "inactive :The amount of inactive memory (in KB), or memory that has not been used for a while and is eligible to be swapped to disk." (from: bit.ly/2OTM4VW)
          – pkaramol
          Nov 17 at 20:17





          However can't the mmanagement module free memory from inactive(file), thus by flushing cache to hard disk? "inactive :The amount of inactive memory (in KB), or memory that has not been used for a while and is eligible to be swapped to disk." (from: bit.ly/2OTM4VW)
          – pkaramol
          Nov 17 at 20:17





          1




          1




          “Inactive(file)” represents the inactive part of the page cache, i.e. file-backed memory which hasn’t been used recently. It isn’t dirty, so it can be discarded at any time (the data is stored elsewhere already).
          – Stephen Kitt
          Nov 17 at 22:17




          “Inactive(file)” represents the inactive part of the page cache, i.e. file-backed memory which hasn’t been used recently. It isn’t dirty, so it can be discarded at any time (the data is stored elsewhere already).
          – Stephen Kitt
          Nov 17 at 22:17

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482373%2fmemory-immediately-available-in-linux-memory-management-system%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

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?