You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mavericks and memory (Ram)

Hi


Anyone else noticed how Mavericks uses memory ?

I have a new Macbook Air 2013 with 4GB of memory and after a short wile.

The system have used 3.99GB of the total 4GB 😟 Isn't that a big problem. Thats can't be right.

I would think that the computer would suffer greatly after a short time of use and the computer

needs to be restarted. If thats true. The new Mavericks ***** big time on Computers with less

memory. Or is there something i don't know.


Thanks

Posted on Oct 23, 2013 8:07 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 23, 2013 8:11 AM

Mavericks uses memory smarter than previous OS's, not necessarily less memory. Look at the swap memory if that is high then you have a problem. Also, if the mac is still running fast then there isn't a problem.

460 replies

May 9, 2014 11:36 AM in response to GPap1981

Totally normal. It will (almost) always use 100% of whatever you put in.

Here's how memory works in 10.9-->


About memory management in OSX 10.9 Mavericks


Memory is managed differently, and more efficiently in 10.9. It is (mostly) unique in the industry, but may become trend.


Let’s start with the basics. Mechanical disk drives are very slow, with access speeds in the 10s of milliseconds and transfer rates in the 200-400 Mbps range real world. SSDs are much faster, on the order of a couple of ms access and typically 1200-3000 mbps transfer rates. RAM is much faster than either, in the nanosecond access and transfer speeds of ~8 Gbps effective (1 GHz x 8 bits/byte).


These are rough numbers for comparison purposes only.


So the goal is to keep as much in RAM as possible. But if you run out of RAM what do you do?

Traditionally you take the least used RAM and write it to a special part of the disk, in a way that you can access it most efficiently - minimizing the disk delays. This is called a swap file because you swap RAM in and out of it.


10.9 has a new trick: it compresses RAM using the main processors. Rather than swapping stuff to disk (disks are slow), it actually uses the processor to compress memory and make, for example, 1 GB of physical RAM hold as much as 1.5GB. Similar approaches are used to make MP3 files 10x smaller than the real thing - there is redundancy in data and you can take advantage of that. Apple is making the following calculation: the processors can compress way faster than the disk can swap. And its also predicting that the processors are often partly idle - waiting for swap files or disk access. So rather than swap files around, its compresses the files ***in RAM***.


Compression works,. Tests show that on average it is faster, and that 4GB (i have 4 GB RAM) acts like 5 1/2 - 6GB. Wow.


So, 10.9 will load up most of your RAM, knowing that it can compress some when it needs to. So don’t worry too much that it may look like all your RAM is taken - yea, it is, but its OK.


The measures to look at are:


1. amount compressed. Compression means it has run out of RAM and needs more. As long as compression is low this is fine. In fact this is how 10.9 uses RAM more efficiently than 10.6,7 or 8. Contrary to common wisdom, it requires LESS RAM than 10.8. The colored indicator tells you who this is going - green (good), yellow( iffy) and red (bad).


2. amount swapped. Once it cannot compress any further, or can’t do so efficiently, jot begins old-fashioned swapping. This is a major slow-down and means you would benefit from more RAM. Tiny amounts are OK.

here's an article by Apple - but on th pre-10.9 memory management techniques....mostly still true, but read on.


http://support.apple.com/kb/HT1342?viewlocale=en_US


Bottom line - compression makes 10.9 use RAM more efficiently than previous OSX versions. It also makes the “ram used” indicator less meaningful, and mans you should monitor “compression” .


That said, RAM has always been one of the most cost effective upgrades possible. People spend too much on new machines and too little on more RAM.


Hope this helps,


Grant

May 10, 2014 6:35 PM in response to MadMacs0

MadMacs0 wrote:


Drew Reece wrote:

I feel compelled to explain the memory pressure graph colors…


Green = OK

Yellow = Compressing RAM in CPU

Red = Swapping RAM to disk

I'm not doubting your explanation, just wondering why I haven't seen it before. Is there a reference?

I think I gleaned this from running the memory_pressure command.


Thanks Csound1, I had missed that too.

May 14, 2014 6:43 AM in response to MichelPM

