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

May 29, 2013 7:49 AM in response to chitt

That'll teach me to try to help out. You said "kill" your browsers which is different from quitting. And you would be amazed how many people come from Windows and think closing a window quits the application (a perfectly reasonable assumption). And if you wait until 11Gb of real memory you've waited too long which makes me wonder *** are you thinking? Are you hoping for some sort of happy ending between the time you hit 5Gb and 11Gb?


If you look at a website and then are done for a while, quit the app and your problem goes away. If you visit a website and it shoots up to 11Gb of RAM in no time, stop visiting that web site.


FYI: JS is great in a lot of ways and I am thoroughly enjoying it on a daily basis coincidentally. Just depends on the program you write whether or not it consumes all your memory or not.

May 29, 2013 7:54 AM in response to nkko

@nkko - I agree - it is definitely apple's fault. My experience hasn't been as dire as yours though. The amount of swap I use is not infinitely more than I used to use. I had to quit safari in the snow leopard days as well - it's always been a problem.


I find that I hit about 2Gb of swap and stop. I used to hit about 1Mb of swap in the old Snow Leopard days, and stop.


I am not 100% sure the new memory system is completely bad if you have an SSD. It might be better, I don't know. I think Apple just does not perceive there is a problem because too many of their engineers are using SSDs. But that's just a guess.


It does remain to be seen how long an SSD lasts. My understand is that it's a pretty long time now. Only time will tell.

Jun 4, 2013 9:37 AM in response to Jonathan Payne1

To be clear, Apple deliberately made this change in 10.7. 10.6's VM and memory system was a rock star. It was fast and reliable. Kuddos where kuddos due.


Now, what isn't clear is why. Why did Apple spend a lot of effort making this change. It's a non-trivial amount of kernel work to swap out VM models, yet for some reason they thought it was the right thing to do. Why did Apple think this was an improvement?


The cynical answer is that it increases the rate at which SSD drives wear out and that keeps the same steady, 3-5 year buying cycle for new hardware. Additionally, if you were unfortunate enough to be stuck on a drive made of spinning rust, the slowdown would be unbearable and you'd be forced to upgrade sooner rather than later. Yuck (though that's what I ended up doing *grumble*).


The optimistic answer is Apple thought it would improve the day-to-day performance of users. I think we can say that was a failed experiment. Maybe they think it will improve the life of SSDs? That doesn't pass the smell test.


And the lazy answer is reduces code differences between iOS and OS-X which somehow makes it easier for developers to write apps on both platforms? I don't buy that argument for a second, but I could see a pencil nosed manager who's never done development (or is a crappy developer themself) making that argument.


Regardless, it's hard for me to imagine that swapping pages (4K chunks of memory) is less efficient than swapping entire programs or wired regions of memory. And yes, Apple IMNSHO should swap back to the VM from the 10.6 days.


And with WWDC just around the corner, hopefully it happens.... otherwise we'll have to wait for another release at least 1yr down the road. On the flip side, it's nice knowing I'm not alone in having this problem. :~] But I'd rather see it fixed than gripe about it.

Jul 1, 2013 2:13 AM in response to mightymilk

Lions consume RAM memory very badly.

Lions consume a lot more than Leopard. I tried Lion several times and every time the RAM consumption was extremely more larger than Leopard did. I have A1278 MacBook Pro (2.4 Inter Core 2 Duo, 4GB DDR3). With Lions I must continuously monitor how different apps consumes my memory. When all my memory is consumed the Mac slaw down badly. And it is very irritating especially when you know that you don't need to do it in Leopard.

The Leopard is brilliant with RAM consumption.

Eventually I deleted the Lions and installed the Leopard. I'm very disappointed with Lions.

Jul 10, 2013 7:41 AM in response to mightymilk

I work with high end Visual Effects applications which are very demanding (and am ex-systems programmer) , and having worked on many machines and versions of OSX can say WITHOUT A DOUBT that the memory management under 10.8 is APPALLING. I am running a 2012 8-core 12GB machine on which similar previous box i could previously work in the user interface and have at least 4 renders running in the background. NOW THIS IS NOT AT ALL POSSIBLE WITHOUT HAVING TO GO FOR TEA EVERY 5 minutes while the OS figures out what the **** its doing. DISGUSTING lack of attention to detail. Apparently from some of the posts above there was a conscious call to change the MM from 10.7 onwards ? *** ..


