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.

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

Feb 14, 2012 7:00 AM in response to JonSticklen

JonSticklen wrote:


And I have to respectfully disagree about Apple listenting to this forum.

It isn't that Apple completely ignores the forums. It is that there are thousands of discussions & the ones with hundreds of replies like this one are the most difficult to mine for data useful to Apple engineering.


There is no requirement that users post even the most basic info about their problems, or even that they post in an appropriate forum. Consider for instance the number of posts in this one discussion that are not specifically about Lion or the ones that don't specify the Mac model they are using, if they are using any third party add ons, if they have tried any of the standard troubleshooting techniques other users have suggested, & so on.


Compare the info provided in a typical post vs. what Apple asks for in the feedback forms or, if you have a free developer connection account, what is required for a bug report. Go through the 600+ posts here & note how few unique users are actually reporting a specific problem vs. those that post basically the same thing multiple times, or "me too" posts that don't make it clear exactly which problem they mean. Some of the posts don't even seem to be about any actual problem their authors are having, instead asking how they would know if they did or just worried they might have problems if they upgraded their OS.


There are relatively few hosts for the forums. Their primary responsibility is to make sure users abide by the terms of use, don't post personal info that would compromise their privacy, & things of that nature. Every user that reaches level 2 or above gets a "report this post" link for every post in every discussion. There are around 3.5 million registered ASC users, many of them new & unfamiliar with the ToU. Just dealing with the reports submitted by users about posts that need host attention for one reason or another takes a lot of their time. They also have to deal with problems in the software that powers the forums (which is not a Apple product) & that eats up a lot of time as well.


If & when they have the time, they do try to sift through all this stuff for things that should be sent on to Apple engineering but that depends more than anything else on the amount of useful info users provide vs. the all the rest of it.

Feb 14, 2012 7:26 AM in response to Michelasso

Of course, OS X has bugs as does anything designed and executed by humans.


On your other comments: perhaps it is easier for you to understand Windows 7 memory management, because it is very primitive. How effective something so primitive can be.. depends - it is said that sharks, being very primitive fish are actually much more effective than others, yet some far more complex and advanced than them (dolphins) turn to be even more adequate and adaptive. By all means, if you want simple and easy to understand at first glance VM, stay away from UNIX. Linux is no more UNIX than OS X is, by the way.


I have wondered (as you guessed) on how OS X memory management runs. Still, I haven't encountered as weird situations as you have, but: most of my work for the past 20 years is done on BSD UNIX. That is both desktop and servers (lots of them). I run OS X currently on an Macbook Air and by all means find it more convenient to read my mail on OS X, than on my BSD workstation (Windows is out of question, if we talk performance), because OS X is tuned in such a way that I get way more responsive experience from the rather underpowered Air, than my workstation. This has to do with memory and process management in that OS X is finely tuned for the UI and desktop performance.I tune my BSD desktop from time to time and get even better experience, but that is moving target and desktops are meant for using, not fiddling with.


Anyway, this all is going very off-topic. My experience with OS X memory management has been so far good. There have been times when Mail would grab a lot of memory (but I have few million messages in dozens of folders in IMAP), but no behavior I would not expect. I have never had extreme memory usage with Safari, excet for the Flash plugin, but that is Adobe's fault.

Feb 14, 2012 2:46 PM in response to dkalchev

dkalchev wrote:


Of course, OS X has bugs as does anything designed and executed by humans.


On your other comments: perhaps it is easier for you to understand Windows 7 memory management, because it is very primitive. How effective something so primitive can be.. depends - it is said that sharks, being very primitive fish are actually much more effective than others, yet some far more complex and advanced than them (dolphins) turn to be even more adequate and adaptive. By all means, if you want simple and easy to understand at first glance VM, stay away from UNIX. Linux is no more UNIX than OS X is, by the way.

To stay away from Unix? Sorry mate, I have been working for 20+ years with AIX, Solaris and now HP-UX systems and I never had such an headache monitoring the memory usage. Same for Windows 7 memory management system. No matter how much I despise Microsoft (I consider it the Evil of computer industry) Win7 memomy management system is all but primitive. Actually on paper its functionalities are pretty similar to the ones of OS X. Regarding Linux, Linux is not Unix, as OS X instead is. Linux is Unix-like. I am not a Linux fan but no matter what even IBM is stealing a great amount of ideas from Linux. Not to mention that most supercomputers now run a modified version of Linux.


I want to make it clear, though, that in my experince OS X 10.7.3 compared to 10.7.0 is much more efficient in terms memory management. In 10.7.0 the free memory was always near 0, with the OS often paging out making the system unstable so much that I had to reboot twice a day. Now I can go on doing the usual stuff for hours without even hitting the backing storage. Apart from sometimes when I stil get funny numbers like some others posted lately in this discussion.

Feb 19, 2012 3:01 PM in response to javatoid

Note: I also frequently see the error, "Your Mac OS X startup disk has no more space available for application memory." My startup disk has a capacity of 1000 GB, and has about 81% (811 GB) free.


And I don't know whether it's realted, but I also get occasional kernel panics -- the black window telling me I need to restart my computer (Apple's version of the Blue Screen of Death). This never happened to me with Tiger, Leopard, or Snow Leopard.

Feb 21, 2012 10:31 AM in response to mightymilk

I found the memory issue to be a huge problem since upgrading to Lion. In order to make my office work I have my EMR running in a Windows 7 Virtual machine, Safari for reference, Firefox to establish VPN connection for Citrix client, Dragon Dictate running. After a few days, my swap file would approach 5 GB (with 4 GB RAM). I would then have the spinning beachball for several seconds to sometime even minutes when switching between apps. Once it took almost 30 minutes to switch from my voice recognition to my VM window... ridiculous. I just intalled 8 GB of RAM (around $50 from OWC) and it is the best money I've spent. I have not seen the "beach ball" all morning, and my 2.8 Core 2 Duo is blazing fast again. Debate all you want, I don't think 4 GB of RAM is enough to run resource intensive apps in Lion.

Feb 26, 2012 11:38 AM in response to mightymilk

+1 to this thread


In 10.6, VM and memory management was great, the responsiveness of apps were great, and I was a very happy user.


In 10.7 life has been terrible. I have a smattering of OS-X machines and after making the plunge to iOS 5 and iCloud, all of my systems are 10.7 and all of them exhibit the same problems. My primary five applications are Terminal, Mail, iTunes, Preview, and ${BROWSER}. Between those applications, I wouldn't expect any problems, but I suffer through an easy 5min of beachball swapping every hour while swap is paging data in and out. If I could downgrade, I would. I use ssh(1), emacs(1), listen to music, browse the Internet and read PDFs. When did that simple workflow become a problematic work flow for the VM? Every few weeks I now have to reboot to clear out the swap space because it grows to 10s of GB if I'm not careful. Under 10.6 I'd reboot once a quarter, at best.


My favorite augmentation to my workflow is I now have a text file that I keep around called "links.txt" that I use to copy/paste URLs in to so that I can quit all of my browsers in order to free up memory. It doesn't solve the ever-growing swap problem, but at least I can reclaim 1-2GB of RAM by exiting Firefox or Safari. Does anyone else remember when browsers consumed only 50MB of RAM to render a page? Is there a way to disable precaching? I'll gladly wait an extra second if I could keep Safari or Firefox limited to 500MB of RAM.


At the very least, are there any /etc/sysctl.conf tunables that could be plugged in to change the aggressiveness at which memory is actually released?



% sysctl kern | grep ^kern.vm_ kern.vm_page_free_target: 2000 kern.vm_page_free_min: 1500 kern.vm_page_free_reserved: 100 kern.vm_page_speculative_percentage: 5 kern.vm_page_speculative_q_age_ms: 500 kern.vm_max_delayed_work_limit: 32 kern.vm_max_batch: 256

Feb 26, 2012 4:54 PM in response to chitt

I am not technically informed enough to participate in the more minute details of this discussion, but let me add my voice to those who are concerned that Lion just inhales memory, leaving users with very little to run on and frequent spinning beach balls when programs start to gasp for more. This is less of a problem with my 2011 MacBook Air than it is with my MacBook Pro mid-2010, but that's not to say that the Air is managing memory better under Lion. Still, with the MBP, it's much more noticeable because applications regularly slow down to a turtle's crawl and even crash (Mail is the biggest, but not sole, offender). I have erased my disk and restored Lion on the MBP, but that has not solved the issue. My next step will be to upgrade from 4 to 8 GB RAM, which is a fairly cheap fix, but should be unnecessary, given Apple's published specs for Lion. I feel like I am back in the pre-OS X era, when Macs crashed unexpectedly and programs were inherently unstable. My surmise is that Lion is simply encrusted with a surfeit of functions under the hood that make enormous demands on memory, and Apple has not copped to the problem or been able to fix it.

Mar 4, 2012 1:46 PM in response to mightymilk

So, I have a similar problem, except I'm using Firefox instead of Safari - and I don't really believe that is the problem.


I have 16gb of RAM installed, and right now, just Firefox, iProcrastinate and Activity Monitor running.

I only have 7.4gb free memory, around 1.4gb wired, 6.2gb active and 900mb inactive.

Page ins = 4.16gb and page outs = 1.8mb


Kernel Task is using 1gb (real memory)

Firefox uses about 250mb

mds uses 166mb (real) and 707mb (virtual)


Should I be worried? Is this normal? Is there a solution for this?

Mar 5, 2012 8:24 AM in response to mightymilk

R C–R wrote:

No, yes, & no solution is needed because you are not running out of memory.

I beg to differ... Better memory management should have cap memory usage.

This thread shows that what undeadkim experiences may be "normal" in the sense that many users are experiencing this, too.

It also shows that there is a pain.


I'd like to refer the readers to the Ars Technica review about this: http://arstechnica.com/apple/reviews/2011/07/mac-os-x-10-7.ars/10

Mar 5, 2012 9:13 AM in response to yoelf

Indeed. All I know is that I just finished doing some tests with Windows 8 Consumer Preview installed in a bootcamp partition of my MacBook with 3GB of RAM. I had Chrome with more than a dozen tabs open, few Metro applications hidden only God knows where, other small stuff and I started a Win7 virtual machine I made with VirtualBox in OS X. Its assigned RAM was 1.5GB. The total WIndows 8 RAM consumptionwith the Win7 VM fully operational has been 2.6GB, 400 MB free. All other applications where responding just fine. In the same scenario OS X Lion used all the 3GB RAM avaialbe and swapped out 2-3GB of memory. Oh, Windows 8 was running at 64 bits, obviously, while my Mac won't be able to run OS X Mountain Lion. If this is the way Apple wants to compete, they can be my guests. But I doubt my next machine will be another over-expensive, resources eating, soon to be obsoleted OS X ready computer.

Mar 5, 2012 9:17 AM in response to yoelf

I hve no idea what you mean by "better memory management should have cap memory usage."


Regarding the Ars Technica review, it should be obvious from reading it that the issue of memory management is complex, involving tradeoffs among performance, compatibility, & data safety with no one "right" answer.


Also please note that my answer was intended specifically for undeadkim's questions & based on the info provided about that Mac's memory use.

Mar 5, 2012 11:11 AM in response to Michelasso

Michelasso,


Glad you like windows 8, hope you enjoy your expensive tablet PC OS.


If your mac can't run in 64bit mode kernel (did you try holding 6 and 4 while rebooting??) then your windows VM isn't running in 64 bit mode. Plus, as I know it, there are two copies of Windows, a 64 bit one and a 32 bit one, each costs roughly 100 american dollars, and switching from one to the other is hard (unless you shelled out the money and either created a partition or clean install the os). Where, again, all you have to do is hit 6 and 4 during boot up to get into 64 bit mode on a mac and applications that support it, are able to be opened in 32 bit mode.


But I digress, Windows 8 looks horrible and I'm glad to be a mac.


-MIB

Mar 5, 2012 2:47 PM in response to TheSmokeMonster

TheSmokeMonster wrote:


Michelasso,


Glad you like windows 8, hope you enjoy your expensive tablet PC OS.


If your mac can't run in 64bit mode kernel (did you try holding 6 and 4 while rebooting??) then your windows VM isn't running in 64 bit mode. Plus, as I know it, there are two copies of Windows, a 64 bit one and a 32 bit one, each costs roughly 100 american dollars, and switching from one to the other is hard (unless you shelled out the money and either created a partition or clean install the os). Where, again, all you have to do is hit 6 and 4 during boot up to get into 64 bit mode on a mac and applications that support it, are able to be opened in 32 bit mode.


But I digress, Windows 8 looks horrible and I'm glad to be a mac.


-MIB

What didn't you understand about "Windows 8 Consumer Preview installed in a bootcamp partition of my MacBook"? Yes, the one for free, so I downloaded (and installed) the 64 bits version. It works. Mountain Lion won't because of the bleeding EFI32.


Then the 64 bits Win7 virtual machine has been running on top of Win 8 in a case, Lion in another. Because the virtual machines can run in 64 bits modes still booting the 32 bits kernel (as long as there is at least a Core 2 Duo), since the virtualizers are 64 bits applications.


If it sounds too confusing the point is simple: In my MacBook (and other Macs) Windows can boot at 64 bits, OS X can't. Also WIndows uses much less RAM than OS X.


Regarding Windows 8 being horrible at the beginning I thought the same. But after few days playing with it I am now certain it will be an huge success. Not only its Metro design is far more advanced (and cooler) than what it first looks, Windows 8 is also unbelievably optimized. I find it irritating that a Windows beta performs better than OS X in my Mac. Especially in terms of RAM, which is the topic of this discussion.

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 Account.