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

Aug 20, 2012 2:53 PM in response to mightymilk

During my Lion experience I was running out of memory (4GB) on my MBPro (early 2011).


I had installed 16GB and I was still reaching the limits of the memory used.


Since upgrading to ML 10.8 I am in a stable under 6GB memory usage leaving some 10GB for extra programs except Safari , Calendar and Mail and some Preview documents / books I read.


I am happier with ML 10.8


This is my experience and I wanted to share it

Aug 20, 2012 3:58 PM in response to Amfipolis

I thought I'd report on my issue since it's been solved. Now don't get excited, I found two apps that were causing my grief.


I made sure, as best I could, that nothing extra was loaded at login or bootup. I started Activity Monitor so I could watch. This was under Mountain Lion. I then proceeded to do almost everything that I normally do for 24 hours. Part way through, I reloaded TotalFinder, but that was it. After 24 hours I had not seen a trace of a problem, so I started reloading things slowly.


When I got to Sophos, it went nuts. The problem was the on access scan when doing a multi-file copy. The process just took off, ate all free memory and most of the CPU. I killed Sophos and re-ran just to check and everything was fine. One could argue that if it was only the file copy, that was to be expected. Problem is that once it ran away, it stayed away, eating up CPU even thought the copy was done. I've since replaced Sophos with avast! and have had no problems. However, the same multi-file copy will have an impact whenever an on-access scanner is used. I also left Sophos a message explaining what had happened.


At this point I figured that I had found the problem and was good to go. I started reloading what I originally had. When I got to an app called DirectorySync, I again found a runaway process as it was trying to sync two folders. I removed that, sent the developer a message, and continued to reload everything else.


I have been watching with Activity Monitor for well over a week and have not had a problem. Free and inactive memory are acting as they should. Sometimes I have vewry little free memory, but that doesn't stop things from working reasonably fast. I see very few pinwheels/beachballs. Only when I'm really pushing things and have lots of windows open. I can't say that Mountain Lion is faster than Lion because it's been so long since I had a responsive system. Regardless, I'm happy and there are a few nicities that mountain Lion gives me so I'm happy about the $20 upgrade.


That's my story. As always, your mileage may vary.

Aug 21, 2012 12:51 AM in response to bobbd

To @bobbd:


Do you or did you or have you used Time Machine backups?


The reason I ask is that I have always thought that the main issue with Lion and ML that we have been experiencing as related to file system use. As the file system is traversed the file cache is loaded and it aggressively causes app memory to get swapped out.


Your two apps both seem to traverse the file system. Assuming Sophos is an anti-virus app (talk about waste of resources) and DirectorySync is something that keeps two directory hierarchies in sync with each other, both those applications fit the category of walking the file system.


As does Time Machine.


When I first switched to Lion it was my backups that were the first indication that something was wrong. Instead of taking 1 minute (over the network to my other Mac with a disk attached) like it had been doing for years, it suddenly was talking 10 minutes or 20 minutes.


So - do you use Time Machine? And if so, is it to a Time Capsule or do a local USB hard drive?

Aug 21, 2012 4:36 AM in response to Michelasso

Michelasso wrote:


nkko wrote:


No reaction to the mountain lion. It seems that the memory problems are solved. Who was it who claimed that the uncontrolled growth of inactive memory is normal?

Ah don't worry. He would invent yet another theory. What drives me mad is that I am stuck with Lion since my MacBook isn't supported by ML.

There's no doubt our friend that shall not be named, would still be telling everyone that continous growth of Inactive memory until it bursts is completely normal under OS X. That's because there are two types of people on the Apple Support forums, those who are here to genuinely help others diagnose issues and those who's sole existance is to try and discredit any complaints about Apple and it's products. Thankfully, Apple heard us and seems to have implemented a lot of changes in both Memory and overall Performance with Mountain Lion. It's a huge step in the right direction for OS X. I'm sorry to hear you can't use Mountain Lion, it might be time to step up to a Retina MacBook Pro 😉

Aug 21, 2012 4:46 AM in response to Jonathan Payne1

