Under Windows 7 (64 bit), I'm reading through 9000 moderately sized files. In total, there is more than 200 MB of data. Using Java (JDK 1.6.21) I'm iterating over the files. The first 1400 or so go at full speed but then speed drops off to 4ms per file. It turns out that the main cost is incurred simply by opening the files. I'm opening the files using new FileInputStream (and of course closing them in time to avoid file leaks). After some investigating, I see that Windows' disk cache is using only 100 MB or so of RAM although I have 8 GiB available. I've tried increasing the cache size using the CacheSet tool but any values I provide are considered out of range. I've also tried enabling the LargeSystemCache registry key but (after rebooting) the CacheSet tool still indicates I'm using 100 MB of cache (and doesn't increase during the test run). Does anybody have any suggestions to "encourage" Windows 7 to cache my 9000 files?

link|improve this question
1  
Where do you got the information from that only 100MB are used for disk cache? From what I know Windows uses by default all free memory for disk caching. A value of only 100MB seems to me like a minimum value. – Robert Jul 18 '11 at 11:03
feedback

migrated from stackoverflow.com Aug 26 '10 at 9:09

This question came from our site for professional and enthusiast programmers.

2 Answers

Next time people, use the Resource Monitor which is integrated into the default Windows 7 installation globally before making assumptions.

It will offer you a full look at how the memory is divided. Not only application memory usage but cached, Write buffer etc etc.

link|improve this answer
is there any directory "pre-Read" pre-caching occuring besides the "cache" in the OS (not referring to the hardware) ? i am Trying to understand it, but have not got far yet. – Psycogeek Sep 25 '11 at 1:36
feedback

AnalogX CacheBooster is a free tool for Windows that lets you tweak the hard disk cache.

A discussion of this tool can be found in:
Increase Or Decrease Your Hard Drive Cache Memory With CacheBooster.

image

link|improve this answer
My current settings are all non-active and set to 0 Kb, does this mean this tool is not useful for me? I have 4 GB of RAM total and only 1.2 GB of RAM is used... – Tom Wijsman Aug 26 '10 at 9:30
@TomWij: Where do you see that only 1.2 GB of RAM is used? Did you try to play with the CacheBooster values ? (create a system restore point first, just in case) – harrymc Aug 26 '10 at 12:58
1.2 GB of ram is used, Process Explorer shows that. Just Windows memory... My System Restore is disabled, but anyhow I just want to know what this does before playing with it. Haven't tried that but I just wonder if it's normal that the sliders are all on 0 and active when I open CacheBooster? Does this mean caching is not enabled? Does this mean I don't need caching? ...? – Tom Wijsman Aug 26 '10 at 23:05
@TomWij: Don't believe any such statistics, as nobody can say exactly how Windows uses memory. You may try playing with this utility to see if it helps, but take precautions as said above. – harrymc Aug 27 '10 at 9:37
@TomWij: Whatever you are seeing is probably incorrect or doesn't apply. Windows 64-bits on 4GB RAM will use by default about 2GB for its own, mostly disk cache. Probably when 9000 files were read into memory, you filled out the cache memory and then things slowed down, because copying of files had to be finished for new files to be read into memory before copying. This utility can help you adjust the disk cache, but probably only DOWN, because Windows had already allocated the maximum possible. – harrymc Aug 28 '10 at 14:33
show 1 more comment
feedback

Your Answer

 
or
required, but never shown