Flushing the swap

Works in the same way as on CentOS. The problem you’re getting may be due to overcommited memory.

You can try dropping the cache (although not recommended in production).

To see information on current memory:
cat /proc/meminfo
or
free

To drop cache memory:
sync; echo 3 > /proc/sys/vm/drop_caches

You can try other (safer) values instead of 3:

The values for drop_caches:
1 invalidates and frees page cache.
2 frees unused slab cache.
3 frees page+slab cache.

After a minute or two you can check the memory freed an set drop_caches to defaults:
echo 0 > /proc/sys/vm/drop_caches

3 Likes