News for hackers. Stuff that matters.
Re:Something is deeply broken in OS X memory management by collint on Monday April 23, 2012 @11:50AM (#3879362)
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.

Re:Something is deeply broken in OS X memory management by eridius on Monday April 23, 2012 @02:05PM (#3880122)
That'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.
Re:Something is deeply broken in OS X memory management by hughw on Monday April 23, 2012 @02:31PM (#3880247)
What's the downside? It worked for him.
Re:Something is deeply broken in OS X memory management by eridius on Monday April 23, 2012 @03:07PM (#3880427)
The 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.

Re:Something is deeply broken in OS X memory management by collint on Monday April 23, 2012 @02:36PM (#3880264)
Yeah, 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.
Re:Something is deeply broken in OS X memory management by wagerlabs on Monday April 23, 2012 @05:24PM (#3881044)
From 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.
Re:Something is deeply broken in OS X memory management by follower on Monday April 23, 2012 @12:11PM (#3879493)
Can 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...

On my 10.5 laptop it didn't seem to dramatically decrease the memory marked "inactive".]

Re:Something is deeply broken in OS X memory management by collint on Monday April 23, 2012 @01:46PM (#3880022)
yeah, 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'

Re:Something is deeply broken in OS X memory management by sabat on Monday April 23, 2012 @12:09PM (#3879483)
Cmd line syntax, for the lazy, please?
Re:Something is deeply broken in OS X memory management by fromhet on Monday April 23, 2012 @12:20PM (#3879557)
I made a bash script for it and I'll share it, hacker 2 hacker. Goes a little something like this:

#!/bin/bash

purge

Re:Something is deeply broken in OS X memory management by nikcub on Monday April 23, 2012 @02:53PM (#3880344)
post it to GitHub so I can fork it to support zsh
Re:Something is deeply broken in OS X memory management by cpeterso on Tuesday April 24, 2012 @12:32AM (#3882432)
What license are you releasing your software under?
Re:Something is deeply broken in OS X memory management by fromhet on Wednesday April 25, 2012 @09:51AM (#3889102)
Proprietary, nanananana
Re:Something is deeply broken in OS X memory management by evoxed on Monday April 23, 2012 @12:15PM (#3879523)
...sudo purge? ;)

> purge // wait ~10 seconds Done.

Re:Something is deeply broken in OS X memory management by SimonB86 on Monday April 23, 2012 @12:13PM (#3879508)
purge