Jim Sibley wrote:

>Out of curiosity, why doesn't Linux load from high memory down instead of
>the middle of the address space?

Because you have the heap (that some applications require to be contiguous)
growing upwards from low addresses, and the stack (that also needs to be
contiguous) growing downwards from high addresses, and then you need to
find a place where to put mmap()ed areas -- you want to neither artificially
limit heap growth nor stack growth, so place them right in the middle between
the two ...

Of course other decisions would have been possible, e.g. like Solaris does it:
put the stack at the top of the address space, but limit it to a fixed maximum
size, then place the mmap()s growing downward starting from the bottom of
the stack.

But each of those options has its own advantages and disadvantages; Linux's
way is just the way it is ...

Bye,
Ulrich

--
  Dr. Ulrich Weigand
  [EMAIL PROTECTED]

Reply via email to