The main agenda of an MIPS system’s memory allocation is to
place dynamically expandable segments as far as possible such that
they can grow as much as system’s entire space.

Hence, there are two parts of memory that can be dynamically
expanded which cannot be predicted by the compiler. They are:
dynamic data and stack segment.

The dynamic data’s memory is determined as the program executes.
This is the memory allocated to the program. Tis cannot be
determined by the compiler beforehand.

The stack segment’s memory is also determined by the following:
as the program pushes values on to the stack, the operating system
expands the stack segment down toward the data segment.

Hence, one possible way would be to exchange the memory spaces
for these two segments. Since, the two dynamically expandable data
segments should be as far as possible, shift the complete data
segment to the stack segment and the stack segment is moved to data
segment.