TecMint published a tutorial about how to clear RAM memory cache, buffer, and Swap space on Linux.
How to Clear RAM Memory Cache, Buffer, and Swap on Linux
Like any other operating system, GNU/Linux has implemented memory management to clear RAM cache manually, whenever a process is eating away your memory.