Memory map of C++ programme

Default Image



When an object file is run on computer it uses four different areas of memory. Memory areas and their main uses are as follow:




  • First area of memory holds code of programme.



  • Second area is used to store global variables.



  • Third area used for stack. Stack holds the return address of
    function calls, arguments to functions and local variables. It is also
    used to save status of CPU.



  • Fourth area is used for heap. Heap
    is a free memory used for linked list and trees. Heap is used for
    dynamic allocation functions.


Read Count: 3 times

Comments

No comments yet.

Leave a Comment