Purge!

If you’re like me, you love OS X, but perhaps have found one nagging problem with it. For quite a long time, the OS is a memory hog and doesn’t like to release inactive memory even in scenarios where it is badly needed. I’ve sought out fixes for this over the years with no success, but I’ve finally found an answer (well, it’s honestly a workaround for Apple’s own issue):

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)

So… just run this once a day if your system is like mine, continually running low on free memory while having 1G or more sitting there inactive