What is Dirty Memory and how to deal with it?

Solution 1:

'Dirty' memory is memory representing data on disk that has been changed but has not yet been written out to disk. Among other things, it includes:

  • Memory containing buffered writes that have not been flushed to disk yet.
  • Regions of memory mapped files that have been updated but not written out to disk yet.
  • Pages that are in the process of being written to swap space but have changed since the system started writing them to swap space.

Having a few MB of dirty memory is normal on any reasonably busy system, and even spikes up to a few hundred MB are not unusual. The only time to really be worried about it is if it's consistently very high, which is usually a sign that your disks are a performance bottleneck for your system.