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 19, 2011 9:22 AM in response to Michelasso

Michelasso wrote:


mightymilk wrote:


I'm getting a Permission Denied when trying to do this. Do I need another command from the Terminal, I'm the only User/Admin on this computer.

Oh, all right. I still have to figure out how the file permissions really work on OS X. Type


sudo mv ~/Library ~/Desktop


You will be prompted for the administrator (your in this case) password. That will execute the command as super user. I just tested the command in my system, it worked fine. Well, I obviously restored it back immediately after since my system is working fine. 😉


It's all good, I should have know that. I've used the sudo command before, just forgot what it's purpose was!


Thanks!

Aug 19, 2011 9:33 AM in response to urabus

urabus wrote:


That's pretty cool. I have two questions:


- Is my keychain in said folder? and;


- Is it possible to put your old folder back and re-boot if you'd like your old setup back?

1. I pretty much suppose so. Not an expert in Keychain but as far as I remember it was there.


2. Yeah. First remove the new Library folder than move back the old one. It isn't guarantee to fully restore everything, some settings may go lost. But generally speaking most of your stuff should be there. I remember I did it once.

Aug 19, 2011 9:47 AM in response to mightymilk

Here's a couple of interesting points from the release notes for Firefox Aurora 8.0a that was just released.

· Optimized Memory Use: Reduces memory use and improves performance areas including responsiveness, startup and page load time, even in complex websites and Web apps

· Improved memory management: The JavaScript garbage collector works more frequently to free up memory and improve performance when you have many tabs open or keep Firefox running for a long time.


Aug 22, 2011 2:26 AM in response to mightymilk

Ok, here there is a good explanation of how the new memory management works in Cocoa:

http://arstechnica.com/apple/reviews/2011/07/mac-os-x-10-7.ars/10#cocoa-memory


Ars itself shows it as a potential memory leak and it may explain where some of the memory goes. At least in Safari that keeps growing.


The full review is very interesting but it is 19 pages long!! Still very good for references. You may check the first page, it has an idex as well.

Aug 22, 2011 2:28 AM in response to mightymilk

mightymilk wrote:


Having the backup is nice. I was able to restore my Bookmarks for Safari, by Copy over the old .plist bookmark file. If I run across anything I'm missing that I can't restore manually, at least I know there's a back up.

Out of curiosity, did you have any improvement? Not just in terms of memory, generally speaking. I am tempted to do it myself maybe it would help fixing some bugs.

Aug 22, 2011 8:35 AM in response to Michelasso

Michelasso wrote:

You achieve exactly the same result moving/deleting your Library folder. To move the Library folder is faster if you use Terminal. Just type:


mv ~/Library ~/Desktop

Note that this not the same as creating a new user account for testing purposes.


A new user account will have its own brand new home folder, so everything initially created in it will be set to the new user default settings built into the system. This includes all per user permissions & the initially almost empty default user folders for Movies, Pictures, Documents, Desktop, etc. It also creates an additional set of system level settings for the new user account (for instance, some that are viewable in System Preference > Accounts > Advanced Options).


Because of this, as Allan mentioned, creating a new user account clearly divides system level from user level problems. It only takes a couple of minutes to create the account or to log out of your normal one & into it. And of course, it does not disturb your normal account's settings in any way, & you can easily detele it once testing is done.


All this makes it a troubleshooting step frequently suggested by experienced Mac users for many kinds of problems.

Aug 22, 2011 11:02 AM in response to mightymilk

mightymilk wrote:


Having the backup is nice. I was able to restore my Bookmarks for Safari, by Copy over the old .plist bookmark file. If I run across anything I'm missing that I can't restore manually, at least I know there's a back up.

Can't say for sure, Safari Memory usage seemed to halt at about 600MB. I've wanted to clean out the User Library for a while though, there's been a ton of applications I've installed and removed over the last 2 years, and wanted any remaining trace of applications I wouldn't be returning to gone.


I honestly need to do more testing to see if there's a difference, but I haven't had the time. Either way it's something I've wanted to do for a while.

Aug 22, 2011 11:18 AM in response to R C-R

R C-R wrote:


Michelasso wrote:

