6 ms·
You can run `purge` in a terminal to free your 'inactive' ram. I've set up a cron job to purge frequently, keeps thing humming.
by collint 14y ago
You can run `purge` in a terminal to free your 'inactive' ram.
I've set up a cron job to purge frequently, keeps thing humming.
- sabat 14y agoCmd line syntax, for the lazy, please?
- follower 14y agoCan you explain a bit more how this works? The `purge` command has a pretty short man page: > purge -- force disk cache to be purged (flushed and emptied) > 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. [This seems to talk about it more: http://workstuff.tumblr.com/post/19036310553/two-things-that-really-helped-speed-up-my-mac-and http://workstuff.tumblr.com/post/19036310553/two-things-that... On my 10.5 laptop it didn't seem to dramatically decrease the memory marked "inactive".]
- collint 14y agoyeah, it's not directly attacking your 'inactive' memory. Just the disk cache, which shows up in the chart as 'inactive'. I'm not familiar with other cases that fit into the 'inactive' piece of the pie. I have regularly seen 1-3G of ram get free'd up on a 'purge'
- eridius 14y agoThat's a terrible idea. `purge` is not a tool for freeing inactive ram. It's a tool for deleting the filesystem cache in order to simulate cold boot conditions for performance analysis. Yes, it has the side effect of reducing memory usage, inasmuch as it's throwing away stuff that was kept in memory. But that doesn't make it an appropriate tool to use.
- hughw 14y agoWhat's the downside? It worked for him.
- collint 14y agoYeah, I've had zero problems doing this for over a year. I used to get into swap hell every other day and now my life is beautiful and awesome.
- eridius 14y agoThe downside is it slows filesystem access down across the board until the caches get repopulated. So sure, go ahead and use it if you like having a slow filesystem. Caches exist for a reason. Deleting them willy-nilly tends to be a bad idea.
- wagerlabs 14y agoFrom my days of optimizing Firefox startup on the Mac, I remember that this doesn't work 100%. The only way to ensure that caches are 100% purged is to unmount the filesystem.