[Autogenerated] let's begin by examining memory mapped files.
Memory files is the terms used in user mode for the same thing that is called
section in the Windows kernel driver documentation basically these object types
in the kernel allow us to map files into memory,
create views of a file into memory.
And the idea here is that you can access the content in the file
using pointers rather than using IOPS and that's much more
convenient because IOPS are very cumbersome.
You call something something like read file to read some data,
then you have the file point in moving forward,
you call read file again to read some more data.
The file pointer moves forward again and then if you want to go back you have
to you have to call other APIs such as set file pointer and so it's not very
convenient you need to travel the file in a kind of random access or not
necessarily predictable way with the pointers,
you have much more flexibility,
you have all the memory related API such as mem copy ma'am said,
move and so on.
You can also do pointer arithmetic very easily to move around the file or the
contents of the file forwards or backwards very easily.
That's one thing you can get by getting that mapping to to take place.
This also implies that you can share memory because
if you map a file into a view,
you can have other processes mapping the same file into other views.
So essentially you can share memory by just reading writing from the same file
using those views and this is much more efficient than using the actual I O
APIs which is perhaps another way to show share.
But in the case of memory files,
you get perfect coherence and so you make a change,
it is already immediately visible because the change is actually in memory.
It's not being written to the final file unless it's really needed.
System is low on memory or you force some kind of flashing
operation and so it's possible to share memory.
In fact,
that's the different thing that happens when you map executable DLS or P images.
In fact, every DLL you're using is being mapped using section objects.
That's always the case.
That's also an explanation why DLL cannot be deleted while you're using
it because it's being mapped saying goes for executable soapy images
are always mapped using section objects.
Even though this happens behind the scenes now,
it doesn't have to be a file backing up.
The shared memory could be just the page file,
the page file provided by windows,
which means we can share memory without persisting it anywhere.
And once all the handles to the section objects are closed,
the memory kind of gets recycled within the page file,
so to speak, it goes away.
So having a file as the backup for the shared
memory for the mapping is optional.
You can do either that or the other,
depending on whether you want to keep the data later on for
perhaps some kind of offline analysis After all,
the views are closed to the file.
And so this is what happens if you're just using the page file as the backup.