Process Layout in a memory

Typically a process has 5 different areas of memory allocated

  1. Text segment – Code
  2. Data segment – Initialized data
  3. bss segment – Uninitialized data
  4. Heap
  5. Stack

The bss and data segments are allocated when the program is first loaded into memory, and their size does not change while it runs.

The heap and stack segments occupy the virtual memory above the text and data segments. The contents of the heap by contrast are volatile and change throughout the run, as dynamic memory operations are performed.

Important Tools:

  • size
  • nm
  • objdump
  • ldd (checks linked libraries with a binary)

Further Reading:

Anatomy of a Program in Memory



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: