From: Pavel Lebedinsky [MSFT] on
Generally, inactive pages backed by regular files are
flushed even sooner than pagefile backed pages
(because they are assumed to contain persistent data
that needs to be preserved in the event of power failure).
Pagefile backed pages are flushed only to free up memory.

As far as I can tell, FILE_ATTRIBUTE_TEMPORARY
affects only writes through the cache manager, so it
shouldn't make any difference in this scenario. (Even if it
did, the temporary attribute is not a guarantee that no
data will be written to disk - the memory manager can
still write it out to obtain more free pages, just like it does
for pagefile backed pages).

--
This posting is provided "AS IS" with no warranties, and confers no
rights.

"chaboud" wrote:

> It turns out that this is a larger problem than I previously thought.
>
> CreateFile() with the FILE_ATTRIBUTE_TEMPORARY and
> FILE_FLAG_DELETE_ON_CLOSE
> flags should make what Larry Osterman called a "temporary" temporary file,
> a
> file that is never written to disk.
>
> http://blogs.msdn.com/larryosterman/archive/2004/04/19/116084.aspx
>
> You can find a new version of the earlier code that makes use of a file
> made
> this way here:
> http://matthew.chaboud.com/junkdump/Temporary%20Temporary%20Hit.cpp
>
> To accentuate the problem, crank the buffer count up to something like 30.
> It still shows up for me with a buffer count of 5 (total file size of 50MB
> because of lazy doubling) on a machine with 4GB of RAM and only Visual
> Studio, Firefox, and Outlook running (i.e. very little memory pressure).