Anyways, a simple solution (which half-works but not really) :


in terminal :


while true; do purge; sleep 60; done


I seriously want to buy Apple's new machine but if there is no serious commitment for the OS quality and testing to match the quality of the hardware why should I ?


<Edited By Host>

Jul 10, 2013 7:59 AM in response to jeremyvfx

Looks like Apple has given up on fixing Lions in favor of a whole new OS, Mavericks, which I won't be able to run on my old Apple hardware. I'm holding off replacing anything Apple until they decide which way they're going as far as SSD's are concerned since the new machines are mostly not upgradeable.. I think that the optical HD is dead in today's environment, and that Apple will be forced to go to SSD's only or continue to sell machines that go slower and slower as apps get larger and sloppier.That said, with cloud computing on the horizon, this whole issue may become moot.

Jul 10, 2013 9:30 AM in response to jeremyvfx

I am hoping for some improvements in the Maverick's OS because they talk A LOT about memory compression, 50% or more speed ups, etc. It sounds on the service like they spend a bunch of time thinking about memory in this release. There is only one way to tell though.


Meanwhile, my MacBook continues to be the most awesome machine I have ever owned. I am dismayed they obsoleted the old fashioned hard drive with their changes, and I bet this machine could be even faster if they hadn't redone the memory management, but still, it's the best experience out there.

Jul 10, 2013 10:31 AM in response to Jonathan Payne1

The funny thing is I don't really care about trashy tech like memory comporession, which we've already seen on Win9x implemented by third pary devs. Compressing doesn't really matter as long as you have enough physical RAM. What I really want is good memory management on par with Linux, FreeBSD, Solaris and the most funny thing - Windows NT, right now OSX is worse than Windows XP.


Well, nothing fun really.

Jul 10, 2013 10:55 AM in response to BlackNova

The key phrase is "as long as you have enough physical memory". Defining what is enough is difficult. Paging, swapping, compression - all techniques to deal with managing the difference between what is being used in virtual memory and what physical memory is available. It's too expensive to have enough physical memory so that you never swap or page out. And unnecessary - under most circumstances these techniques work very well and have little impact on perceived performance. Memory compression is just another tool to help manage that - no better or worse technology than anything else. These techniques are especially important when using SSDs since the memory is being used for both persistant storage and execution-time storage. Even more important when the SSD is not upgradeable - and you keep adding apps and data. Then you really depend on these technologies to help keep your system functional. I reported a Mountain Lion memory leak on this thread quite a while ago - I had to reboot my system every few days to keep from running out and crashing. I've noticed the last few months that I'm not having any issues. Maybe Apple has fixed at least some of the issues if not all.....

Jul 10, 2013 11:11 AM in response to jeremyvfx

jeremyvfx wrote:


Anyways, a simple solution (which half-works but not really) :


in terminal :


while true; do purge; sleep 60; done

Sorry but that's really going to make things worse.


Doing a purge every 60 seconds will definitely cause freezes in applications as memory is purged. Overkill for sure, maybe you meant 60 minutes? In which case sleep 3600 is what you'd want to do...


Again though, bear in mind when purge occurs, memory as well as buffers are emptied, so iTunes will go silent and any app that is having it's region of memory cleared will pause while this is occuring.

Jul 11, 2013 1:22 AM in response to fiddler64

Can't agree.

Defining 'enough physical memory' is easy enough as long as you know what will you do with your system. And it is not too expensive to have enough physicial memory as long as your put your work performance as top priority. All my work systems have enough RAM for my needs.

Swapping/paging, compression, etc... are ways to make you able to operate on application work set that aren't fit into your computer's physicial RAM, but it costs you time.

The problem is OSX starts swapping even in case your all work set fit into memory available for applications and frankly I don't see how compression would solve that. It might make problem less noticable, noticable a little later.

Fast SSD would make issue less noticable as well, since you won't notice paging, but SSDs are still an order of magnitude slower than RAM.

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.