refreshing ram linux code example
Example 1: how to clear memory in ubuntu 18.04
# Clear PageCache, dentries and inodes.
sync; echo 3 > /proc/sys/vm/drop_caches
Example 2: linux how to free memory
echo 2 > /proc/sys/vm/drop_caches
# Clear PageCache, dentries and inodes.
sync; echo 3 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches