Re: How does one stop cache flushing?



b11_ wrote:
Under Wxp, when you quit an application, the file cache is flushed (file cache size drops dramaticly and unnesssarily).

That's not true. What you are calling 'file cache size' is the file
cache's working set.
The working set is the memory that has been recently used so Windows expects that it is used again in the near future. Every process has
a working set and the file cache has too. A process's working set
is shown by the taskman in the process list as 'Mem usage' which is
misleading. Vista's taskman uses the true name: 'Working Set'.
The working set of a process is trimmed when its main window is
minimized. You can watch this in the taskman.
Trimming the working set doesn't mean that the memory is taken away from its owner. It only means that the Windows memory management thinks that it's not important to hold it in physical RAM. Applications memory
might be swapped out to the pagefile, file cache's memory might be
discarded. As long as the memory owned by the file cache is not required
for something else it's still availlable and its content valid. Read
accesses will still come out of the file cache.
Here is my simple test tool:
http://www.uwe-sieber.de/files/filecachetest.zip

Check 'FILE_FLAG_RANDOM_ACCESS'. This flag makes Windows blow up the
file caches working set. Then click 'Write'. In the perfmon you can
seen the 'Cache Bytes' growing. When you click 'Close' Windows takes
the cache memory for this file out of the cache's working set. You
can seen the 'Cache Bytes' go down. When you click 'read' you will
see that the file is read lightning fast (some hundred MB/s) even
the cache's working set had been trimmed before. The cache's content
surived the trimming...

> How can one stop the file
> cache flushing that occurs after one quits an application?

What it is effect you have a problem with this apart from some numbers
shown in the taskman or perfmon?


Uwe
.



Relevant Pages

  • Re: PCBs internals
    ... If it takes 0.1 seconds to redraw the screen ... while running cleanly out of l1/L2/L3 cache, ... that is the first step in countering working set problems ... ... Linked lists and trees frequently have a very poor memory usage ...
    (sci.electronics.cad)
  • Re: Has anyone produced a board using Kicad?
    ... On larger designs, memory is being pushed to maintain lists and objects ... application running concurrently with equally large working set, ... provoke substantial cache thrashing, which will show up as memory ...
    (sci.electronics.cad)
  • Re: NV Cache v Ready Boost
    ... Windows ReadyDrive enables computers shipped with a hybrid hard drive ... USB flash drives, to be used as an additional memory cache in order to ...
    (microsoft.public.windows.vista.performance_maintenance)
  • FlushViewOfFile, lazy writing, cache manager
    ... If I open a file under Windows XP, create a memory-mapped view of it, ... since it is documented as flushing out dirty pages to the disk. ... does the cache manager's lazy writer write out ... the dirty page being in user mapped memory and in the cache manager's ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Windows Task Manager Memory Usage Issue
    ... That is normal, when you minimize an application the Working set will or may be aggressively trimmed, it isn't unusual to have a maximized application that is using a couple hundred of MB of RAM have its Working Set trimmed to 4 or 5 MB when it is minimized, how much RAM is available may affect how aggressively the Working Set is trimmed. ... You should ask your fellow programmers in a programing group how to have the application keep or ask for more memory when it is minimized. ... I am a little panicked about the feedback I get from the Windows ... Task Manager about my program. ...
    (microsoft.public.windowsxp.general)

Loading