Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

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

Lion - Memory Usage Problems

Why is Lion using all 4GB of RAM running Mail, Safari (2 tabs), and iTunes? Snow Leopard was bad enough at handling memory, eating up every available byte and Lion seems to be arbitrarily using even more RAM. Windows 7 has zero problems handling RAM, there's no reason OS X shouldn't be able handle memory properly.


Can someone explain what Apple is doing here? I'm at a total loss. For users who just need Safari, Mail, and iTunes... I guess this works. But how am I expected to reliably run Logic, Final Cut, or Aperture with OS X using every available resource for Web Surfing, E-mail, and Music. This is totally unacceptable for a multi-million dollar software company greated towards professionals as well as consumers.


The following responses are not acceptable by the way:


  • Buy more RAM - I did that already, it will eat up 2/4/8GB, doesn't matter. Not to mention Apple still sells numerous 2/4GB confirgurations.
  • Buy a newer/more powerful Mac - this is a improper handling of memory issue, not a hardware issue.


I'd really love some insight into this. Thanks for reading.

MacBook Pro, Mac OS X (10.7), 13" (late-2009)

Posted on Jul 21, 2011 5:45 AM

Reply
957 replies

Jul 25, 2011 10:43 PM in response to John Kitchen

I've noticed a definite increase in RAM consumption as well and queried Apple; the reply/explanation was a bit technical, but had to do with the difference of running in 64 bit mode vs. 32 bit mode and it appears one has to accept that. My comment was that the minimum RAM requirements should be increased; there are too many who think it'll be fine running it with the minimum requirements.

Jul 26, 2011 1:44 AM in response to babowa

I am experiencing astronomical memory consumption by Mail. See this screenshot from Activity Viewer and descriotion of circumstances below:


User uploaded file


I turned my iMac on when I arrived at work at 8.30 am and opened Mail. At lunchtime I went out for an afternoon meeting and when I arrived back at 5.45 pm the machine was completely unresponsive - you can see why. I have 12 GB of RAM and to only have 24 MB free is ridiculous!


Mail's memory usage far outweighs any other app. At the moment it is running at 2.17 GB real memory plus 2.26 virtual. I have 2 Exchange 2007 accounts plus my MobileMe, which is the same as I had in Snow Leopard but I don't remember this kind of memory usage under Snow Leopard.


I now need to leave Actvity Viewer running and quit and relaunch Mail every so often to work around this issue.

Jul 26, 2011 5:30 AM in response to Roo Machell

Anyone thinking this is intended from a 64-bit OS needs their head examined. Microsoft has been running a 64-bit OS just as long as Apple... and you'll find it has no problem managing memory efficently. If anyone at the Genuis Bar tells you it's normal for Mail or Safari to be using 1-5GB+ of RAM regularly, call Apple directly.



The post below is a perfect example of how Lion will consume all memory... no matter how much you have.

Roo Machell wrote:


I am experiencing astronomical memory consumption by Mail. See this screenshot from Activity Viewer and descriotion of circumstances below:


User uploaded file


I turned my iMac on when I arrived at work at 8.30 am and opened Mail. At lunchtime I went out for an afternoon meeting and when I arrived back at 5.45 pm the machine was completely unresponsive - you can see why. I have 12 GB of RAM and to only have 24 MB free is ridiculous!


Mail's memory usage far outweighs any other app. At the moment it is running at 2.17 GB real memory plus 2.26 virtual. I have 2 Exchange 2007 accounts plus my MobileMe, which is the same as I had in Snow Leopard but I don't remember this kind of memory usage under Snow Leopard.


I now need to leave Actvity Viewer running and quit and relaunch Mail every so often to work around this issue.


It's a serious memory leak that needs to be addressed, period. Though I have not experienced anything quite as bad as the above, it's clear this is a broad issue affecting many people.

Jul 26, 2011 5:50 AM in response to mightymilk

Wow i was thinking update 2011 imac from 4gb to 12gb thinking may i it run with some free but i see is using all even having 12gb.Shall be something to do with Lion using ram to relax processor,apple say something like that about SL and after claim to be better in Lion,i really hope it is.Your screenshot is incredible mail is getting like almost 18gb of virtual memory my god Lion like or need ram a lot ...

Jul 26, 2011 7:20 AM in response to mightymilk

With Lion:

- 2010 MacBook Air with 4GB: - Safari Web Content = 98% of 1 core & 650-950MB memory hog

- 2010 iMac with 16GB: Safari Web Content = 4% of 1 core and 300MB (stable) memory usage


