Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TrenttonY

macrumors 65816
Original poster
Nov 14, 2012
1,218
1,536
My new 13 inch Macbook Pro with 8gb of ram is always running between 6-7.5 gb ram (out of 8) when nothing is open. How do i fix this?
 

Intell

macrumors P6
Jan 24, 2010
18,955
509
Inside
That is normal. With most UNIX and UNIX based operating systems, like Mac OS X, free memory is wasted memory.
 

MikhailT

macrumors 601
Nov 12, 2007
4,583
1,327
So using 7.95 gb of ram with just Safari and iTunes open is okay?

Yes. Just look at the swap usage, if it is actually hitting your disk, then you have a problem. If not, then don't worry about it. OS X will release memory as needed to open your other apps.

Open your other apps and look at the RAM usage, it'll adjust.

On my iMac with 32GB, only 7 tiny apps (only using up to 800MB combined) will put 10GB of memory to the used section.
 

TrenttonY

macrumors 65816
Original poster
Nov 14, 2012
1,218
1,536
Yes. Just look at the swap usage, if it is actually hitting your disk, then you have a problem. If not, then don't worry about it. OS X will release memory as needed to open your other apps.

Open your other apps and look at the RAM usage, it'll adjust.

On my iMac with 32GB, only 7 tiny apps (only using up to 800MB combined) will put 10GB of memory to the used section.

My says "Swap Used 0 bytes)
 

MikhailT

macrumors 601
Nov 12, 2007
4,583
1,327
My says "Swap Used 0 bytes)

Then it's fine, it is not hitting your disk at all despite nearly all of the RAM being used.

Open more of your apps, see if you can reach 8GB to start hitting your hard drive. You'll notice it'll take a lot and then OS X starts compressing your RAM to use it as much as possible before it even hits your disk.
 

simonsi

Contributor
Jan 3, 2014
4,851
735
Auckland
So using 7.95 gb of ram with just Safari and iTunes open is okay?

The RAM doesn't just have what IS open in it, it has as much of was HAS been opened since the last reboot in it - just in case you want it again.

If you need to open a new app, it will free up RAM to do so, but if you want to reopen an app you have had previously open, it will just run it from the copy already in RAM.

It isn't like windows where only what is running is in RAM, keeping a bunch of RAM empty...for no purpose.
 

TrenttonY

macrumors 65816
Original poster
Nov 14, 2012
1,218
1,536
The RAM doesn't just have what IS open in it, it has as much of was HAS been opened since the last reboot in it - just in case you want it again.

If you need to open a new app, it will free up RAM to do so, but if you want to reopen an app you have had previously open, it will just run it from the copy already in RAM.

It isn't like windows where only what is running is in RAM, keeping a bunch of RAM empty...for no purpose.

Gotcha! If you couldn't tell I just switch from Windows.
 

AFEPPL

macrumors 68030
Sep 30, 2014
2,644
1,571
England
It doesnt matter if you've just rebooted or not, the OS will swallow 7GB to just put up a screen and safari. Its become very bloated now.
 

simonsi

Contributor
Jan 3, 2014
4,851
735
Auckland
It doesnt matter if you've just rebooted or not, the OS will swallow 7GB to just put up a screen and safari. Its become very bloated now.

Not on my 4GB MBA it doesn't, even virtual only gets up to 7GB with 4 users logged in, Safari on most of them, iTunes, and after being up for a week....

Obviously YMMV.
 

chabig

macrumors G4
Sep 6, 2002
11,445
9,317
It doesnt matter if you've just rebooted or not, the OS will swallow 7GB to just put up a screen and safari. Its become very bloated now.

It's too late to duck, but the entire thread just went over your head.
 

Mr. Buzzcut

macrumors 65816
Jul 25, 2011
1,037
488
Ohio
The RAM doesn't just have what IS open in it, it has as much of was HAS been opened since the last reboot in it - just in case you want it again.

If you need to open a new app, it will free up RAM to do so, but if you want to reopen an app you have had previously open, it will just run it from the copy already in RAM.

It isn't like windows where only what is running is in RAM, keeping a bunch of RAM empty...for no purpose.

Last comment is very outdated.

"As you'll see if you step through the entire gallery, Windows tries its very best to avoid leaving any memory at all free. If you find yourself with a big enough chunk of memory here, you can bet that Windows will do its best to fill itby copying data from the disk and adding the new pages to the Standby list, based primarily on its SuperFetch measurements. As Russinovich notes, this is done at a rate of a few pages per second with Very Low priority I/Os, so it shouldn't interfere with performance.

In short, Windows 7 (unlike XP and earlier Windows versions) goes by the philosophy that empty RAM is wasted RAM and tries to keep it as full as possible, without impacting performance."

http://www.zdnet.com/article/windows-7-memory-usage-whats-the-best-way-to-measure/
 

AFEPPL

macrumors 68030
Sep 30, 2014
2,644
1,571
England
It's too late to duck, but the entire thread just went over your head.

