none
Disk cache introduces unnecessary paging RRS feed

  • Question

  • Hello,
    I have a windows 2008 standard server (x64) as one of my workstations. Its primary purpose is local data processing (it does not provide any services to the network, components like IIS, etc. are turned off). Superfetch is disabled. It runs perfectly with its 8GB of RAM and paging disabled. I've noticed that even reading files fills the free physical memory with disk cache. I'm happy with that. I will describe the failure situation by a step-by-step of what I do:
    1) I have two windows explorers open, and use a 32bit application (say APP1) that I know not to make much disk I/O and not use more than a few 100 MBs of memory. I start APP2 to calculate the checksum of a large file (like 500GBs): it uses minimal memory (<100MB) and reads the file sequentially. While it reads the file I see that physical memory is being filled (up to 98%) - I suppose for disk caching (I cannot see any process [with the resource monitor] that would use much memory) . Now I start a 7ZIP compression using up to 5.4GB memory. Compression and checksuming progress in parallel, explorer windows respond perfectly. So far so good.
    2) When all finished, I enable paging (on a separate disk, size controlled by windows) and restart to start clean.
    3) Again start two explorers, and APP1.
    4) Start APP2 to calculate checksum.
    5) Start 7ZIP compression.
    6) Note that at this point everything responds normally, and none of the apps will allocate memory anymore.
    7) Physical memory is filled (presumably by disk cache [pointlessly caching the file that is being hashed]). The system gets unresponsive. Even switching between the explorer windows takes minutes. Accoring to performance monitor the pagefile is accessed at very high throughput. It seems like windows pages out active programs to provide space for disk caching.
    8) To prove the above, I shut down APP2. Remember, it did not use any significant amount of memory.
    9) I have to wait a few minutes and make a roundtrip amog the running apps to get them back into the physical memory, but as soon windows gets bored of the swapfile, all operations return back to normal.
    10) I can even restart hashing with APP2 and everything will work fine UNTIL the physical memory is filled again.
    I sometimes need to enable paging for short periods of time, and cannot always afford to restart afterwards (to reset to no-paging state). Most of the time an application is busy with hashing (so reading a file sequentially, once), which should not induce any caching. (I get that windows cannot preempt that the file will be accessed only once, though opening a 500GB file with FILE_FLAG_SEQUENTIAL_SCAN is a good hint to not apply any other cache than read-ahead. What I don't get is how can disk cache cause the system to page out memory allocated to applications.)
    What can I do to prevent this? Can I stop single processes from being paged out (or allow just a few to be paged out)? Or can I instruct disk caching to ignore some files/volumes/clientapps? As you can see, all I do would well fit in the available physical memory (and I would not have the chance to install so many that the cache of the large file can also fit); so why all this paging?
    BTW: I have tested some Vista machines in my company, and they produce exactly the same behavior. So I think this might rather be related to the "new" windows kernel than some server-issue.
    Thanks in advance!
    Levente

    [P.S. textual corrections marked with italic font.]
    • Edited by Pánczél, Levente Tuesday, July 21, 2009 9:41 AM minor correction of text and typos
    Tuesday, May 26, 2009 7:38 PM

All replies

  • hi there,

    did you had a chance to work on the issue ? if not please do let us know so that we willresume further troubleshooting.


    sainath !analyze
    Tuesday, July 21, 2009 9:02 AM
    Moderator
  • Hello,

    I did not have any progress, could not find a way to manipulat such low level system behavior. I currently use the machine with swapping disabled, and have to port other tasks (that requires some more memory) to other stations.
    I have contacted other forensic companies and agencies (this is why hashing large files is such a common task), and they seem to have experienced the very same problem, avoiding it whit this very same workaround.

    [I'll fix few typos in my above post right away; sorry.]

    Thanks!
    Tuesday, July 21, 2009 9:31 AM
  • I have the same issue, I see in the taskmanager how the RAM gets "eaten up" until the machine starts crawling, in my case I copy large files over network with the explorer. The RAID-systems are by far faster (150+ MB/s) than the network throughput (90 MB/s), and still there is that over-caching.
    If there would be a way to limit or control this it would be great.

    I also have difficulties to explain that to customers with better technical background what is happening.

    The thread I started:

    http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/de71fc7e-5d83-4df0-921a-593faeb53e83
    Tuesday, November 24, 2009 11:03 AM
  • Hello,
    I'd like to add in the thread I started there is no network share involved. I usually copy between local partitions, with WindowsExplorer or TotalCommander. So I don't think you will succeed with network sharing settings. I also found that it is normal that the physical memory is eaten up by the cache (RAM is utilized by the file cache), BUT it should be discarded once anything else needs it.
    Tuesday, November 24, 2009 11:09 PM
  • Hello,
    I'd like to add in the thread I started there is no network share involved. I usually copy between local partitions, with WindowsExplorer or TotalCommander. So I don't think you will succeed with network sharing settings. I also found that it is normal that the physical memory is eaten up by the cache (RAM is utilized by the file cache), BUT it should be discarded once anything else needs it.

    I have the effect you describe locally (different physical drives of course) and in the network, I should have noted that. They are exactely the same to me, I see no difference from the point of view that both simple copy tasks can cause caching until swapping out cache. With todays speed of the harddrives there isn't so much difference, copy with over 100 MB/s over the network of with 150 MB/s locally (except for RAID1 over a lot of drives or SSD disks).
    It does get discarded once everything is done, depending on the copy direction it discardes slowly, or instantly when the copy job is done, like shown the screenshot.

    Thursday, November 26, 2009 8:08 PM