I wonder if Apple has code in Safari to behave differently based on memory footprint and that code is not working as intended. I say this because with NOTHING ELSE RUNNING on my 4GB Air, it behaves just as badly as when I have many other things running. Whereas on our iMac, nothing can make Safari behave badly - it just works (which is some consolation).

Jul 26, 2011 8:03 AM in response to mightymilk

mightymilk wrote:

As I said though, Flash for Safari seems to run under it's own Process called:

Flash Player (Safari Internet Plug-in)


If I look at the Activity Monitor... the Process using up all the RAM is Safari Web Content. Which is a seperate entity from the processor labeled Safari, but most likely closely related.

Safari now runs each web page as a separate process. This is done so that if there is a problem with one page, the others won't be affected & Safari won't hang. To do this, Safari's main process is now a separate one, & the page-specific stuff runs in the Web Content process. Likewise, the main Flash process runs separately.


Previously, pages shared as many memory resources as possible -- that's one reason a problem with one page could affect all of the others. This new approach does use more memory; however, it isn't as bad as you might think.


As already mentioned, the OS changes what is in memory much faster than Activity Monitor can follow. Moreover, the numbers it shows for each process & the pie chart display do not tell you what that memory contains or how it is being used. So for instance, the memory storing some or all of a web page's processes may be paged out & another's paged in several times before Activity Monitor next samples its use. And because the OS X memory manager tries to leave in memory resources that may be reused to improve performance, until there is a more pressing demand for those chunks of memory, some or all of it may remain in memory for a relatively long time, even if the web page that put it there is closed. It all depends on what the resources are & if any other processes (including ones not related to Safari) might want to use them.


Activity Monitor won't tell you any of this. So the key numbers to look at are the page swaps, which at least tell you about the overall paging activity since the last start up. The other numbers tell you almost nothing useful when looked at individually.

Jul 26, 2011 8:16 AM in response to R C-R

R C-R wrote:


mightymilk wrote:

As I said though, Flash for Safari seems to run under it's own Process called:

Flash Player (Safari Internet Plug-in)


If I look at the Activity Monitor... the Process using up all the RAM is Safari Web Content. Which is a seperate entity from the processor labeled Safari, but most likely closely related.

Safari now runs each web page as a separate process. This is done so that if there is a problem with one page, the others won't be affected & Safari won't hang. To do this, Safari's main process is now a separate one, & the page-specific stuff runs in the Web Content process. Likewise, the main Flash process runs separately.


Previously, pages shared as many memory resources as possible -- that's one reason a problem with one page could affect all of the others. This new approach does use more memory; however, it isn't as bad as you might think.


As already mentioned, the OS changes what is in memory much faster than Activity Monitor can follow. Moreover, the numbers it shows for each process & the pie chart display do not tell you what that memory contains or how it is being used. So for instance, the memory storing some or all of a web page's processes may be paged out & another's paged in several times before Activity Monitor next samples its use. And because the OS X memory manager tries to leave in memory resources that may be reused to improve performance, until there is a more pressing demand for those chunks of memory, some or all of it may remain in memory for a relatively long time, even if the web page that put it there is closed. It all depends on what the resources are & if any other processes (including ones not related to Safari) might want to use them.


Activity Monitor won't tell you any of this. So the key numbers to look at are the page swaps, which at least tell you about the overall paging activity since the last start up. The other numbers tell you almost nothing useful when looked at individually.

Safari most definitely does not use seperate processes for each web page. There is (1) Safari, (1) Safari Web Content, and (1) Flash Player Safari Plugin no matter how many tabs are open. You're thinking of Google Chrome.


Given the sluggish performance and spinning beach balls after all memory has been consumed, the general consensus seems to be this is a disadvantage. Page swaps are happening at quite a large rate, as indicated by my experience as well as the post I quoted above.


However, we do know this problem is not affecting all users and therefore haven't been able to pin down the specific reason for the problem. It is a problem though and the posts above outline that very clearly.

Jul 26, 2011 8:19 AM in response to R C-R

With all due respect, R C-R, I'm a little confused by your post above. May I suggest a summary with a pragmatic twist in the interest of taking your fantastic information and twisting it into a form that may help us get some insight from other users? Please feel free to edit what appears below to reflect the dynamic you are hoping to trap. I suspect other users will happily contribute their findings so that we can help diagnose & persuade Apple to fix.


If you are seeing Safari Web Content eat 98% of 1 core on your Mac, you are experiencing a Lion Safari problem that we hope Apple will fix. Fill out the feedback form and subscribe here with a +1 Safari Lion CPU Bug note.


If you are seeing Safari Web Content gobble 700M of real memory on your mac, you may have a Lion Safari problem, but it is hard to tell because things page in and out of memory differently in Lion.


May we suggest that you watch this process on Activity monitor on and off and:

- if it stays in the 600M - 700M range, you are experiencing a Lion Safari problem. +1 Safari Lion Memory Bug

- if it does not -- if Real Memory usage fluctuates, you may be able to help us diagnose by explaining the page swaps that you see.

[R C-R, please augment this...]

Jul 26, 2011 11:05 AM in response to mightymilk

You are right. I did not explain that clearly. Safari does not use seperate processes for each web page. But it does use separate processes for web content & user interaction, & Activity Monitor can't sample anything besides the total used for all web processes, or do so frequently enough to show how quickly what it contains changes.


And because the OS does not waste resources in memory by releasing them to the free memory pool prematurely (which would reduce performance substantially because it takes so long to refetch them from the drive), Activity Monitor can't tell you how much of the web content's resources are actually in use at any given time, or if they will be paged out or discarded when some other process needs some or all of the memory they occupy.


Likewise, Activity Monitor can't show you which resources used by a process are eating up CPU time.


All you really get from Activity Monitor is an overview, showing roughly how the system's resources are distributed among all its processes. Looking at just one or a few processes tells you very little about that.


Basically, what this means is that while Activity Monitor may give some clues about how memory is being used, it won't by itself tell you if some process is "hogging" more memory that it should. Memory is a resource shared by all processes. Allocations change very quickly, typically in very small increments of a few KB or less. Many processes are running concurrently, including many that users do not initiate or control.


To understand what Activity Monitor is (& isn't) telling you, you must take all that into account, & more. It may be that one or several web pages have demanded a lot of resources & no other processes are as yet asking for much of the memory they used. It may be that some plug-in or third party addition keeps demanding resources be placed in memory, even if they aren't actually being used. Maybe an OS file is damaged or a preference file is corrupted. The file system may have issues that affect virtual memory.


I don't want to turn this into a debate. All I'm really saying is you can't tell from one or a few numbers you see in Activity Monitor if you have a memory use problem or not. The more details you can provide, the more likely it is that we can figure out what (if anything) is wrong. Not every problem will have the same cause, so don't assume that it isn't important to contribute your own details.

Jul 26, 2011 11:25 AM in response to mightymilk

Over in the Aperture community, I posted an essay on RAM and the move to Lion which may help you. It's probably illegal to post it again, but so what. Shoot me! I think this will help some people.


-------------------------------------------------------------------------------- --------


John Kitchen wrote:


I'm going to suggest something that may explain why sometimes things go badly for one person, and go well for the next person when moving to Lion.


Again it is the RAM issue. Mac OS X (like most OSes), is a virtual storage system which squeezes a lot of potential RAM demand into a much smaller amount of RAM.


What needs to be understood here is "working set".


Looking at my Activity Monitor beside me, I see that the Activity Monitor process itself is consuming about 95 MB of virtual memory, whereas it is using less than 20MB of real memory. "Real" memory is the physical stuff with the chips etc.


So how can 95 fit into 20? It can't, but what OS X has determined is that the "working set" of memory for the Activity Monitor process is less than 20MB. The working set is that part of the process's allocated memory which is getting a lot of use, and the rest is parked on disk in case it's needed. For example, it may be program code which is only used under unusual or different circumstances, such as text strings in languages other than the one I am currently using.


The tricky thing about "working set" is that while you have enough RAM to contain that "working set", everything tends to go very, very well. Evidence that it is working well is that "Page Outs" are zero (see Activity Monitor).


But if that working set grows, then you will eventually see Page Outs happening as OS X finds that it has to swap out pages to make room for other pages. (A "page" is 4K bytes).


Within reason, a little paging is OK. If Page Outs only happen a few times per minute, they probably won't hurt you much since they represent a work delay of only about1/100th of a second (very approximately, don't shoot me for this estimate!).


The problem is that the difference between the working set fitting and not fitting in RAM can be catastrophic with only a slight change in the working set size. One minute, all is well, the next it's a mess. Or really, I should say one millisecond, all is well, and the next it is a mess. Things happen really quickly in RAM!


The best analogy is the freeway. We are all zipping along at near the speed limit in very heavy traffic, something happens in the opposite lanes causing gawking drivers to ever-so-slightly back off on the gas and slow down just a little, and the next thing, we have a traffic snarl.


Back to your Mac. In the pre-Lion situation, if your working set for the processes you choose to use is very, very close to filling your RAM, the move to Lion may push this over the edge, causing the "traffic snarl".


