Mac OS X consumes so much memory

2

I use a Mac for software development. It has 4GB of RAM (cannot be upgraded), and when I power it on, without any programs run by me, it consumes 2GB of memory. I develop a Rails app and the server itself needs a lot of memory, so I always have a free memory problem.

The question is, why does the OS consume half of my memory?

And is there any way to reduce the memory consumption? I turned off all widgets but does not help so much. I do not want any fancy thing from the OS, but just to develop...

Does anybody have any idea about this?


Ok Guys. I did more inspections to see what is happening there. I agree OSX doesnt consume so much. but i see a very strange behaviour: that, I have arround 1.5GB INACTIVE MEMORY, my Rails server needs more memory, and then it start to use harddisk so much. there are lots of pageouts so that my server stops functioning.

i guess INACTIVE MEMORY should get freed right when some program needs more memory. but it doesnt. when I even do the "purge" command it doent free it so much. So the question is, in what case something like this can happen to the INACTIVE MEMORY? does any body has similar experience?

Az In

Posted 2011-11-27T11:50:48.253

Reputation: 21

1I don't want my ram to be used by the OSX. I want to use it myself, but osx consumes half of it. that's the problem. – Az In – 2011-11-27T16:28:08.190

on my netbook i have just 1GB and my ubuntu consumes just 100mb of it. that's why i get courious why osx consumes 2GB and what can be done to reduce it. – Az In – 2011-11-27T16:29:46.767

2OS X itself does not use all your RAM. Your applications do, obvious ones (web browser, email program, Xcode) and less obvious ones (web server, desktop search indexer, UI server, Dock, and regular system services and housekeeping tasks). OS X itself, kernel_task, will use much less. Open Activity Monitor and sort the processes by real memory after selecting to display All Processes. – Daniel Beck – 2011-11-27T16:59:39.303

1

If you are not familiar with http://www.linuxatemyram.com/, you should read it. Yes, it's for Linux, but the way of thinking about memory consumption applies to all unix-alike systems including Mac OS.

– dmckee --- ex-moderator kitten – 2011-11-27T17:03:18.790

Could you add a screenshot of Activity Monitor after a purge with the Memory stats at the bottom and processes sorted by Real Mem at the top? – Daniel Beck – 2011-11-29T20:21:00.950

Answers

5

RAM is also used to cache frequently accessed files. Both free and inactive RAM can be used immediately if needed.

Unless Activity Monitor shows a high and steadily climbing page out value in the System Memory tab, it's no cause for concern.


For example, my system has rather little free RAM, but my page out count is very low, so 4GB of RAM are definitely enough for browsing SuperUser.

enter image description here

Daniel Beck

Posted 2011-11-27T11:50:48.253

Reputation: 98 421

Another example: Cutting HD video in Premiere Pro, and exporting it in the background, but the system is still responsive, although only 120MB of RAM are free.

– slhck – 2011-11-27T15:25:39.087

well thank you for the usefull information. do you know also, how can the OSX configured to consume less memory? I guess it should be hard to answer because its not open source and nobody knows exactly what's going on in there – Az In – 2011-11-27T16:31:54.517

@AzIn The thing is: Why do you want it to consume less memory? Give it less memory, and your OS has to page in/out more to your hard drive, which would make it slow. Unless you experience really bad performance, let your operating system decide how much memory it wants to use. – slhck – 2011-11-27T16:33:26.590

Use Activity Monitor and sort by real memory to see who is using the memory. You may have some startup app or extension you do not need. Apple Menu > About This Mac > More Info will open System Profiler. Look at the Software > Extension and Preference Panes sections. – broomdodger – 2011-11-27T17:19:02.970

Ok Guys. I did more inspections to see what is happening there. I agree OSX doesnt consume so much. but i see a very strange behaviour: – Az In – 2011-11-29T20:04:59.010

I updated the question. please have a look – Az In – 2011-11-29T20:11:08.827