C Program memory allocation

Source: Internet
Author: User

Process Memory layout (x86 schema)

--------------------------------------------------------------------------

0x08048000 Code. Text, codes, read-only

Data, whichcontains the already initialized, read-only

BSS. BSS, uninitialized data, initialized to 0, read / write

... Heap area, dynamically allocating acquired memory from . BSS to high-end memory growth

... (heap) , read / write

...

Stack stack area, starting address greater than 0xbfff0000

Arguments the formal parameters of main ()

Environment environment variable area

Program name Execve () first parameter, not argv[0]

0xBFFFFFFC Null (DWORD) The last four bytes are fixed to zero

0xC0000000

--------------------------------------------------------------------------

Of course, it also involves loading some dynamic libraries, either in the heap area or before the heap,

x86 is before the heap (that is, before 0x08048000), but if the dynamic library is too large, it is loaded into the heap, and arm is in the heap.

C Program memory allocation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.