Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.1 KiB

  1. 3/19/91
  2. russbl
  3. NT Clear Memory Utility
  4. This is a utility for flushing the memory.
  5. Program Structure & Theory of Operation
  6. =======================================
  7. The central routines are all in clearmem.c.
  8. You will want to grab three routines:
  9. FlushCache - Principle routine for cache flushing, just
  10. calls the next two routines
  11. AccesSection - Creates a 16 mbyte portion of virtual memory
  12. and reads all of it. This uses all available
  13. pages, causing the system cache to shrink to
  14. its quota of 168 pages (672 k).
  15. ReadFlushFile - Creates three files for flushing (FLUSH1,
  16. FLUSH2, FLUSH3) if they do not exist in the
  17. current directory. Each is 256 kb long.
  18. Reads the three files into the cache, replacing
  19. every page in the cache with pages from the
  20. three files. The closes teh three files.
  21. Currently CreateFile calls are made, since
  22. OpenFile is not working at present.
  23. Three files must be used since 256 kb is the
  24. maximum the file systems will allow to be mapped
  25. into the cache for any one file at any one time.
  26. There are no global variables to worry about. However, error routines
  27. in cmutl.c are called for diagnostic purposes. You will probably
  28. wish to handle errors differently. The usage of these is trivial
  29. to spot.
  30. FLUSH.CSH is a kernel debugger output showing that the cache working
  31. set is indeed filled with only records from the three files (mapped
  32. to C1a......) when the operation is completed. (A write to the disk
  33. is currently required to clear the cache completely of the three files
  34. after they are closed. This is a bug in NT and will be fixed. In
  35. FLUSH.CSH an mkdir is used to force this. This bug does not affect
  36. the clearing of the cache by filling it with the three, which happens
  37. regardless. This unimportant detail which may safely be ignored.)
  38. Build Instructions:
  39. ===================
  40. You may build clearmem.exe for test purposes.
  41. 1. cd \nt\private\sdktools\clearmem
  42. 2. build
  43. The results will be in .\obj\i386. You want the clearmem.exe in
  44. this directory.
  45. *** END OF README ***
  46.