No, I understand how the memory management works.... and at a high level i agree free memory is simply wasted in theory. The OS needs around 7GB to wake up, if you don't have that amount the OS will either compress unused parts of the memory and/or use virtual memory. Activity Monitor provides a real good graphic showing the memory pressures, whats consumed by APPs, whats in swap. As long as the pressures graphic is green all is good even if the amount of "memory used" is 100% of the physical.

we think, therefore we are.....
 

dyn

macrumors 68030
Aug 8, 2009
2,708
388
.nl
Yes. Just look at the swap usage, if it is actually hitting your disk, then you have a problem.
Even then there is no problem. Swapping is actually quite normal. There are apps that will use it and there are times when things will swap out to save memory. You should see an increase in swap when you leave your computer running for several days (put the machine to sleep rather than shutting it down), even when there is free memory. It's part of memory management in an OS.

As of Mavericks you need to look at the memory pressure. If that graph is green everything is ok, if different then you have a problem and does it warrant to worry.
 

MikhailT

macrumors 601
Nov 12, 2007
4,583
1,327
Even then there is no problem. Swapping is actually quite normal. There are apps that will use it and there are times when things will swap out to save memory. You should see an increase in swap when you leave your computer running for several days (put the machine to sleep rather than shutting it down), even when there is free memory. It's part of memory management in an OS.

As of Mavericks you need to look at the memory pressure. If that graph is green everything is ok, if different then you have a problem and does it warrant to worry.

Sorry, no. Swapping should be minimized as much as possible especially if you're on SSD. If you're right, then there is zero point of OS X having the compression technologies and no need to worry about memory leaks.

Swapping is a backup to your memory, it should be not used to extend your memory. You're not only harming your drives but also your overall performance.

And no, your swap usage should NOT be increasing in any conditions. That's an inefficient memory management if your swap is increasing over time. If it is increasing, it means you need more memory or shut down your apps more often. Also a sign of serious memory leaks.

I've seen zero swap on my 16GB laptop after running a month without any reboots. Keep in mind hibernation file is not the same as swap even though the action is the same (pushing the RAM data to disk in order to sleep the laptop).
 
Last edited:

simonsi

Contributor
Jan 3, 2014
4,851
735
Auckland
There are apps that will use it

Apps don't use swapping, they know nothing about it.

Swapping/paging is an OS activity used as part of the OS' memory management, if it has a better solution (more RAM or compression), it will use it to keep performance up. If the OS is swapping then it has run out of better options and performance is starting to degrade.
 

leman

macrumors Core
Oct 14, 2008
19,518
19,669
Sorry, no. Swapping should be minimized as much as possible especially if you're on SSD. If you're right, then there is zero point of OS X having the compression technologies and no need to worry about memory leaks.

Swapping is a backup to your memory, it should be not used to extend your memory. You're not only harming your drives but also your overall performance.

If the OS is swapping then it has run out of better options and performance is starting to degrade.

There are scenarios where swapping is the optimal strategy. For instance, if you have a low-priority, background-running (non-UI) application. Imaging for example an indexing daemon. It starts up periodically, does its thing and goes back to sleep. It would be wasteful to keep it in RAM all the time (even if you have a lot of it), but it is also not very efficient to relaunch it from scratch every time it starts. Swapping it to the disk when its paused is the best way to achieve high performance and high efficiency, with optimal resource utilisation. Note: I have no idea whether OS X actually works that way. But that is what would make sense to me.
 

simonsi

Contributor
Jan 3, 2014
4,851
735
Auckland
There are scenarios where swapping is the optimal strategy. For instance, if you have a low-priority, background-running (non-UI) application. Imaging for example an indexing daemon. It starts up periodically, does its thing and goes back to sleep. It would be wasteful to keep it in RAM all the time (even if you have a lot of it), but it is also not very efficient to relaunch it from scratch every time it starts. Swapping it to the disk when its paused is the best way to achieve high performance and high efficiency, with optimal resource utilisation. Note: I have no idea whether OS X actually works that way. But that is what would make sense to me.

If you have enough RAM it is never "wasteful" to keep data there, what would you be wasting?

If you don't have enough RAM for the processes you want to run then swapping is part of a memory management strategy for the OS but trust me, it is never optimal to swap when there is any other option.

In <rough> terms, RAM is 100,000 times faster than spinning disk (HDD), 20,000 times faster than SSD to access the same data.
 

simonsi

Contributor
Jan 3, 2014
4,851
735
Auckland
Last comment is very outdated.

Excellent - yes it would be outdated, haven't bothered keeping up with windows memory management since XP pushed me across to OSX.

Glad to see all OS' agree that empty RAM is wasted - just the algorithms differ on what to fill it with....thanks for the clarification :)

Interesting to note a high proportion of currently-moving-to-OSX ex-Win users have the same misunderstanding of current windows behaviour (hence asking about OSX running full memory). I guess Microsoft didn't do a good job of selling that change to the general user-base, or they are migrating from XP-era versions....
 

leman

macrumors Core
Oct 14, 2008
19,518
19,669
If you have enough RAM it is never "wasteful" to keep data there, what would you be wasting?

