How to disable Windows NT/2000/XP file system cache?
Results 1 to 10 of 10

Thread: How to disable Windows NT/2000/XP file system cache?

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    2

    How to disable Windows NT/2000/XP file system cache?

    As we know, all NTs use caching during file operations (read ahead/leazy write). So when I try to read from a file which have already been accessed by another application I receive the contenet of the file system cache. Is there any flag(s) i can specify in my call to CreateFile/NtCreateFile to bypass using of FS cache and receive data directly from storage?

  2. #2
    Super Moderator: GMT Zone nihil's Avatar
    Join Date
    Jul 2003
    Location
    United Kingdom: Bridlington
    Posts
    17,191
    Why would you wish to do that?

    If you cannot do someone any good: don't do them any harm....
    As long as you did this to one of these, the least of my little ones............you did it unto Me.
    What profiteth a man if he gains the entire World at the expense of his immortal soul?

  3. #3
    AFLAAACKKK!!
    Join Date
    Apr 2004
    Posts
    1,065
    Correct me if I'm wrong, but wouldn't that actually slow down your computer when opening files???
    I am the uber duck!!1
    Proxy Tools

  4. #4
    Shadow Programmer mmelby's Avatar
    Join Date
    Jul 2002
    Location
    Ft. Myers, FL
    Posts
    291
    Here are a couple of articles on modifying caching in a Windows enviornment. It requires registry modifications.... use at your own risk

    http://www.dataaccess.com/whitepaper...adcaching.html

    http://support.microsoft.com/default...;EN-US;q163401

    The first link is often needed in a network database envoirnment but I think it still applies.

    Hope this helps.

    m2
    Work... Some days it's just not worth chewing through the restraints...

  5. #5
    Banned
    Join Date
    Jul 2004
    Posts
    297
    I think what your looking for can be found at the link below. at tweakxp.com.


    http://tweakxp.com/tweak905.aspx
    The title "Easy Way to Adjust LargeSystemCache" is written by or based on information submitted by vanisher.

  6. #6
    Senior Member
    Join Date
    Apr 2004
    Posts
    1,130
    I dont know a way to "attach" that property on a file, but you can do this when "accessing" the file. At least on write operations, when you want to be sure the a file is written the disk (as a database log, for instance)
    Meu sítio

    FORMAT C: Yes ...Yes??? ...Nooooo!!! ^C ^C ^C ^C ^C
    If I die before I sleep, I pray the Lord my soul to encrypt.
    If I die before I wake, I pray the Lord my soul to brake.

  7. #7
    Senior Member
    Join Date
    Jan 2002
    Posts
    1,207
    I don't think there's any way to prevent read caching, but there may be ways to prevent write-caching.

    Why would you want to turn read caching off anyway?

    Slarty

  8. #8
    AFLAAACKKK!!
    Join Date
    Apr 2004
    Posts
    1,065
    Exactly! wouldn't this overall slow down your computer?
    I am the uber duck!!1
    Proxy Tools

  9. #9
    Junior Member
    Join Date
    Jun 2004
    Posts
    2
    Of course, disabling file caching will slow down the system perfomance. But i don't need to disable cache completely. I just want one of my applications to receive file data immediately from HDD, while others are working (modifying) file content in cache. Actually, I need to get the previously saved file content before any cache data was flushed to physical storage.

    I don't think there's any way to prevent read caching, but there may be ways to prevent write-caching.
    It seems there is a way to prevent write-caching documented in DDK (NtCreateFile's flag):
    FILE_WRITE_THROUGH - System services, FSDs, and drivers that write data to the file must actually transfer the data into the file before any requested write operation is considered complete. This flag is automatically set if the CreateOptions flag FILE_NO_INTERMEDIATE
    But what about read-ahead operations? Is there anything like this?

  10. #10
    Super Moderator: GMT Zone nihil's Avatar
    Join Date
    Jul 2003
    Location
    United Kingdom: Bridlington
    Posts
    17,191
    Zufyxe

    You have come to us with a "solution" that really does not make a great deal of sense.

    What we need to know are your "requirements"..............like what you want to happen, and why. Then we will tell you how.

    If you cannot do someone any good: don't do them any harm....
    As long as you did this to one of these, the least of my little ones............you did it unto Me.
    What profiteth a man if he gains the entire World at the expense of his immortal soul?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •