Re: Using memory mapped files to quickly transfer data between pro

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Does FILE_FLAG_NO_BUFFERING makes any difference for memory mapping? Isn't
file caching and paging in done by memory manager? Or without the flag
page-ins will be done from the file cache (which I think won't)?

"Pavel Lebedinsky [MSFT]" <pavel@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:urG3wi6nJHA.5228@xxxxxxxxxxxxxxxxxxxxxxx
The reason I say the write had occurred is because after the second
process read all the bytes in the views and the first process exited
(the second process was still running and had the view still mapped
and loaded), from the command line executed the type command
on the file and it displayed the data the first process had written to
the views.

This is most likely because the type command opens the file in
cached mode. The cache manager then maps the file into memory
and satisfies read requsts using data that is already resident,
instead of going directly to disk.

If you want to check whether disk IO is really happening you can
use perfmon to monitor disk counters. Or even better, capture
an xperf disk trace - this will tell you exactly what files are being
written and when.

Also, I wouldn't specify FILE_FLAG_NO_BUFFERING when
opening the file. This flag should only used with regualr file IO
APIs like ReadFile.

--
Pavel Lebedinsky/Windows Kernel Test
This posting is provided "AS IS" with no warranties, and confers no
rights.



.



Relevant Pages

  • Re: [patch 0/5] Support for sanitization flag in low-level page allocator
    ... out will cost us a vast amount of extra kernel memory. ... Do you suggest a vma flag should be created for this as well? ... You don't need a page flag, just a per vma flag and something akin to ... be swapped to disk, by any means. ...
    (Linux-Kernel)
  • Proposed Assembler Commands
    ... ACM Automatically Clear Memory ... BKCRDR Backspace Card Reader ... BKSPD Backspace Disk ... EIAO Execute In Any Order ...
    (sci.electronics.design)
  • Re: Att. Alex Nichol -VM cont.
    ... I find documentation that says a 4kb page in memory is written to the hard ... manner that a 4kb memory page is equal to a 4kb cluster written on the disk". ... So where is the basis for saying since 4kb paging in memory that 4kb clusters ...
    (microsoft.public.windowsxp.general)
  • Re: Slow performance
    ... Leaving your computer on 24/7 means that if any programme has a memory ... The Disk Defragmenter report shows you have minimal free disk space. ... select Properties, General, Advanced and check the box before Compress ... Volume fragmentation ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Slow performance
    ... I realize that the pagefile usage is excessive and I need to reduce memory ... I've never messed with those settings before. ... Peak are greatly in excess of the installed RAM. ... The Disk Defragmenter report shows you have minimal free disk space. ...
    (microsoft.public.windowsxp.perform_maintain)