[Autogenerated] there is much more flexibility with the user
mode stack as opposed to a kernel stack.
And that's because user mode stack doesn't have to be
in physical memory at all times.
So here's an example of what that might look like
when we set up a user mode stack, we can set it up to have almost any size.
But we don't want to commit to actually allocate that memory up front
because maybe the threat will not need the entire stack space.
So we have two sizes here.
One of them is the reserve size, that's the maximum size of the stack.
The stack and grow too.
And then we have the committed size which is the
part that is currently allocated.
So what is reserved memory,
reserved memory just means there is a continuous range of
addresses that are reserved for a certain purpose in this
case that purpose is a stack.
So that other allocations in the process will not use those addresses
because the stack has to be continuous in future memory.
And by default the numbers that are used are one megabyte as the
maximum stock size where only the first page,
four kilobytes are committed.
And the way the stack grows is using this mechanism called the guard.
Page a guard pages yet another committed page that has a
special flag on it called page guard.
And when the threat touches that memory,
that page it raises an exception that is caught by the colonel's memory
manager and that memory manager increases the stack size pushing the page
guy forward or downwards in memory if you look at that from the
perspective of inter Omd architectures,
and so the stack continues to grow as needed.
And we don't waste memory up front because result memory is really cheap.
There's nothing there.
It's just a range of addresses that the member manager knows not
to use for any other purpose in the process.