Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sometimes you know better than Windows what files will be re-used later. Suppose you have 8GB of memory, and you use the same 1GB file every hour in an I/O-bound application (which takes 1 second to finish if the file is cached, and 1 minute if not.) Now you process some other 16GB of data that are not going to be re-used. Naturally the frequently used 1GB file will be pushed out of the cache. It would be beneficial if one can tell Windows to keep that 1GB file in memory. (Better yet, it would be great if one can tell Windows not to cache those 16GB of data, but I'm not optimistic that this can be done.)

The situation is worse for files in network shares: Windows removes files form the cache even if there is free memory. If you immediately re-use a file, it will still be in the cache; but if you close the file and wait for 30 seconds, the cache is gone, and the system will need to re-fetch the file from the remote server. For me this is very noticeable because I'm on a 3 Mbps network link and I work with files that are about 10 MB in size.

The poor-man's way to keep a file in the cache would be to keep reading the file. Are there any better ways? Are you aware of any programs that do this?

(If this can be easily done under Linux, please let me know too.)

share|improve this question

1 Answer 1

Two things comes to mind.

  1. Copy the file to a RamDisk before first use and move it back to file when you are done with it. (QSoft’s RamDisk for $12 was recommended here)
  2. Buy a fast SSD drive and see if that helps (enough)
share|improve this answer
    
So there's no way to tell Windows to keep some files in its disk cache, eg. the .Net framework? –  OverTheRainbow Jul 9 '12 at 12:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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