Well, you are wasting RAM. In my above example, keeping the indexing daemon data in the RAM can be wasteful because the same RAM can be used, say, for caching while the daemon is inactive. Restoring the deamon from swap is of course marginally slower than from RAM, but it does not matter, as it is not a time-critical application. Swapping the deamon data to disk is extremely efficient, because only changed pages needs to be saved, most of the saved state remains unchanged and does not need to be touched.

If you don't have enough RAM for the processes you want to run then swapping is part of a memory management strategy for the OS but trust me, it is never optimal to swap when there is any other option.

Again, I do not think that this is true. If swapping does not degrade performance, but actually frees up system resources while optimally using them, then it is the optimal solution. Unless you really have tons of RAM. The cost/benefit equation is quite fragile here.
 

Mr. Buzzcut

macrumors 65816
Jul 25, 2011
1,037
488
Ohio
Excellent - yes it would be outdated, haven't bothered keeping up with windows memory management since XP pushed me across to OSX.

Glad to see all OS' agree that empty RAM is wasted - just the algorithms differ on what to fill it with....thanks for the clarification :)

Interesting to note a high proportion of currently-moving-to-OSX ex-Win users have the same misunderstanding of current windows behaviour (hence asking about OSX running full memory). I guess Microsoft didn't do a good job of selling that change to the general user-base, or they are migrating from XP-era versions....

Or friends with Macs are filling them full of misinformation about the "benefits" of moving to OS X! :) Joking, of course. I think people get in these forums and start tinkering without reading much background info. They worry about stuff they don't understand and start making changes to fix problems that don't exist. As an example, it doesn't really matter what the problem is but you can be assured someone will suggest resetting SMC and PRAM, and repairing permissions.

I'm not suggesting everyone needs to understand memory management but I think they should read up on it a bit if they are going to spend time worrying about it or take some kind of "corrective" action like using memory cleaners or needlessly killing processes.
 

simonsi

Contributor
Jan 3, 2014
4,851
735
Auckland
Or friends with Macs are filling them full of misinformation about the "benefits" of moving to OS X! :) Joking, of course. I think people get in these forums and start tinkering without reading much background info. They worry about stuff they don't understand and start making changes to fix problems that don't exist. As an example, it doesn't really matter what the problem is but you can be assured someone will suggest resetting SMC and PRAM, and repairing permissions.

I'm not suggesting everyone needs to understand memory management but I think they should read up on it a bit if they are going to spend time worrying about it or take some kind of "corrective" action like using memory cleaners or needlessly killing processes.

Yep to all of that :)
 

dyn

macrumors 68030
Aug 8, 2009
2,708
388
.nl
Swapping is a backup to your memory, it should be not used to extend your memory. You're not only harming your drives but also your overall performance.
Swap is absolutely NOT a backup to your memory and it certainly isn't in OS X. Swap is just memory on disk and it is quite useful. Why? Because it frees up actual memory. It is something that is heavily used in virtualisation products because it makes far more efficient use of memory than without it. Swap is more like a parking lot where you can park stuff that you don't quite actively use. Similar to App Nap.

And no, your swap usage should NOT be increasing in any conditions. That's an inefficient memory management if your swap is increasing over time. If it is increasing, it means you need more memory or shut down your apps more often. Also a sign of serious memory leaks.
In general yes but not in OS X and not with certain applications or in the virtualisation world.

Apps don't use swapping, they know nothing about it.

Swapping/paging is an OS activity used as part of the OS' memory management, if it has a better solution (more RAM or compression), it will use it to keep performance up. If the OS is swapping then it has run out of better options and performance is starting to degrade.
What you are describing is only part of the story. Memory management is not something that is only done by the OS for very obvious reasons. The app knows about its memory, the OS doesn't and vice versa. Therefor they have to work together. That's why apps can use more memory than they need and why they return memory when other apps need it more. And that's also why they are able to swap. The app requests the OS to swap.

Interesting to note a high proportion of currently-moving-to-OSX ex-Win users have the same misunderstanding of current windows behaviour (hence asking about OSX running full memory). I guess Microsoft didn't do a good job of selling that change to the general user-base, or they are migrating from XP-era versions....
And because of that about 99% of the people here have the same misunderstanding of memory management. Memory management is done differently in the non-Windows world. Windows has been catching up to that as of Windows 7 (and they did a great job). However, the knowledge about memory being used as little as possible and the same for swap is just outdated. We have moved on years ago.

One thing to note is that RAM and swap are only small parts of the entire memory system. Another important thing to note is that this system used by both software and hardware (PCIe devices and such; the reason why 32 bit Windows systems can't address more than 3.25GB of memory, the other 0.75GB is for things like PCIe devices, graphics, etc.).

The following articles describe more about OS X memory usage. Read them very very carefully:

And the main article: Memory Usage Performance Guidelines

The above links are all part of developer.apple.com and are aimed at developers who write software for OS X. It tells them how their applications should interact with the memory system in OS X. It's all very technical. The only thing Average Joe needs to remember is what the help function in Activity Monitor tells them and that is to look at the memory pressure. If it is any other colour than green you have a problem, if not then all is well. You can safely disregard the other numbers.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.