Maybe you can help me: I've never had problems gaming on Team Fortress 2 re lag/freezes until I installed Mavericks and now it happens all the time, every 10-15 secs. I have a late 2009 iMac with 8gbs of RAM and never had memory issues before. I only keep the TF2 app open when playing. I've read about the Activity Monitor and now understand that what looked like the problem might be that the RAM was entirely being used, that is not the issue. So what is? I have reinstalled TF2 twice. I try to read the console info but am an idiot and don't understand what the terms related to sandbox, steam causing excessive wakeups, kernels, etc. do or mean. The code is written in code only computer masters can understand. The ONLY thing different or new on my computer is MAVERICKS.

May 26, 2014 4:50 AM in response to Grant Lenahan

Thank you -- but that said, how come even when there is 0 bytes compression, 0 swap, memory pressure is green all the way across the square. Just restarted. Opened activity monitor and it showed 2.6G memory used. After opening safari, looking for APple support and finding this thread, it now says 4.28 G memory used. I have 8 g of memory. Usually, after a day of typical use of applications - nothing fancy, just Safari, Word, mail, ical, itunes, maybe iphoto - I can't open safari or other applications run VERY slowly. I have no accurate data right now as I had to restart so that Safari could open. I NEVER had this problem before and if my photos hadn't all been changed I would go back to the old OS.

ANy suggestions would be welcome!

THANKS

May 26, 2014 6:06 AM in response to Momomoesh

Something to try, if your mac is older and running very slowly after the memory is filled, is turning off compression. On my mid 2009 MBP, this has been the difference between unusable and perfect just like it used to be. It can be undone, so there's no harm in trying.


Instructions for turning off memory compression: http://superuser.com/questions/668114/disable-compressed-memory-in-mac-os-10-9-m avericks


My theory is that the fast memory compression which makes it faster than disk swap relies on some kind of hardware speed up that does not work on some processors (or works very slowly). Mavericks by default prefers to compress memory rather than release file cache. So with memory compression on, if your memory compression is not fast, your memory will fill up pretty quickly and then you'll start to see significant beach balling when switching between running programs or opening new programs. File cache will be large. This behavior changes when you turn off compression: it will then prefer to release file cache rather than swap, so if your compression is slow, this will make a big difference once your memory is pretty close to being filled up.

May 26, 2014 6:31 AM in response to jbg7474

jbg7474 wrote:


Something to try, if your mac is older and running very slowly after the memory is filled, is turning off compression. On my mid 2009 MBP, this has been the difference between unusable and perfect just like it used to be.

And on my 2009 MBP Mavericks is very fast with compression off, and even faster with it on.


My theory is that the fast memory compression which makes it faster than disk swap relies on some kind of hardware speed

Other than an Intel 64 bit chip (which they all have) no.

May 26, 2014 11:57 AM in response to Csound1

Csound1 wrote:


jbg7474 wrote:


Something to try, if your mac is older and running very slowly after the memory is filled, is turning off compression. On my mid 2009 MBP, this has been the difference between unusable and perfect just like it used to be.

And on my 2009 MBP Mavericks is very fast with compression off, and even faster with it on.


My theory is that the fast memory compression which makes it faster than disk swap relies on some kind of hardware speed

Other than an Intel 64 bit chip (which they all have) no.

I'm sure it works for most. We also have a 2009 iMac and it works great on that machine. Do you remember, back in say, 1997 or so, there was a big dustup over a hardware bug that was present in some math co-processors on the Intel chips? It didn't impact most people, and it wasn't present in every single chip, but if you were running higher level math features in some software that relied on it, it could give wrong results. Obviously they fixed that long ago. But it is certainly possible that some other hardware bugs like that have existed in Intel processors from time to time. Probably, if it is some feature that is used very seldom, it wouldn't be a problem, and if Intel even knew about it, they might let it slide and fix it in the next revision.


Compressing data can be slow if done in software. I suspect that Apple is smartly using some hardware compression feature of Intel chips (they've had some form of media compression features in their chips for ages) that allows it to be very fast. And that is a great thing to do. I love what they've done with memory in Mavericks. But I think my machine may have some sort of hardware issue that keeps compression from being fast.


This is pure speculation on my part, but without compression, my machine is right, that's the only verified fact I have, and I'm a happy customer without it.

Mavericks and memory (Ram)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.