OS X is responsible for memory management (unloading RAM and disk cache contents), and proper memory management is crucial in ensuring your machine is running smoothly. OS X does a quite decent job of memory management, but it’s not perfect.
Sometimes the RAM and disk caches are not emptied properly, even though they were supposed to (like when you quit a running program), and this can lead to issues. To remedy this, you can force your Mac to clear out the RAM and disk caches without rebooting, which can be very useful if you want to give your system performance a “boost” without restarting.
To free this space and make available more memory for the system, you can use a simple command in your Terminal. After opening it, type “sudo purge” to remove all the unused files from the RAM. It will ask you the administrator password to run this command, enter it when the prompt asks for the insertion. Thats it, you will feel the your MAC is as new as a reboot.