1. When does swap start to be used? Is it when the memory is fully used? Or when the memory hasn't been fully used?
  2. When does a process get an "Out of memory" error and be killed by the kernel? is it when both RAM and swap are fully used? or just when RAM is?

When swap starts to be used is dependent on how you have your swappiness kernel parameter set. At swappiness 0 swapping will only occur when memory is fully used and at 100 it will occur as soon as possible. The default value is 60.

OOM errors occur when RAM and swap are completely full.

  • Thanks. I found that Imagick's command convert will write temporary files to /tmp, when RAM is full, is that swapping from RAM to swap? – Tim Dec 29 '14 at 12:01
  • @Tim No, that is not swapping. – casey Dec 29 '14 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.