Sudo Purge

I used to use Purge in Terminal to release memory, but in Mavericks it no longer works. I have read that sudo purge works, but when I enter that in the command line and then enter the password in the window, it then says:


-sudo: purge: command not found



Anyone know what this means?


Incidentally, I have 32 GB of RAM in a mid-2011 iMac, so there is usually a fair amount unused, but sometimes there is clearly some missing RAM that I would like to reclaim. Running a Windows VM and Photoshop eat a lot of memory, and quitting them does not always release it.

iMac, OS X Mavericks (10.9)

Posted on Oct 25, 2013 4:53 PM

Reply
4 replies

Oct 25, 2013 7:21 PM in response to tomsum

The purge command flushes the I/O cache, seeking to make the I/O performance similar to that of the bootstrap environment.


Typical operating system I/O cache design usually seeks to use much of the "free" memory to try to avoid I/O given its comparatively glacial performance. Any "free" memory is really just wasted memory, after all. If the physical memory becomes needed by an application, the cache should be reduced amd the memory reallocated to the application. This reallocation does mean that performance drops as the cache hit rates drop as the cache is reduced in size.


Put another way, I wouldn't expect much benefit from flushing the cache, and I might expect aggregate performance to drop.


A local test shows the sudo purge command does work on Mavericks, so I'd wonder if there's something odd about your default PATH setting (try sudo echo $PATH ). According to locate, the purge executable file is in the /usr/sbin directory, so that will need to be in your PATH. Alternatively, try the sudo /usr/sbin/purge command.)


But again, using otherwise unoccupied (wasted) free memory as an I/O cache usually isn't even a trade-off.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Sudo Purge

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.