You achieve exactly the same result moving/deleting your Library folder. To move the Library folder is faster if you use Terminal. Just type:


mv ~/Library ~/Desktop

Note that this not the same as creating a new user account for testing purposes.


A new user account will have its own brand new home folder, so everything initially created in it will be set to the new user default settings built into the system. This includes all per user permissions & the initially almost empty default user folders for Movies, Pictures, Documents, Desktop, etc. It also creates an additional set of system level settings for the new user account (for instance, some that are viewable in System Preference > Accounts > Advanced Options).

Could you be more specific? I assume you mean "Users & Groups". I checked and I don't see any Advanced Options. Only the Login Options. Which is correct, they are system specific, and stored in the /Library. But they have the same values in any user's System Preference. One needs to autenticate with an administrator username/password to modify them so they are not user related.


It wouldn't make any sense either that any account could set parameters at system level. Unless of a bug, sure. What I've seen is that some (bad written) programs write system files in the the /Library area, making them owned by the administrator user that installed them instead of root. I've found some even in /Library/LaunchAgents and /Library/LaunchDaemons. Still, owned by the user doesn't mean started or managed by the user. That area is for the OS and so anything on that is controlled by root, the superuser.


If anything at system level could be set by any user account we would need more copies of the same configuration file in the system area, at least one for each user. Which is nonsense and that's what the local Library folder is for. Not to mention that it would be totally against the Unix philosophy.

Aug 22, 2011 12:22 PM in response to R C-R

I've been a Mac user for only 8 years but have seen on many occasions recommendations to create a new user account for troubleshooting.


While hopefully you agree there are some performance issues in Lion compared to Leopard, I now see the difference between experience/ knowledge and rambling techno-babble. I honestly cannot believe that someone would be contributing to this thread with performance issues without first doing a "CLEAN INSTALL" of Lion. Windows or OS X - experience has shown you're usually better off starting fresh, anyway.

Aug 22, 2011 6:35 PM in response to Michelasso

Michelasso wrote:

I checked and I don't see any Advanced Options.

The advanced account options are normally hidden & include such things for the account as the User ID, the account UUID, the location of the home directory, & the like. They do not have the same values for each user. Along with the account password & login items these must be system level settings since the system uses them at startup & login times, before any user account is logged in, etc.


It wouldn't make any sense either that any account could set parameters at system level.

It would not make any sense to try to do it any other way. The system must know how to find accounts, log them in, & so on. And users must be able to change these parameters for the account(s) they own.


If anything at system level could be set by any user account we would need more copies of the same configuration file in the system area, at least one for each user.

Why? Individual system level files often store similar items related to different user accounts. When you create an account, the system updates these files & it maintains them as needed on behalf of the users of the computer.

Which is nonsense and that's what the local Library folder is for. Not to mention that it would be totally against the Unix philosophy.

No. The user account has direct access to its own home folder but the system also maintains items related to that account in system level folders users do not normally have access to -- otherwise, users could too easily mess something up that would prevent them from logging in or cause other problems. This is fully consistent with the UNIX philosophy.


Also remember that OS X is not just another UNIX variant. In fact, the OS X kernel is named "XNU," which stands for "X is not UNIX." This is intended to emphasize that behind the GUI OS X is really a combination of BSD kernel concepts, Mach executable objects, & the I/O kit unique to OS X.

Aug 23, 2011 3:19 AM in response to R C-R

R C-R wrote:


The advanced account options are normally hidden & include such things for the account as the User ID, the account UUID, the location of the home directory, & the like. They do not have the same values for each user. Along with the account password & login items these must be system level settings since the system uses them at startup & login times, before any user account is logged in, etc.


And indeed the user account databases do not belong to the users but to the OS. The fact that we are able to change "our" user account parameters like the password, the shell or other doesn't mean that we own that data. It is root that does the job for us after having us authenticated. Same thing when we login. root authenticates us and then creates a session with our UID, from where we start all our subprocesses.


