locked
SetSystemFileCacheSize seems to do nothing RRS feed

  • Question

  • I have an i7-960 with 12GB RAM, Windows 7 Pro, and I want the system disk cache to grow as large as possible to make disk usage faster.  I wrote a C++ program to write out files from 0.5GB, 1.0GB, 1.5GB, ... up to 12GB, and noticed that the number of bytes written / sec dropped dramatically after 1.5GB.  More specifically, I wrote the file, closed it, deleted it, then waited 1 minute so the system cache could clear any pending writes, then went on to the next file size.  So I infer from that that Windows 7 Pro doesn't want to devote any more than 2GB at most to the disk cache.  I then called SetSystemFileCacheSize to set it to 8GB, and the call seemed to succeed, and when I called GetSystemFileCacheSize it told me 8GB, but the behavior of my program did not change, so I think it didn't really allow Windows to use 8GB for the disk cache.  If I could make that cache larger it would improve my productivity dramatically.  I tried using the 3rd party SuperCache 5, and it was fabulous, but I don't like that it requires you to devote a fixed mount of RAM to the cache, while Windows (in principle) dynamically changes the disk cache size based on what other memory demands there are.  I can't find any Windows documentation that tells me Windows 7 limits the disk cache size, although I did find something that says Windows 2000 llimits it to 980MB (I think).

    Saturday, November 12, 2011 4:31 PM

Answers

  • Hi,

     

    I would like to share the following article for your reference:

     

    Too Much Cache?

     

    Alex Zhao


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Cloud_TS Thursday, December 1, 2011 10:28 AM
    Monday, November 14, 2011 6:53 AM

All replies

  • Hi,

     

    I would like to share the following article for your reference:

     

    Too Much Cache?

     

    Alex Zhao


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Cloud_TS Thursday, December 1, 2011 10:28 AM
    Monday, November 14, 2011 6:53 AM
  • Thanks, Alex.  I realize I need to understand how the system cache works better before I have a hope of making it do what I want, so I've ordered a copy of Windows Internals.  Maybe I won't need help if I can understand what it says?!

     

    Doug

     

    Monday, November 21, 2011 8:02 PM