Want to turn Activity Monitor’s “blue” (inactive) memory to “green” (free) on your Mac without closing any programs?
Run Terminal and type:
That’s all you have to do. It can take up to a minute. While purge is running your system will be slow. After that, with all that free memory, it’ll be zippier than before.
Don’t listen to all the remarkably obnoxious fanboys or official Apple support pages telling you just to leave Inactive Memory alone because it will be freed up quickly if it is needed, or that the system knows better than you do when to free memory. Trust your experience. In my experience it will not and it does not.
Here is the purge man page:
PURGE(8) BSD System Manager's Manual PURGE(8) NAME purge -- force disk cache to be purged (flushed and emptied) SYNOPSIS purge DESCRIPTION Purge can be used to approximate initial boot conditions with a cold disk buffer cache for performance analysis. It does not affect anonymous memory that has been allocated through malloc, vm_allocate, etc. SEE ALSO sync(8), malloc(3)