Question:

A process is organised in the memory from bottom to top ordering the following in correct order :
A. stack

B. text

C. data

D. heap

Choose the correct answer from the options given below :

Show Hint

To remember the order from bottom up, use the phrase "The Data Has Stacked." (Text, Data, Heap, Stack). Note that Heap and Stack grow toward each other to maximize memory utility.
Updated On: Aug 6, 2026
  • B, C, D, A
  • B, D, C, A
  • A, C, D, B
  • A, D, C, B
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Concept:

• When a program is loaded into memory as a process, it is divided into logical segments.
• In a standard UNIX process layout, memory addresses increase from "bottom" (low addresses) to "top" (high addresses).

Step 1:
Identify the bottom-most segment (B)
The Text segment (code) is placed at the lowest memory addresses to prevent it from being overwritten by heap or stack growth.

Step 2:
Identify the segment above code (C)
The Data segment (containing initialized and uninitialized global/static variables) is placed immediately above the text segment.

Step 3:
Identify the dynamically growing segment (D)
The Heap is used for dynamic memory allocation (e.g., malloc in C). It starts above the data segment and grows "upwards" toward higher addresses.

Step 4:
Identify the top-most segment (A)
The Stack is used for local variables and function calls. It is placed at the very top of the available address space and grows "downwards" toward the heap.

Step 5:
Arrange the sequence from bottom to top
The correct order is Text (B) $\rightarrow$ Data (C) $\rightarrow$ Heap (D) $\rightarrow$ Stack (A).
Was this answer helpful?
0
0

Top CUET PG Data Science A.I Cyber Security and Computer Sci. Questions

View More Questions

Top CUET PG Operating Systems Questions

View More Questions