linux check cache memory code example
Example 1: linux memory cache clear
# clear pagecache only.
sync; echo 1 > /proc/sys/vm/drop_caches
# clear dentries and inodes.
sync; echo 2 > /proc/sys/vm/drop_caches
# clear pagecache, dentries and inodes.
sync; echo 3 > /proc/sys/vm/drop_caches
Example 2: how can I check memory usage in linux?
for more information search this webside --
https://www.howtogeek.com/659529/how-to-check-memory-usage-from-the-linux-terminal/