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 9, 2012 11:45 AM in response to IvanOhio

Hi IvanOhio,

Thank you for taking the time to respond. I am not confusing RAM with storage/hard drive. It is indeed my RAM - whether active, inactive, wired, etc - that is being consumed and then freezing the computer up and asking me to close applications. Similar to pana_zyde, I wouldn't care if the machine hadn't been rendering itself useless so frequently right after I bought it. It broke my trust during the "should I have stayed with my Windows 7 Lenovo?" phase.


Additiionally it caused me to have to spend upwards for 24 actual hours at the Boston Apple store with teh Geniuses, 5 days without my machine, and switch machines (and reload them each) 4 times. What made me start poking around for an answer was the lack of info from the Apple technical staff and their lack of curiousity at the data that was available on the machine. For two weeks they blamed me for copying something from my PC that was hurting the Mac.


Anyway, I'm getting agitated just thinking about it. Bottom line is: I stopped running Safari and the issue is better (but not gone) and I also believe there is a problem that makes this machine not worth $3000... alas, I have it and am now committed so I talk nicely to it and hope Apple (or one of you) finds a cure.


Thanks again

Feb 9, 2012 12:19 PM in response to BlackNova

BlackNova wrote:


Yet, starting with OSX 10.6, I got to run 'purge' several times a day just to keep system responsive.

You can find complaints about poor memory management for every version of OS X, including whatever one you think was the last one to do it well. For example, this topic is about memory usage problems in Lion (OS 10.7) & many users posting here are saying they had no problems with Snow Leopard (OS 10.6). You will also find users reporting they are having no such problems with Lion, nor did they with previous OS versions.


How can this be?


You could theorize that users just aren't noticing the problems, but that's absurd -- who would not notice their Mac grinding to a halt?


You could theorize that there is an obscure OS bug that affects just some models, but that doesn't fit the facts -- we see complaints in this long topic from users using essentially every Mac model capable of running Lion, & the same is true for earlier OS versions.


So what about a OS bug that affects just some apps? Again, that doesn't fit the facts. Some users say if they avoid using Safari they don't have any issues, but others say they have problems regardless of what apps they use.


So what's left? More to the point, what's the simplest explanation for all these seeming contradictions? Isn't it that there is some problem with the affected users' systems that is not directly caused by the OS's memory management system & the issues they see with memory use are just a byproduct of that?


Some of the reported problems are not problems at all. Some users are just misinterpreting what Activity Monitor tells them or what the various memory statistics mean, but even if we exclude them, there are users quite obviously having real problems.


But what isn't at all obvious is if all these problems have the same underlying cause, or if it is an inherent flaw in one or another version of the OS.


If you are interested in finding a practical solution for your problem, you do yourself no favors by assuming a cause that doesn't fit all the facts, not just for your own system but for all like it.

Feb 9, 2012 12:20 PM in response to Mac_Boston

Well, I think there is one thing almost all OSX 10.6+ users might want to do in to make pressure on memory manager lower is to go to /Applications folder and using CMD+I put applications which consume large amounts of memory into 32-bit mode. Applications memory consumption won't go two times down, but additional free 200-300mb left by Safari or Firefox could be helpfull anyway.

Feb 9, 2012 12:28 PM in response to R C-R

I din't have such a problem back on OSX 10.4 Tiger. I skipped 10.5 so can't have a word on it.


My understanding is that majority of OSX users will never get these issues as long as they stay with Browser/Email/Skype/Some Player usage pattern.

On the other hand if you put your system under stress by running large amount of different applications, i.e. pattern which do not really benefit from caching scheme used by OSX.


And there is even applications like XCode's InterfaceBuilder (integrated in 4.x series) which just plainly leaks when you try to resize large widgets.

Second monitor could worsen things as well.

Feb 9, 2012 12:49 PM in response to BlackNova

BlackNova wrote:


My understanding is that majority of OSX users will never get these issues as long as they stay with Browser/Email/Skype/Some Player usage pattern.

Where did you get that idea? Did you somehow miss all the posts in this discussion that report problems when running nothing more than a browser & an email app?


On the other hand if you put your system under stress by running large amount of different applications, i.e. pattern which do not really benefit from caching scheme used by OSX.

What makes you think that running many different apps at the same time doesn't benefit from OS X's memory management system (including both real & virtual memory)? VM is essential for running a combination of apps whose total memory requirements exceed the real memory (RAM) installed on the machine. Without that, you would have to quit applications constantly to free up RAM for another app's use. Likewise, if the OS constantly purged inactive memory, the system would perform poorly because much of the data & code it holds would just have to be fetched again from the drive when it was needed by one or another process.


If you have to purge memory (a process intended for troubleshooting apps with memory use problems, which is why it is part of the developer tools & not the standard installation) you obviously have a problem. But there are multiple causes for that kind of problem. What makes you think that the cause has to be the memory management scheme of Lion (or Snow Leopard or whatever)?

Feb 9, 2012 1:11 PM in response to IvanOhio

