0

I have 8GB RAM and 20GB swap. If I run

stress -m 1 --vm-bytes 8G --vm-keep

the system cannot be used for a few minutes. the mouse pointer does not use any more. and even after a few minutes, it is very unresponsive. Gnome system monitor shows 10GB Swap used. Why the system becomes so slow?

Edit: I just found this question Prevent Ubuntu from freezing, even if system memory is low

Martin
  • 11

1 Answers1

4

It becomes slow because you use all the RAM for your stress test, and things gets written to swap.

Disk storage is orders of magnitude slower than RAM. RAM can handle bandwidths of 10's of GB per second. SSD's can handle single-digit gigabytes per second. Hard disks can manage hundreds of megabytes per second.

This is simply the expected behavior when you over-commit your memory by such an large amount.

vidarlo
  • 23,497