On the other hand, if you had plenty of spare RAM with Snow Leopard, the move to Lion will reduce that spare RAM, but not enough to cause paging to rise enough to hurt you.


How can you get some insight into waht will happen when moving to Lion? That's really hard, but what is for sure, if you are already getting Page Outs in any significant quantity, that quantity will rise with Lion unless you change your work habits (like run fewer apps at the same time). Page Outs under Snow Leopard should send off warning bells for you to get more RAM before going to Lion.


My advice is always to have more RAM than you need.


In another thread, a poster said something like "Sure, Apple said you can put Lion in a 2GB Mac, but they didn't say you'd enjoy it!"

Jul 26, 2011 12:05 PM in response to John Kitchen

John Kitchen wrote:


Over in the Aperture community, I posted an essay on RAM and the move to Lion which may help you. It's probably illegal to post it again, but so what. Shoot me! I think this will help some people.


-------------------------------------------------------------------------------- --------


John Kitchen wrote:


I'm going to suggest something that may explain why sometimes things go badly for one person, and go well for the next person when moving to Lion.


Again it is the RAM issue. Mac OS X (like most OSes), is a virtual storage system which squeezes a lot of potential RAM demand into a much smaller amount of RAM.


What needs to be understood here is "working set".


Looking at my Activity Monitor beside me, I see that the Activity Monitor process itself is consuming about 95 MB of virtual memory, whereas it is using less than 20MB of real memory. "Real" memory is the physical stuff with the chips etc.


So how can 95 fit into 20? It can't, but what OS X has determined is that the "working set" of memory for the Activity Monitor process is less than 20MB. The working set is that part of the process's allocated memory which is getting a lot of use, and the rest is parked on disk in case it's needed. For example, it may be program code which is only used under unusual or different circumstances, such as text strings in languages other than the one I am currently using.


The tricky thing about "working set" is that while you have enough RAM to contain that "working set", everything tends to go very, very well. Evidence that it is working well is that "Page Outs" are zero (see Activity Monitor).


But if that working set grows, then you will eventually see Page Outs happening as OS X finds that it has to swap out pages to make room for other pages. (A "page" is 4K bytes).


Within reason, a little paging is OK. If Page Outs only happen a few times per minute, they probably won't hurt you much since they represent a work delay of only about1/100th of a second (very approximately, don't shoot me for this estimate!).


The problem is that the difference between the working set fitting and not fitting in RAM can be catastrophic with only a slight change in the working set size. One minute, all is well, the next it's a mess. Or really, I should say one millisecond, all is well, and the next it is a mess. Things happen really quickly in RAM!


The best analogy is the freeway. We are all zipping along at near the speed limit in very heavy traffic, something happens in the opposite lanes causing gawking drivers to ever-so-slightly back off on the gas and slow down just a little, and the next thing, we have a traffic snarl.


Back to your Mac. In the pre-Lion situation, if your working set for the processes you choose to use is very, very close to filling your RAM, the move to Lion may push this over the edge, causing the "traffic snarl".


On the other hand, if you had plenty of spare RAM with Snow Leopard, the move to Lion will reduce that spare RAM, but not enough to cause paging to rise enough to hurt you.


How can you get some insight into waht will happen when moving to Lion? That's really hard, but what is for sure, if you are already getting Page Outs in any significant quantity, that quantity will rise with Lion unless you change your work habits (like run fewer apps at the same time). Page Outs under Snow Leopard should send off warning bells for you to get more RAM before going to Lion.


My advice is always to have more RAM than you need.


In another thread, a poster said something like "Sure, Apple said you can put Lion in a 2GB Mac, but they didn't say you'd enjoy it!"


Most of us replying understand how PFing works. The problem here appears to be a very serious memory leak... which has nothing to do with having enough RAM. As was outlined numerous times, it doesn't matter whether you have 2, 4, 8, 12, or 24GB or RAM (this has been proven in posts above)... Lion will consume all RAM eventually using nothing but Safari and/or Mail.


To go into further detail, I had no memory issues under Snow Leopard nor was I close to my 4GB limit. If I'm running Logic, Aperture, or Final Cut I will typically close down other applications to make sure these programs can draw every ounce of RAM, Processor, and HDD power. During typical operation I had Safari, Mail, and iTunes and had anywhere from 1.5-3GB of free RAM.


I realize you're trying to help... but I'm not entirely sure that your grasping what a memory leak is. Again it's not that your isight isn't appreciated, but we're beyond the point of this being shrugged off as "user error" anymore.

Lion - Memory Usage Problems

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