Free up memory on Ubuntu
I’ve noticed that doing a extraction of a large archive (with tar) or moving files around the network (with scp) takes up all memory of the Ubuntu server. Just today, I extracted a 33GB archive at the process “eaten” up 28GB of memory, which would be fine if the process would free up the memory after using it. Unfortunately, this is not the case.
So, in order to free up memory again one has to issue the following command:
sudo echo 3 > /proc/sys/vm/drop_caches
The “echo 3 > /proc/sys/vm/drop_caches” command is used to clean up your memory from pagecache, dentries and inodes.
This effectively frees up the used memory.