Case study of virtual memory management

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











up vote
2
down vote

favorite
2












Need to understand virtual memory concept.



When a process requesting for 2GB mapping onto the virutal memory in Linux environment of 4GB ( 1GB Kernel : 3GB Userspace), when already another process already holds the mapping for 2 GB.



How does the mapping of the stack, heap, data segments all going to happen?
I am not able to find any example for my understanding.
Text book only mentions separately for each mapping but not a practical approach.










share|improve this question























  • I don't think I understand your question. In a 32-bit environment (address space 4GiB total), if a process already holds a mapping of size 2GB and it requests another mapping of size 2GB, then the second mapping will simply fail. There isn't enough space. That's all there is to it.
    – Celada
    Jun 16 '15 at 7:10










  • sorry for the confusion, its not the same process requesting another mapping. Its one process requesting mapping while another already holds the mapping
    – Madara
    Jun 16 '15 at 8:27















up vote
2
down vote

favorite
2












Need to understand virtual memory concept.



When a process requesting for 2GB mapping onto the virutal memory in Linux environment of 4GB ( 1GB Kernel : 3GB Userspace), when already another process already holds the mapping for 2 GB.



How does the mapping of the stack, heap, data segments all going to happen?
I am not able to find any example for my understanding.
Text book only mentions separately for each mapping but not a practical approach.










share|improve this question























  • I don't think I understand your question. In a 32-bit environment (address space 4GiB total), if a process already holds a mapping of size 2GB and it requests another mapping of size 2GB, then the second mapping will simply fail. There isn't enough space. That's all there is to it.
    – Celada
    Jun 16 '15 at 7:10










  • sorry for the confusion, its not the same process requesting another mapping. Its one process requesting mapping while another already holds the mapping
    – Madara
    Jun 16 '15 at 8:27













up vote
2
down vote

favorite
2









up vote
2
down vote

favorite
2






2





Need to understand virtual memory concept.



When a process requesting for 2GB mapping onto the virutal memory in Linux environment of 4GB ( 1GB Kernel : 3GB Userspace), when already another process already holds the mapping for 2 GB.



How does the mapping of the stack, heap, data segments all going to happen?
I am not able to find any example for my understanding.
Text book only mentions separately for each mapping but not a practical approach.










share|improve this question















Need to understand virtual memory concept.



When a process requesting for 2GB mapping onto the virutal memory in Linux environment of 4GB ( 1GB Kernel : 3GB Userspace), when already another process already holds the mapping for 2 GB.



How does the mapping of the stack, heap, data segments all going to happen?
I am not able to find any example for my understanding.
Text book only mentions separately for each mapping but not a practical approach.







linux-kernel virtual-memory






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 17 at 2:15









Rui F Ribeiro

38.2k1475123




38.2k1475123










asked Jun 16 '15 at 6:41









Madara

134




134











  • I don't think I understand your question. In a 32-bit environment (address space 4GiB total), if a process already holds a mapping of size 2GB and it requests another mapping of size 2GB, then the second mapping will simply fail. There isn't enough space. That's all there is to it.
    – Celada
    Jun 16 '15 at 7:10










  • sorry for the confusion, its not the same process requesting another mapping. Its one process requesting mapping while another already holds the mapping
    – Madara
    Jun 16 '15 at 8:27

















  • I don't think I understand your question. In a 32-bit environment (address space 4GiB total), if a process already holds a mapping of size 2GB and it requests another mapping of size 2GB, then the second mapping will simply fail. There isn't enough space. That's all there is to it.
    – Celada
    Jun 16 '15 at 7:10










  • sorry for the confusion, its not the same process requesting another mapping. Its one process requesting mapping while another already holds the mapping
    – Madara
    Jun 16 '15 at 8:27
















I don't think I understand your question. In a 32-bit environment (address space 4GiB total), if a process already holds a mapping of size 2GB and it requests another mapping of size 2GB, then the second mapping will simply fail. There isn't enough space. That's all there is to it.
– Celada
Jun 16 '15 at 7:10




I don't think I understand your question. In a 32-bit environment (address space 4GiB total), if a process already holds a mapping of size 2GB and it requests another mapping of size 2GB, then the second mapping will simply fail. There isn't enough space. That's all there is to it.
– Celada
Jun 16 '15 at 7:10












sorry for the confusion, its not the same process requesting another mapping. Its one process requesting mapping while another already holds the mapping
– Madara
Jun 16 '15 at 8:27





sorry for the confusion, its not the same process requesting another mapping. Its one process requesting mapping while another already holds the mapping
– Madara
Jun 16 '15 at 8:27











1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Let's assume that we have 3 GiB of virtual address space available and that a process' text, stack, heap, and prior memory mappings together occupy only a small amount of address space (much less than 1 GiB). Then if this process requests a mapping of size 2GB then there is no problem, there is plenty of space to accommodate that mapping.



(Actually, there would be one small case where this is not true: if the process' existing mappings were fragmented and scattered around the address space and there was no contiguous 2GB range of addresses available. But that's unlikely).



What mappings are or are not present in a different process' address space has nothing to do with it.






share|improve this answer




















    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%2f209928%2fcase-study-of-virtual-memory-management%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
    1
    down vote



    accepted










    Let's assume that we have 3 GiB of virtual address space available and that a process' text, stack, heap, and prior memory mappings together occupy only a small amount of address space (much less than 1 GiB). Then if this process requests a mapping of size 2GB then there is no problem, there is plenty of space to accommodate that mapping.



    (Actually, there would be one small case where this is not true: if the process' existing mappings were fragmented and scattered around the address space and there was no contiguous 2GB range of addresses available. But that's unlikely).



    What mappings are or are not present in a different process' address space has nothing to do with it.






    share|improve this answer
























      up vote
      1
      down vote



      accepted










      Let's assume that we have 3 GiB of virtual address space available and that a process' text, stack, heap, and prior memory mappings together occupy only a small amount of address space (much less than 1 GiB). Then if this process requests a mapping of size 2GB then there is no problem, there is plenty of space to accommodate that mapping.



      (Actually, there would be one small case where this is not true: if the process' existing mappings were fragmented and scattered around the address space and there was no contiguous 2GB range of addresses available. But that's unlikely).



      What mappings are or are not present in a different process' address space has nothing to do with it.






      share|improve this answer






















        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        Let's assume that we have 3 GiB of virtual address space available and that a process' text, stack, heap, and prior memory mappings together occupy only a small amount of address space (much less than 1 GiB). Then if this process requests a mapping of size 2GB then there is no problem, there is plenty of space to accommodate that mapping.



        (Actually, there would be one small case where this is not true: if the process' existing mappings were fragmented and scattered around the address space and there was no contiguous 2GB range of addresses available. But that's unlikely).



        What mappings are or are not present in a different process' address space has nothing to do with it.






        share|improve this answer












        Let's assume that we have 3 GiB of virtual address space available and that a process' text, stack, heap, and prior memory mappings together occupy only a small amount of address space (much less than 1 GiB). Then if this process requests a mapping of size 2GB then there is no problem, there is plenty of space to accommodate that mapping.



        (Actually, there would be one small case where this is not true: if the process' existing mappings were fragmented and scattered around the address space and there was no contiguous 2GB range of addresses available. But that's unlikely).



        What mappings are or are not present in a different process' address space has nothing to do with it.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 16 '15 at 8:44









        Celada

        30.2k46383




        30.2k46383



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f209928%2fcase-study-of-virtual-memory-management%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?