Comments on: How to Clear RAM Memory Cache, Buffer and Swap Space on Linux https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 15:06:33 +0000 hourly 1 By: Boca https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/comment-page-6/#comment-1944325 Tue, 10 Jan 2023 15:14:28 +0000 http://www.tecmint.com/?p=13515#comment-1944325 I use:

# echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf ‘\n%s\n’ ‘Ram-cache and Swap Cleared’

(Note: dphys-swapfile swapon)

Second: It also kills zram so you need to (re)start zram again.

]]>
By: alex https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/comment-page-6/#comment-1912105 Wed, 09 Nov 2022 09:48:48 +0000 http://www.tecmint.com/?p=13515#comment-1912105 In reply to les.

$ sync; echo 1 | sudo tee /proc/sys/vm/drop_caches

]]>
By: gollum53 https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/comment-page-6/#comment-1890348 Mon, 03 Oct 2022 14:09:44 +0000 http://www.tecmint.com/?p=13515#comment-1890348 It will result in a server crash and corrupt the database.

Can you please explain this? Why clearing cache could crash the server and corrupt the database?

Thanks

]]>
By: A https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/comment-page-6/#comment-1870009 Tue, 30 Aug 2022 20:35:23 +0000 http://www.tecmint.com/?p=13515#comment-1870009 In reply to Richard.

It could also be useful for cases where garbage collection isn’t functioning properly in certain apps, and the RAM isn’t reclaimed on time, as I had found out on my system.

]]>
By: A https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/comment-page-6/#comment-1870007 Tue, 30 Aug 2022 20:33:23 +0000 http://www.tecmint.com/?p=13515#comment-1870007 In reply to les.

Same here. You first need to drop into a root shell (hence the “#” in the article) via “sudo su”, and only then will it work.

]]>