Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
The definition of "available ram" is not at all clear on a modern system. Would the contents of purgeable memory count as "available"? It's in use, but will be cleared as soon as there's any memory pressure. What about mmap()'d files?
 
Activity Monitor lists "Free System Memory". This is the value I want to get in my app.
 
What do you intend to do with this value once you have it?
What does that matter? I just want to get the value! :D

I would grab the source for the 'top' command and see how it gets its information.
What do you mean by the top command?

All I want is some magical function like GetFreeMemoryInMegabytes.
 
What do you mean by the top command?

All I want is some magical function like GetFreeMemoryInMegabytes.

top is a unix utility that (among other things) lists free ram; like most of the unix layer of OSX, it's open source. Therefore, you can read its code to find out how to do it.
 
What does that matter? I just want to get the value! :D

All I want is some magical function like GetFreeMemoryInMegabytes.

It matters because the people that you are depending on to be smarter than you (hence you asking them questions), are smarter than you and know that this value is relatively meaningless on MacOS X (at least the non-iPhone version).

In general when you are looking for help you should start out explaining what you are trying to do (broad strokes) then describe your specific question. More often than not the reason you can't seem to do what you think you need to do is because you don't understand what is going on. Thus you need to accept that other people need more information than you might think.
 
Cinder6: Thank you!!! Works perfect and was just what I was looking for.

larkost: I didn't mean to sound rude but it's for a complicated project so it would be to hard to explain.

Thanks for the help!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.