[Autogenerated] let's examine the differences between
committed and reserved memory in more detail because this
is very important to understand.
Let's start with committed memory,
committed memory is guaranteed to be accessible.
The only way this could fail is if you access the particular page
in a different way than its protection allows.
So if your page is protected as read only and you try to write to it,
you're still going to get an exception,
but I'm going to put that aside for now and assume that page protection is
compatible with its access and so once you access that correctly,
there's no way committed memory access can fail.
It may reside on disk at some point in time.
In this case the patriots will be handled
transparently without you even noticing.
So this is done automatically.
You don't have to worry about it.
It just happens, this is consumed memory.
This is the thing that we actually waste and this counts towards the commit
limit that the system can handle and we'll see that later on.
Result memory on the other hand,
causes an access violation every time you try to access it
because there's really nothing there,
it's very cheap because you just take a range of addresses and mark
them as not being used for future allocations.
That's it.
And this is done by using something called virtual descriptor,
which is a way to represent an item in the address space and this is
called as a binary search tree or balanced binary search tree if you
care within the process object in the kernel,
as part of the way the memory manager managers knows the state
of the address space in a particular process.
New allocations will not happen in this particular range
that is being reserved unless you specify the address
explicitly as being part of that range, such as the case when thread stack grows.
Let's see the difference in a more explicit way by trying things out.