COMMAND

    NT File Caching Algorithm

SYSTEMS AFFECTED

    WinNT 3.x, 4.0, 5.0b1

PROBLEM

    Mathias  Ortmann  found  a  nasty  bug  in NT 4.0's virtual memory
    manager causes all available memory to be irrecoverably lost every
    time the  system fails  to grow  the page  file (either because it
    runs out of disk space, or because the configured maximum size has
    been reached).   Since NT  makes quite  extensive use  of the page
    file even when plenty of  physical memory appears to be  available
    (e.g., a growing file cache  can cause regular memory to  be paged
    out), the only plausible way of minimizing the risk of suffering a
    memory collapse as described above  is to make sure that  the page
    file  is  sufficiently  large  to  cover  even  the  most  extreme
    situations.

    Once memory  has collapsed,  it remains  lost until  the system is
    rebooted.  Memory  that  has  been  in  use during the collapse is
    not affected and can  be freed and re-allocated  subsequently, but
    the collapse is likely to reoccur, once again consuming all of the
    RAM that has become available in the meantime.

    Reproducing the phenomenon is a fairly straightforward procedure:

        Configure a very  small page file  (e.g. 2 MB  initial / 3  MB
        maximum  if  you  have  32  megs  of  physical memory or more)
        (Control Panel / System / Performance / Change)

        Reboot, start  Windows NT  Diagnostics (Administrative  Tools)
        and click on the "Memory" tab.  If you want to see the  effect
        graphically,  start  Task  Manager  as  well  and  select  the
        "Performance" sheet.

        Now copy at  least _half_ the  amount of free  physical memory
        worth of  files from  one folder  to another.  This will cause
        your file  cache to  overflow. In  consequence, regular memory
        will  be  swapped  out.  The  page  file  usage  will increase
        accordingly (you  can monitor  this by  clicking on  "Refresh"
        in Windows NT Diagnostics repeatedly).

        Each  time  the  page  file  usage  approaches 100%, a "System
        process - out  of virtual memory"  warning will pop  up, after
        which its size will grow by a couple of hundred kilobytes.

        As soon  as the  page file  size hits  its upper limit, memory
        usage will jump to 100% in an instant (look at Task  Manager's
        Memory Usage  History). From  there on,  your system  will not
        be  quite  as  usable  as  before.  Reboot to recover the lost
        memory.

SOLUTION

    Microsoft has acknowledged  this problem, but  seems to be  having
    difficulty providing a fix quickly.