0

I'm trying to disable windows file write cache. I have disabled the Sysmain service, disabled Prefetch in registry (EnablePrefetcher = 0) and I have even tried turning off disk write caching in the properties of the individual disks in device manager. However still, when I write a large file, I see the "cache" memory in task manager increase to a massive size, and I have verified with some code I've written that it is indeed still caching to memory, because it is able to initially write at speeds far exceeding what the disk is capable of.

How do I disable ALL "transparent" write caching?

Thanks for any help.

  • Why would you want to disable all disk caching? The whole point is to speed up your disk access ... – DavidPostill Dec 4 '19 at 15:11
  • @DavidPostill In the case of a disk that is being constantly saturated, it does not speed things up, but makes the termination of writes hang unpredictably for long periods of time. – Colby Dec 4 '19 at 15:12
  • It's unclear to me what you hope to achieve, but it sounds like you need faster disks or spread the load across more disks. Turning off caching will probably not increase throughput. – StarCat Dec 4 '19 at 16:12
  • @StarCat I'm not looking to increase throughput. The main issue is that I'm encoding a large file and since it's write caching it loads down the cpu 100% for quite some time. When encoding synchronously to disk the encoding is barely noticeable. Sure I could just artificially throttle the process but thats highly sub optimal because its time consuming to benchmark each disk and figure out its actual speed. Secondary is that it makes it impossible to determine actual write speed. Honestly thought i must be missing some simple setting to disable this feature. – Colby Dec 5 '19 at 6:23
0

Things are not always what they appear to be.

In Vista and later the "Cached" value in Task Manager does not refer to the disk cache, neither does it include it. Nothing in Task Manager will show the size of the disk cache. I believe the only system supplied utility that will is the Performance Monitor. With typical desktop usage the disk cache will be much smaller than the "Cached" value. In a heavily used server it will be larger. The size and contents of the disk cache is under the control of the system memory manager. If it is large it is because it is being used a lot.

The "Cached" value is the sum of the Standby list and the Modified list. You can see these values in Resource Monitor. The Standby list contains memory from executable files that are not currently being used, memory trimmed from applications, and more. It may contain data that was trimmed from the disk cache. In most cases the Standby list will form the largest portion of "Available" memory. The contents of this memory is still available to the application that previously owned it if it is needed. A large value is a good thing.

The Modified list consists of memory trimmed from process working sets and waiting to be written to the pagefile, after which it will go to the Standby list. Typically it will be quite small. Like memory on the Standby list this data can be reclaimed by an application if needed

I am not aware of any way to prevent write caching. If you are having a problem it needs to be investigated. Disabling a normal system process is not usually a viable solution to a problem.

  • Well when the writing process begins, the cached memory is at around 2gb but it quickly swells to 60gb.. Then when the file is deleted it instantly returns back to 2gb. So I'm sure this number represents the file cache, combined with the inexplicably high write speeds at the beginning of the file. It simply makes it impossible to track actual file writing progress without writing to the drive synchronously and slowing this down immensely. Why is it not possible to disable 60gb of pointless file caching? Microsoft strikes again xD – Colby Dec 5 '19 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.