I did use Time Machine wirelessley to a Time Capsule. But I haven't used it in at least a year and a half, certainly well before Lion. I found that it had a tendency to slow my machine (mid-2009 MacBook Pro 13" 8GB) to a crawl at times. Also, actually using Time Machine to get at the backups was excrutiatingly slow. My wife, on the other hand, on the same OS (can't remember whether it was Leopard or Snow Leopard) was fine.


So whatever the problem was with the file system, was probably affecting me back then as well.


One thing I did notice last weekend. I created a clone using a sparsebundle and was then copying it to a portable drive (my off-site backup solution) and the time estimate was 7 hours. Another machine's backup of a similar size was a sparseimage and the estimate had been 3 hours. I disabled avast! on-access scanning and the estimate dropped to 3 hours. However, the on-access scan was only affecting the file copy and not dragging down the whole machine.


As for whether running avast! is a waste of resources or not depends on one's situation. I have a lot of friends with Windows machines plus my work laptop is Windows. I need to ensure that I don't spread anything. As for whether it's worthwhile for Mac specific issues, I know that the chance of infection is very rare at the moment, but unless avast! has a noticeable impact on performance, file copies notwithstanding, I prefer to keep it going. It seems to take very little CPU or memory most of the time. Plus it's easy enough to turn off in those situations when it significantly increases file access times.

Aug 24, 2012 9:26 AM in response to mightymilk

Ok, I had to see it with my own beautiful eyes...


Mountain Lion, Safari 12 tabs, Mail, System Preference, Terminal, my typical configuration during this thread:


User uploaded file


This with a 3GB Intel GMA 950 unsupported MacBook2,1 late 2006. Yes, it IS possible thanks to old 64 bits GMA 950 kexts (no QE/CI support, though) and a hacked boot.efi. It feels actually much faster than Lion apart from Launchpad that gets stuck, the broken thumbnails in MC and other little things. HTML5 HD videos do NOT stutter though! They do in Lion. Thanks Apple for letting us down:


User uploaded file


NOW! Where is the smartard that made me wasting months trying to make him understanding that something is deeply wrong in the OS X Lion Memory Management System?? With the same configuration in Lion 10.7.0 I already had 3GB of swap space used!!

Sep 5, 2012 1:00 PM in response to Bobdc6

I am noticing above average CPU usage and excessive heat whenever I scroll on any webpage (Safari or Firefox - flash is disabled) and in MS Word docs also. I would really like to keep my 2007 15 inch MBP running efficiently as a desktop replacement using the MS Office suite and a web browser (preferably Safari or Firefox) and Mail. I've cleaned out everything, so have a bunch of free HD space and a clean instal of Snow Leopard followed by an install of LIon on top of SL.


But this problem with scrolling in programs is really maxing out the CPU and causing the computer to be hotter than ever before.


Any solutions? I'm really interested in making this 2007 MBP as simple, secure and functional as possible - I like the connectivity Lion provides to my newer Apple devices, but surely there must be a way to make this OS and this stupid scrolling issue less demanding on the CPU? RAM appears to be fine.

Sep 6, 2012 6:51 AM in response to Westdene

Off Topic...

Westdene wrote:


But this problem with scrolling in programs is really maxing out the CPU and causing the computer to be hotter than ever before.


Any solutions? I'm really interested in making this 2007 MBP as simple, secure and functional as possible - I like the connectivity Lion provides to my newer Apple devices, but surely there must be a way to make this OS and this stupid scrolling issue less demanding on the CPU? RAM appears to be fine.

RAM is fine? Then this isn't really the thread you should be posting to eh? 😕 Here's a question though, answer it silently to yourself: when you scroll are you using a scroll wheel or gestures OR are you grabbing the scroll bar on the side and dragging? WAY back in 10.2/10.3 days I remember that "mouse-down" click events caused lots of CPU gobbling... so that's an idea.


Possible Culprit?

