Skip navigation

Lion - Memory Usage Problems

271528 Views 957 Replies Latest reply: Dec 1, 2013 1:28 PM by Jonathan Payne1 RSS
  • Orukaz Calculating status...
    Currently Being Moderated
    Jul 25, 2011 10:23 PM (in response to mightymilk)

    Hi, Also I noticed that OS X Lion takes by default over 2 GB or at least 1.7 GB of memory. I had to update my 13" Macbook Pro Mid 2008 Memory form 2GB to 4GB and if I have some programs open including Safari, Mail 3.7 GB of RAM is used. Before with Snow Leopard I had at least 1GB of memory free by that condition.

     

    I think this memory problem is not caused only by Safari and Mail and so on, it is overall OS X Lion problem. I installed Lion to my 24" iMac, Early 2008 (2.8 GHz, 4 GB RAM, ATI Radeon HD 2600 Pro 256 MB), and it feels like it runs 2 times slower than Snow Leopard. May be Lion graphics takes more resources, I don't know...

     

    I hope some new update fixes mempry issues and makes Lion overall faster.

  • babowa Level 7 Level 7 (22,140 points)
    Currently Being Moderated
    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.

  • Roo Machell Calculating status...
    Currently Being Moderated
    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:

     

    MailExcessiveMemoryUsage642w.png

     

    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.

    iMac, Mac OS X (10.7)
  • John Kitchen Level 3 Level 3 (635 points)
    Currently Being Moderated
    Jul 26, 2011 5:41 AM (in response to Roo Machell)

    That's a shocking amount of Page Outs, three times the Page Ins!

     

    What is odd is the rates calculated by Activity Monitor - 548 KB/sec page in rate and ZERO bytes per sec page out rate?  Hmmmm.

     

    548 KB/sec is 137 pages per second, so your system disk must be pretty much busy doing nothing but paging unless it's an SSD.

  • John Kitchen Level 3 Level 3 (635 points)
    Currently Being Moderated
    Jul 26, 2011 5:44 AM (in response to mightymilk)

    Agreed.  Blaming it on 64 bit is absurd.

  • Thebestplacehere Level 3 Level 3 (700 points)
    Currently Being Moderated
    Jul 26, 2011 5:45 AM (in response to mightymilk)

    May safari need lot of ram now to be faster ..

  • Thebestplacehere Level 3 Level 3 (700 points)
    Currently Being Moderated
    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 ...

  • Thebestplacehere Level 3 Level 3 (700 points)
    Currently Being Moderated
    Jul 26, 2011 5:53 AM (in response to mightymilk)

    Screen Shot 2011-07-26 at 13.51.17.pnghere now with safari,itunes open is like half use but believe me they just open i am sure if i start using it it go up like other days ..Screen Shot 2011-07-26 at 13.51.04.png

  • Todd Curry Level 1 Level 1 (0 points)
    Currently Being Moderated
    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).

  • R C-R Level 6 Level 6 (13,845 points)
    Currently Being Moderated
    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.

  • Todd Curry Level 1 Level 1 (0 points)
    Currently Being Moderated
    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...]

  • R C-R Level 6 Level 6 (13,845 points)
    Currently Being Moderated
    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.

  • John Kitchen Level 3 Level 3 (635 points)
    Currently Being Moderated
    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!"

1 2 3 4 5 ... 64 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (32)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.