3

On my work laptop with an SSD and no swap, I sometimes run out of memory when running RAM-expensive applications (virtual machine, etc).

When that happens, the system becomes slow (expected) but what I don't understand is why the disk usage LED lights up and stays that way until I manage to kill some tasks to free up memory. That happens every time the system runs out of memory even if there's absolutely no disk IO before that.

3
  • At a guess the system is flushing pages that it then has to drag back in almost immediately. Things like shared libraries, or user-land programs that don't have the cpu right this moment. It's also going to have pretty much no disk cache at that point, meaning that anything read or written will be pretty much direct writes, again increasing apparent IO. Aug 24, 2015 at 14:19
  • What does vmstat 1 show when the system is thrashing?
    – thrig
    Aug 24, 2015 at 14:22
  • @thrig unfortunately it's impossible to run anything during those moments - even the mouse cursor doesn't move properly. Aug 25, 2015 at 13:54

1 Answer 1

4

As you fill the memory with apps various block/filesystem caches are getting pushed out of the same memory. These caches are crucial for fast look up of files and other stuff. When there is no space for caches the kernel will try to look up all the information directly from the filesystem which is utterly slow and hence will cause high IO (more like a bottleneck).

To solve this either add more memory or create a swap file or partition.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .