windows-nt/Source/XPSP1/NT/sdktools/clearmem
2020-09-26 16:20:57 +08:00
..
clearmem.c Add source files 2020-09-26 16:20:57 +08:00
clearmem.h Add source files 2020-09-26 16:20:57 +08:00
clearmem.rc Add source files 2020-09-26 16:20:57 +08:00
cmutl.c Add source files 2020-09-26 16:20:57 +08:00
cmutl.h Add source files 2020-09-26 16:20:57 +08:00
makefile Add source files 2020-09-26 16:20:57 +08:00
readme Add source files 2020-09-26 16:20:57 +08:00
sources Add source files 2020-09-26 16:20:57 +08:00

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

							    3/19/91
							    russbl


			    NT Clear Memory Utility



This is a utility for flushing the memory.


Program Structure & Theory of Operation
=======================================

The central routines are all in clearmem.c.

You will want to grab three routines:

    FlushCache	    - Principle routine for cache flushing, just
		      calls the next two routines

    AccesSection    - Creates a 16 mbyte portion of virtual memory
		      and reads all of it.  This uses all available
		      pages, causing the system cache to shrink to
		      its quota of 168 pages (672 k).

    ReadFlushFile   - Creates three files for flushing (FLUSH1,
		      FLUSH2, FLUSH3) if they do not exist in the
		      current directory.  Each is 256 kb long.
		      Reads the three files into the cache, replacing
		      every page in the cache with pages from the
		      three files.  The closes teh three files.

		      Currently CreateFile calls are made, since
		      OpenFile is not working at present.

		      Three files must be used since 256 kb is the
		      maximum the file systems will allow to be mapped
		      into the cache for any one file at any one time.

There are no global variables to worry about.  However, error routines
in cmutl.c are called for diagnostic purposes.	You will probably
wish to handle errors differently.  The usage of these is trivial
to spot.

FLUSH.CSH is a kernel debugger output showing that the cache working
set is indeed filled with only records from the three files (mapped
to C1a......) when the operation is completed.	(A write to the disk
is currently required to clear the cache completely of the three files
after they are closed.	This is a bug in NT and will be fixed.	In
FLUSH.CSH an mkdir is used to force this.  This bug does not affect
the clearing of the cache by filling it with the three, which happens
regardless.  This unimportant detail which may safely be ignored.)


Build Instructions:
===================

You may build clearmem.exe for test purposes.

    1.	cd \nt\private\sdktools\clearmem

    2.	build

The results will be in .\obj\i386.  You want the clearmem.exe in
this directory.


*** END OF README ***