NOW - for something on topic. While copying about 3TB of data from one computer to another I noticed the Inactive getting gobbled up by the second to the point of exhausting all Free RAM. The copy was not via Finder but rather from the command line: cp -Rfp (copy recursively, force overwrites, preserve attributes) I tried to recreate with /System and other directories that every else has but couldn't seemed to have to do with the content and actual names of the folders. Seems that folders with parentheses and colons containing PDFs where causing large amounts of Inactive memory to be created, the colons were not surprising that they could cause issues, since colons are allowed in Unix file names but are not in MacOs so they are translate to backslash in the Finder. As for the PDFs, these were Apple hardware take apart PDFs so unfortunately I can't just post this test folder up.


What was I found though is if I turned off Spotlight the memory usage issue went away when I performed a copy at the command line! Anyone want to give this a try and report your findings? It seems this could be related to Spotlight indexing not returning memory to Free?


To turn OFF Sportlight in the Terminal:

sudo mdutil -i off /


To turn ON Sportlight in the Terminal:

sudo mdutil -i on /

Sep 6, 2012 7:04 AM in response to Joel Bruner1

Yes. But it's not spotlight per se, it's the file system. Creating a boatload of files causes those files to be read by spotlight, especially if they are PDFs or text in general, because the contents of PDFs are indexed word by word.


I have a mac mini, powerful as all getout, which is mostly idle and used as a place to store photos and music, and my children use it from time to time. It's ALSO used for Time Machine backups over the network from two other computers in the house.

If I go use that computer, which has 4Gb of RAM, a computer running almost no applications, and look at the memory usage, I often see that inactive memory is 2Gb (can you imagine!?!?) and that it has swapped, and that there is no free memory. This is a computer that has just mostly been used as a file server.


The thing is, This state of the art mac mini is slower than my original mac mini in all sorts of simple tasks, such as LAUNCHING AN APP! How is it possible that I come to launch Chrome and this idle, unused mac, bounces the dock item 15 times just because it is used as a file server for the occasional Time Machine backup?


It is possible that Spotlight is really messing things up though. Maybe spotlight USED to tell the file system not to cache the files it was reading, since they are not likely to be read a second time. All files read and written by user facing apps would definitely want their files to be in the file system cache, but something like spotlight should advise the system that it is reading each file JUST ONCE and so it should be flushed from the cache the moment it is read, so that spotlight doesn't cause useful files to be flushed.


But there's no point in discussing this any more. This is all guess work about a problem that Apple has not even acknowleged since it first appeared Lion over a year ago. And truth be told, it does not even materialize if you have a computer with an SSD in it.


I am disgusted and disappointed.

Sep 12, 2012 10:29 PM in response to mightymilk

Here's a new thing, I'd like to share with you.


On the last days my Free RAM started to vanish in a couple of minutes after restarting the system.

And the strangest thing is, when I open the Activity Monitor, the somatory of the Ram used by te apps doesn`t match AT ALL the total used in ACTIVE RAM. What does that mean?


In the figure below, all my apps opened doesn`t reach 1,5Gb total... although the active memory is about 4.5 Gb...


Anyone can help me solving this mistery?


Thaks in advance.


My system is MacBookPro i7 2011, 8Gb Ram, Lion

my User uploaded file

Sep 13, 2012 4:29 AM in response to OsvaldoFerraz

This is similar to my story. It is likely a runaway process that does something causing memory to be grabbed and not released and yet not associated directly with the app. I know it happens because it happened to me.


Have you added anything new in the past few days? Something that runs in the background perhaps? That would be the first thing to check.


If not, do what I did. Turn off all of your login items. Basically remove them from the login items list in Users & Groups. Now restart and see what happens. If you still have the problem, look at any added Preference Panes. Now start adding things back on one by one and observing. I prefer this method to removing one by one because it's possible that there is more than one problem app.


In my case, I found one of the Sophos processes was running away. And as I found that, I also found that DirectorySync was doing the same. What is interesting is that this was my situation but others don't have problems with those apps. I don't know if this is tied into OS X memory management issues or not. What I do know is that I rarely have memory problems any more. Every now and then (like maybe once a week or two) things bog down but freeing memory seems to resolve it.


Good luck


Bob

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.