Thank you for purchasing through links and ads on this site.
OWC / MacSales.com...
diglloyd Deal Finder...
Buy other stuff at Amazon.com...
Capacities up to 56TB and speeds up to 1527MB/s
877-865-7002
Today’s Deal Zone Items... Handpicked deals...
$1099 $899
SAVE $200

$260 $140
SAVE $120

$1199 $879
SAVE $320

$239 $239
SAVE $0

$599 $199
SAVE $400

$819 $649
SAVE $170

$348 $298
SAVE $50

$4500 $4500
SAVE $0

$1000 $1000
SAVE $0

$2799 $2149
SAVE $650

$750 $450
SAVE $300

$300 $170
SAVE $130

$1099 $899
SAVE $200

$280 $220
SAVE $60

$1299 $1169
SAVE $130

$998 $498
SAVE $500

$1999 $1799
SAVE $200

$1180 $1050
SAVE $130

$4499 $4499
SAVE $0

How to Purge the File System Disk Cache: 'sudo purge' in Terminal.app

Last updated 2016-05-28 - Send Feedback
Related: command line, how-to, memory, software

It can be confusing to evaluate available memory, because OS X can use many gigabytes for the file system cache. Thus, it can be useful to purge the OS X file system buffer cache for that reason, and another:

  • Before performing or repeating a performance test, for consistent results.
  • To assess system memory usage without a bloated disk cache.

In Terminal, use sudo purge:

diglloydMP:MPG lloyd$ sudo purge

Use of 'sudo purge' is harmless; it simply empties file system caches. The 'man' page states:

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.

The results can be seen in Activity Monitor under memory usage. The cache will not go to zero because the system keeps some important file system structures cached.

15.6GB of cache used before sudo purge, 1.09GB after (toggle to compare).

Cached files before and after

Deals Updated Daily at B&H Photo
View all handpicked deals...

Xerox B215 Multifunction Monochrome Laser Printer
$260 $140
SAVE $120

diglloyd.com | Terms of Use | PRIVACY POLICY
Contact | About Lloyd Chambers | Consulting | Photo Tours
Mailing Lists | RSS Feeds | Twitter
Copyright © 2020 diglloyd Inc, all rights reserved.
Display info: __RETINA_INFO_STATUS__