This question already has an answer here:
I remember, back from my days with Windows Vista/7, that there was a tool called memclear or memclean that would free some memory by invoking the NT garbage collection API. Probably it cleared cache too. Very often when I use Ubuntu, after a while the system stays at a couple of gigabytes allocated memory, and when I perform memory-intensive tasks such as image editing, I have to wait quite a while for the extra gigabytes to swap.
Is there a way to force something like a kernel GC to free memory that really isn't used? (when I start up, memory consumption is less than a gigabyte)