2

Let's say I have a setup with

  • 16 GB of physical RAM,
  • A tmpfs of max. 8 GB containing a file with 5 GB and
  • A swap sized 4 GB.

If I'd try to, e.g., create a copy of the 5 GB file on the tmpfs, what would happen to the file operation and what would happen to the system?

3

The copy will fail prematurely with a file system full situation.

In the best case, 4GB of swap and 6GB of RAM will be used to store the original file and the truncated copy.

That leaves 10 GB of RAM for the remaining processes, cache and other kernel usage.

  • The worst case being a system lockup due to the whole system running out of memory and swap space? Or is there some sort of fail-safe mechanism that would allow the system to purge the "tmpfs part" of the swap space? – htorque Aug 24 '14 at 9:57
  • You already are kind of out of swap with 5 GB stored in tmpfs and a 4 GB swap. The worst case behavior starts with RAM shortage. What will happen depends on the OS and its settings. With Linux, the OOM killer might play a role here. – jlliagre Aug 24 '14 at 10:17

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.