[Autogenerated] we know that every process has its own
address space and it's pretty big,
especially for 64-bit process 128 terabytes is a lot of address
space but we know that actually using this address space is not that
easy in the sense that you have to have enough RAM and page files to
accommodate this much memory.
So obviously one of the main goals of the memory manager is to
conserve physical memory or RAM as much as possible,
everybody needs RAM and so it's a shared resource in the system,
so to speak.
And one of the ways the member manager is saving RAM is
by sharing it with multiple processes.
One of the simplest cases is sharing code.
So for example,
suppose we have process a here that is running some executable a dot e x e.
It could be anything like Notepad I'll obviously this a dot e x e has
to have the executable code mapped into the address space of the
process and when that code has to execute,
going to be brought into physical memory.
So here's an example of mapping that happens from the process,
address space somewhere into physical memory.
However, the process also needs to use many DLS such as the Windows subsystem.
DLS like kernel 32 G d i 32 kernel base, advanced, API and many others.
So this also will be loaded into the process and through space and
map to somewhere in physical memory in order to be able to execute
the code that is provided by those DLS now,
if we have another process,
let's say process B that's running a different executable like be dot e x e,
maybe something like paint.
Of course it has its own executable code,
it might be mapped to the same address in virtual address space.
However,
it has to be mapped to a different location in physical memory
because this is a different code is just different
instructions and that's kind of obvious.
However,
process be also needs to use many of the same subsystem DLS
used by processes such as kernel 32 dot Dll.
So in that case it would be mapped to exactly the same location in physical
memory and thus conserving physical memory because imagine you have
hundreds of processes on a typical window system,
which we do and all of them need to use kernel 32 G D I 32 many other
of these subsystem DLS it'd be very catastrophic.
Elif each one would have to be mapped to different locations in physical memory,
RAM would be exhausted fairly quickly.
And those uh, mapping are saving the day,
so to speak because that DLL code is going to be shared by all the process
need to use kernel 32 there's no need to have their own copy.
So it's just going to have one instance in RAM but will be shared
with all other processes that use the same DLL.
This allows conserving memory, conserving physical memory to a great extent