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

COMPILER, ASSEMBLER, LINKER AND LOADER: A BRIEF STORY

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: