Why are “program images and shared libraries” “considered private to a process” but “shared (SHR) by the kernel”?

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











up vote
0
down vote

favorite












In the manpage of top,



  • Why are "program images and shared libraries" in #3 "considered private to a process", if "they will be accounted for as shared (SHR) by the kernel"?


  • In what "private" sense are "program images and shared libraries" "considered private to a process"? Are "program images and shared libraries" read only?


  • In what "shared" sense are "program images and shared libraries" "accounted for as shared (SHR) by the kernel"?


  • "the swap file only includes #1 through #3. The memory in quadrant #4, when modified, acts as its own dedicated swap file." Do "program images and shared libraries" act as their own dedicated swap files too?


Thanks.




For each such process, every memory page is restricted to a single
quadrant from the table below. Both physical memory and virtual

memory can include any of the four, while the swap file only includes #1 through #3. The memory in quadrant #4, when modified, acts as its own dedicated swap file.



 Private | Shared
1 | 2
Anonymous . stack |
. malloc() |
. brk()/sbrk() | . POSIX shm*
. mmap(PRIVATE, ANON) | . mmap(SHARED, ANON)
-----------------------+----------------------
. mmap(PRIVATE, fd) | . mmap(SHARED, fd)
File-backed . pgms/shared libs |
3 | 4


The following may help in interpreting process level memory values
displayed as scalable columns and discussed under topic `3a.DESCRIPTIONS of Fields'.



 SHR - subset of RES (excludes 1, includes all 2 & 4, some 3)


Note: Even though program images and shared libraries are considered
private to a process, they will be accounted for as shared (SHR) by
the kernel.











share|improve this question

























    up vote
    0
    down vote

    favorite












    In the manpage of top,



    • Why are "program images and shared libraries" in #3 "considered private to a process", if "they will be accounted for as shared (SHR) by the kernel"?


    • In what "private" sense are "program images and shared libraries" "considered private to a process"? Are "program images and shared libraries" read only?


    • In what "shared" sense are "program images and shared libraries" "accounted for as shared (SHR) by the kernel"?


    • "the swap file only includes #1 through #3. The memory in quadrant #4, when modified, acts as its own dedicated swap file." Do "program images and shared libraries" act as their own dedicated swap files too?


    Thanks.




    For each such process, every memory page is restricted to a single
    quadrant from the table below. Both physical memory and virtual

    memory can include any of the four, while the swap file only includes #1 through #3. The memory in quadrant #4, when modified, acts as its own dedicated swap file.



     Private | Shared
    1 | 2
    Anonymous . stack |
    . malloc() |
    . brk()/sbrk() | . POSIX shm*
    . mmap(PRIVATE, ANON) | . mmap(SHARED, ANON)
    -----------------------+----------------------
    . mmap(PRIVATE, fd) | . mmap(SHARED, fd)
    File-backed . pgms/shared libs |
    3 | 4


    The following may help in interpreting process level memory values
    displayed as scalable columns and discussed under topic `3a.DESCRIPTIONS of Fields'.



     SHR - subset of RES (excludes 1, includes all 2 & 4, some 3)


    Note: Even though program images and shared libraries are considered
    private to a process, they will be accounted for as shared (SHR) by
    the kernel.











    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      In the manpage of top,



      • Why are "program images and shared libraries" in #3 "considered private to a process", if "they will be accounted for as shared (SHR) by the kernel"?


      • In what "private" sense are "program images and shared libraries" "considered private to a process"? Are "program images and shared libraries" read only?


      • In what "shared" sense are "program images and shared libraries" "accounted for as shared (SHR) by the kernel"?


      • "the swap file only includes #1 through #3. The memory in quadrant #4, when modified, acts as its own dedicated swap file." Do "program images and shared libraries" act as their own dedicated swap files too?


      Thanks.




      For each such process, every memory page is restricted to a single
      quadrant from the table below. Both physical memory and virtual

      memory can include any of the four, while the swap file only includes #1 through #3. The memory in quadrant #4, when modified, acts as its own dedicated swap file.



       Private | Shared
      1 | 2
      Anonymous . stack |
      . malloc() |
      . brk()/sbrk() | . POSIX shm*
      . mmap(PRIVATE, ANON) | . mmap(SHARED, ANON)
      -----------------------+----------------------
      . mmap(PRIVATE, fd) | . mmap(SHARED, fd)
      File-backed . pgms/shared libs |
      3 | 4


      The following may help in interpreting process level memory values
      displayed as scalable columns and discussed under topic `3a.DESCRIPTIONS of Fields'.



       SHR - subset of RES (excludes 1, includes all 2 & 4, some 3)


      Note: Even though program images and shared libraries are considered
      private to a process, they will be accounted for as shared (SHR) by
      the kernel.











      share|improve this question













      In the manpage of top,



      • Why are "program images and shared libraries" in #3 "considered private to a process", if "they will be accounted for as shared (SHR) by the kernel"?


      • In what "private" sense are "program images and shared libraries" "considered private to a process"? Are "program images and shared libraries" read only?


      • In what "shared" sense are "program images and shared libraries" "accounted for as shared (SHR) by the kernel"?


      • "the swap file only includes #1 through #3. The memory in quadrant #4, when modified, acts as its own dedicated swap file." Do "program images and shared libraries" act as their own dedicated swap files too?


      Thanks.




      For each such process, every memory page is restricted to a single
      quadrant from the table below. Both physical memory and virtual

      memory can include any of the four, while the swap file only includes #1 through #3. The memory in quadrant #4, when modified, acts as its own dedicated swap file.



       Private | Shared
      1 | 2
      Anonymous . stack |
      . malloc() |
      . brk()/sbrk() | . POSIX shm*
      . mmap(PRIVATE, ANON) | . mmap(SHARED, ANON)
      -----------------------+----------------------
      . mmap(PRIVATE, fd) | . mmap(SHARED, fd)
      File-backed . pgms/shared libs |
      3 | 4


      The following may help in interpreting process level memory values
      displayed as scalable columns and discussed under topic `3a.DESCRIPTIONS of Fields'.



       SHR - subset of RES (excludes 1, includes all 2 & 4, some 3)


      Note: Even though program images and shared libraries are considered
      private to a process, they will be accounted for as shared (SHR) by
      the kernel.








      linux top virtual-memory






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 14 mins ago









      Tim

      24.3k69238426




      24.3k69238426

























          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f478533%2fwhy-are-program-images-and-shared-libraries-considered-private-to-a-process%23new-answer', 'question_page');

          );

          Post as a guest



































          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%2f478533%2fwhy-are-program-images-and-shared-libraries-considered-private-to-a-process%23new-answer', 'question_page');

          );

          Post as a guest













































































          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?