But I see that later you say the same thing (sorry. I can't use this stupid forum editor efficiently). So there isn't much to argue about this. Let's go back to the original point, because I've seen that there has been some confusion:


An user, mightymilk wanted to create a new user account and then copying on it all his own data from the old account to the new one. I suggested that such a tedious job was not really necessary, because he could achieve the same result at a lower cost just removing/renaming the user Library folder.


I totally agree that for testing only one just needs to create a new account. I did it myself just enabling the guest account, which has the nice feature of being automatically removed (on request) when logging out. But if the idea is to just have a fresh account with the old data, I insist that removing the user Library folder achieves the same result saving a lot of time. And troubles.


At this level the documents (Movies, Pics, Docs, etc) do not really matter. And then they were to be copied anyway, with the risk of making things worse in terms of file permissions/ownership/modification times. And if any is corrupted it will still be corrupted after copying them.


At the system level apart from the new account definition, that anyway as we said it is owned by the OS and not by the user and so it shouldn't matter, I don't see what else could differ. Even creating a new user, all the startup agents, demons or else at system level from the old user account will run anyway. I really don't know, at user level, what a new account wouldn't not have that it is present in a old accont with the Library folder removed But sure, I am ready for suggestions if I am missing something.


Regarding the old debate XNU "X is not Unix" I am not the one claiming that OS X is an Unix system. it is Apple: http://www.apple.com/macosx/what-is/


Claims like "Built on a Rock-Solid Unix foundation" make me think that OS X is just yet another Unix OS. Dialect if you want, but still Unix. It surely feels like that after all!!

Aug 23, 2011 6:03 AM in response to Michelasso

Michelasso wrote:

An user, mightymilk wanted to create a new user account and then copying on it all his own data from the old account to the new one. I suggested that such a tedious job was not really necessary, because he could achieve the same result at a lower cost just removing/renaming the user Library folder.

I don't know if mightymilk wanted to create a new user account with all his old user data or not, but there isn't much point in doing that as a troubleshooting/diagnostic step since it would not eliminate any problematic user files. Removing/renaming the ~/Library folder would probably do that, but it would also remove all the account's user preferences, application-specific settings, & everything else normally stored in that folder. It can be quite tedious to reset/reenter all of that.


It is also not a good idea to remove/rename the folder while the account is logged in (like by using the sudo mv command) since this folder is in constant use by the logged in account & its sudden unavailability could have unexpected results or even cause new problems in some situations. If you must do this it would be better to either log into single user mode or into another admin account so it could be done while that account is not logged in.


To avoid these things, a frequently recommended more surgical approach for some kinds of troubleshooting/diagnostic procedures is to just move selected items from the folder to the Desktop, for instance the preference files related to an app that is acting strangely, any per user fonts, or specific user level application support files. This has the advantage of narrowing the suspects to just a few files; plus, users can generally move the files that seem OK back into their original locations, replacing the newly created ones & thus preserving the now known-good data they contain.


But creating a new test account is still the quickest & simplest way to determine if the problem is in the user or system domain. Trying that first, before disturbing the ~/Library folder, can save a lot of time since the problem may not have anything to do with the contents of that folder.


Regarding the UNIX/OS X debate, "Built on a Rock-Solid Unix foundation" means just what it says. Apple started with the BSD kernel & built on it, using things like the Mach object file format for executable code & its own I/O Kit to create an OS that is unique.

Aug 23, 2011 6:44 AM in response to R C-R

R C-R wrote:


Michelasso wrote:

An user, mightymilk wanted to create a new user account and then copying on it all his own data from the old account to the new one. I suggested that such a tedious job was not really necessary, because he could achieve the same result at a lower cost just removing/renaming the user Library folder.

I don't know if mightymilk wanted to create a new user account with all his old user data or not, but there isn't much point in doing that as a troubleshooting/diagnostic step since it would not eliminate any problematic user files.


Actually, if we're talking hypothetically about a User directory file(s) issue... the User Library folder is the most likely place to find problematic user files. The other folders; Pictures, Music, Movies, contain almost exclusively media files, media files which is no way affect system wide performance, as they are not core files to the functionality of the application. This is not the case, nor does it make any sense to assume that.


The only exception to this are files like the iTunes library file, or an Aperture library file. However these files could only affect performance under iTunes and Aperture, would have to be corrupt or damaged, and are in no way related to any issue being described here.

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.