IvanOhio wrote:


javatoid wrote:


My old 2005 iMac (2.0 GHz single-core G5 processor, 1.5 GB of RAM, less than 1 GB free disk space, Leopard OS) died last fall.


I replaced it with a new 2011 iMac (2.7 GHz quad-core i5 processor, 4 GB of RAM, 750 GB free disk space, Lion OS).


Naturally, I expected some performance boost, but the only thing this new iMac does with any proficiency is spin the beachball. In many respects, it seems slower than the old machine.


As I write this, I have only about 33 MB of RAM free and nearly 17 GB of swap used. (I've seen swap much higher, over 50 GB.) The primary offenders are Safari Web Content, Safari, and Flash (Safari plug in) consuming about 1.5 GB. I am not running any high-resource applicaitons (no audio/video editing, for example).


I don't know whether Safari has a memory leak, or Lion simply can't manage memory. I do know that I need to reboot this iMac frequently just to keep it running.


I miss the old Apples. The ones that worked.

How many programs do you have open?


Also, I can not believe that you only have 33 MB? of RAM free out of 4GB. You are misreading the information.


Programs open:

  • Finder
  • Mail
  • Safari (5.1.2)
  • iTunes (10.5.3)
  • Activity Monitor


This is running Lion 10.7.2.


The 33 MB is what Activity Monitor reports as "Free" under System Memory. (I rounded to 33. The number displayed was about 32.7 MB.) If I'm misreading this, what should I be looking at instead?


Note: I have since rebooted to reclaim memory, so I now have about 1.2 GB free (with no swapping). However, even with no other apps open, the free space will dwindle to nothing, and swapping will start ramping up again.


Message was edited by: javatoid to include Safari version number

Feb 9, 2012 1:09 PM in response to nkko

nkko wrote:


You are right. Problem is simple:


Memory manager don't do what it have to do: no release memory from inactive memory block when the free memory block is exhausted. Then unwanted swap function start to work.


Why the great debate and theorizing. If the memory manager will perform his duties, this issue would not exist.

Uh, I disagree that the built in memory management is not working correctly. It is the User.


What I mean is people are trying to outthink the OS and how it uses the memory management.



Free memory

This is RAM that's not being used.

Wired memory

Information in this memory can't be moved to the hard disk, so it must stay in RAM. The amount of Wired memory depends on the applications you are using.

Active memory

This information is currently in memory, and has been recently used.

Inactive memory

This information in memory is not actively being used, but was recently used. < how hard is it understand this? Your system will use what is needed. Does not mean it will use all of your physical memory. See Active Memory.

For example, if you've been using Mail and then quit it, the RAM that Mail was using is marked as Inactive memory. This Inactive memory is available for use by another application, just like Free memory. However, if you open Mail before its Inactive memory is used by a different application, Mail will open quicker because its Inactive memory is converted to Active memory, instead of loading Mail from the slower hard disk.

Used

This is the total amount of memory used.

VM size

This is the total amount of Virtual Memory for all processes on your Mac.

Page ins / Page outs

This refers to the amount of information moved between RAM and the hard disk. This number is a cumulative amount of data that Mac OS X has moved between RAM and disk space.

Tip: Page outs occur when your Mac has to write information from RAM to the hard drive (because RAM is full). Adding more RAM may reduce page outs.

Swap used

This is the amount of information copied to the swap file on your hard drive.


from:http://support.apple.com/kb/HT1342

I have been using a 64 bit OS for the past three years and never come across this much confusion about the use of memory, aka RAM and how the Virtual Address System works.


Feb 9, 2012 1:10 PM in response to R C-R

Where did you get that idea? Did you somehow miss all the posts in this discussion that report problems when running nothing more than a browser & an email app?

No matter how I look at this users participating in ALL similar discussions is just a little part of OSX user base. Overwise even Apple would have been forced to look into the issues.

What makes you think that running many different apps at the same time doesn't benefit from OS X's memory management system (including both real & virtual memory)?

My guess is based on the way cache is working - less differrent apps more cache/memory for each of them. This have nothing to do with VM since you're still limited by amount of physical ram if you go over it you hit the swap.


If you have to purge memory (a process intended for troubleshooting apps with memory use problems, which is why it is part of the developer tools & not the standard installation) you obviously have a problem.

Well, according to Apple's man page purge - is application which forced disk cache to be flushed, and is used to approximate initial boot conditions, nothing as fancy as memory use diagnostic.


About if this is my problem... yeah it mine since I have to deal without, but is it caused by buggy application?

I had roughtly the same set of applications running on Linux, Solaris and Windows 7 (prior it was XP and Vista), just java based IDE, application server, DB, and browser with fifty or so tabs open. And the only system which had issues have been osx.

Feb 9, 2012 1:43 PM in response to IvanOhio

Hi all,


Can I request that every one try to be a little nicer in their replies? You might just be using short hand but some of these replies are coming across a accusatory and intended to make the other person feel dumb. They are uncomfortable to read.


I'm not a user group expert but seems like everyone is participating in order to get help or be helpful. Right? Right?


Thank you in advance. And I do appreciate all the help.

Feb 9, 2012 1:47 PM in response to IvanOhio

Hi IvanOhio,

In response to your response to Javatoid:


Here is a snapshot from the fall when I was having the problem in case it helps the conversation. It shows the applications the request from the OS to shut down applications because it is out of space (as in I couldn't work,) it shows the application I had open on the right and 116 MB left of RAM as "free" noted at the bottom. This is a shot of the Inactive Memory processes because I took it for the Apple Geniuses who were using this to diagnose the problem they deemed significant.


User uploaded file

Feb 9, 2012 2:21 PM in response to BlackNova

BlackNova wrote:


No matter how I look at this users participating in ALL similar discussions is just a little part of OSX user base.

True, but that doesn't justify ignoring that part just because it doesn't fit with your guesses.

My guess is based on the way cache is working - less differrent apps more cache/memory for each of them. This have nothing to do with VM since you're still limited by amount of physical ram if you go over it you hit the swap.

VM cache files are not quite the same as other types of cache files. For one thing, they are segmented into many different small areas, each of which can be swapped out with physical memory without rewriting the entire file. There is always at least one VM file & it will never be completely empty, even if you never run anything that uses up all of the installed RAM. You can't really consider RAM use separate & apart from VM use -- for example private memory may have both real & virtual parts.


If you want to understand how VM, active & inactive RAM, & so on really works, you should study this Apple developer document. It has been mentioned several times in this discussion.


About if this is my problem... yeah it mine since I have to deal without, but is it caused by buggy application?

That's one possibility. It might also be caused by incompatible or poorly written third party add-ons to the OS, by system file corruption, or other things. It is impossible to say what's causing your problems without a detailed analysis of everything on your system, any peripherals attached to it besides Apple-branded ones, the health of the file system, & so on. Just guessing it is any one of the possibilities is no better than picking one out of a hat.

Feb 9, 2012 3:09 PM in response to Mac_Boston

Mac_Boston wrote:


Can I request that every one try to be a little nicer in their replies? You might just be using short hand but some of these replies are coming across a accusatory and intended to make the other person feel dumb.

It isn't about being dumb. Memory management in OS X (or any other similar modern OS) is an extremely complex subject that even highly skilled programmers often struggle to understand very well.


Activity Monitor is the only app I know of in which a help topic links to a developer document instead of a regular Knowledge Base article for those looking for more info about one of its features. It's very easy to confuse the terms AM's help doesn't define with those it does & very difficult to understand all the info in the developer docs that explain it all. It's quite a challenge just to use the technical terms correctly in these discussions, which sometimes makes it hard to follow what is being discussed & leads to confusion.


Unfortunately, this is one of those things that just can't be simplified very much if the goal is to identify problems & their causes. It would be great if it could but that is impossible. It doesn't help anybody just to ignore things that have been explained over & over to the best of several different users' abilities or to misrepresent what they say. All that does is to convince them that there is no point in contributing anything else & to move on to other topics.

Feb 9, 2012 3:39 PM in response to mightymilk

Yes buying more RAM doesn't really help, it just fills as much as it can.


Now, before all the smarty pants start chiming in and saying:

"OS X gives back inactive memory, don't worry be happy"

"it's a feature not a bug"

"Set your Activity monitor to update ever .5 seconds"

"You are wrong for paying attention to this"

etc...

Just listen.


I have 16GB RAM (up from 8GB), today I got down to 13MB free, 8.8GB Inactive

I quit every open app: 1.62GB free, 8.84GB inactive

OK inactive is still 8.84 but that's because it's just wainting to give it back - right?!

So to see if it really gives back or pages out:

I take a 2560x1440 screen shot of imac and blow it up 1000%

Preview become unresponsive, I tried that a couple times. Same thing.

Giving up on Preview (it's buggy). I open Photoshop and resize the screen shot to ridiculous sizes.

Now (around 14 secs in video) the inactive starts going down, free oscillates, active grows, and Page Outs stays the same (not swapping to disk) BUT the operation was SLOW. Very SLOW.


I ended up cancelling the Resize operation and running purge (from XCode tools) to reclaim all the inactive back to Free. When I reran the very same resize operation it was FAST.


What seems to be happening is a very piecemeal approach to returning inactive memory. It only gives back a little at a time.

You might say it's Adobe Photoshop memory allocation code, but I think it's up to the OS to determine this (someone who really knows correct me if I'm wrong).


Regardless, running purge and retrying the same operation had a vast speedup, it completed in seconds as opposed to the minutes I waited for an abortive try. I can tell when my machine hits the Free wall and starts begging for Inactive scraps. This seems to cause the slow down. The very cautious giving back of memory seems to be a slow back and forth...


Watch the amazing 26 seconds and see what you think:

http://youtu.be/EB-kdZtGAgM

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.