Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Understanding Memory Usage

Understanding Memory Usage
Thread Tools
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Feb 24, 2003, 11:47 AM
 
I have an iMac 17" with 256MB RAM and 800MHZ G4. I work it pretty hard with many running apps and open windows. I'm thinking about upgrading the RAM to its max which is 1 GB. Before doing that, I would like to understand OSX's memory usage a little better. That way I can set my expectations correctly.

I have iPulse (a CPU & memory monitoring application) and it seems that I never use my full available RAM. I peaked at around 75% and then hard drive page swapping increases -and yes the beach ball then starts spinning like there's no tomorrow. The CPU is sometimes floored at 100% but not all the time. Most beach ball marathons are due to excessive paging. But why? RAM is not yet depleted?

Is the OS reserving that extra 25% for it's own selfish use and will never let me use it? Or is it just really stingy after that certain point and prefers to page from the HD?


     
Junior Member
Join Date: Nov 2003
Location: Bermuda
Status: Offline
Reply With Quote
Feb 6, 2004, 07:41 AM
 
Bump since I was just about to ask the exact same question.

I have a new 15" alum Powerbook with 512MB RAM. I use MenuMeters to monitor network activity, RAM, and CPU. The RAM never seems to get more than 75% full before the paging is just obscene - and once it hits that level, my laptop is essentially useless until I force quit things that are open (nearly always Safari - no better after the latest 1.2 update).

I (perhaps foolishly or naively) thought that if it came with 512MB that it would surely be enough to have Mail, Safari (6 sites at once in tabs), iChat, and a Terminal session open. Occasionally I will open up Excel to get some account information and then close it, and in the evenings I have iTunes open and use it and then close it during the day at work. I use Photoshop about once a week for about 2 hours max.

If my laptop has more than a day of uptime now, it starts to page excessively - like I said, most noticeably in Safari. At first I thought it was a CPU issue, but after much questioning and tracking - it is a HD paging issue.

Am I foolish in thinking that the 512MB that would have been fine on my XP laptop for the usage I am at is not enough on the Mac? That is fine, I just don't want to upgrade to 1GB of RAM (the most that I can do on this laptop) and then find out it was some other issue and it remains even with 1GB of RAM.

Hopefully this will get some response greater than the original post that this is bumping
     
Senior User
Join Date: Oct 2000
Location: Midwest
Status: Offline
Reply With Quote
Feb 6, 2004, 10:04 AM
 
Wired memory is used by the operating system and is not paged in/out. Active memory is the part of your installed RAM that is used by your most recently accessed apps or data. Inactive memory is where processes that have not been used for a certain period of time are stored. The kernel and the OS continuously monitor usage and move processes to and from active/inactive memory frequently.

Processes requests memory allocation and the OS divides that demand between real (installed) and virtual memory. You can see this in Activity Monitor. As active memory demands increase there is a point where inactive memory is paged out or written to disk. Again the kernel and the OS determine by time what is to be paged out or swapped out.

If you have apps open that have make frequent hits on the cpu, this keeps a large portion of their memory demand in active memory. Again Activity Monitor presents this info. Try turning off shareware apps for a day and see what happens to your HD paging. Lots of them have memory leaks which constantly add memory demand to the OS. You can use the leaks command in the Terminal to see this. $: leaks appname. I don't know if leaked memory shows up in utilities that show memory usage. I don't think so.

When your computer boots it pages in needed data from the hard drive. I have noticed that large downloads increase page outs.

Close pages in your browser that have javascripts running and notice the change in your cpu usage.

The memory management algorithm is complicated and waaaaaaay beyond a quick note here. It works and it works amazingly well. Having 25% of your installed RAM as free memory is not obscene, it is a part of a skillfully designed memory management scheme.

Here is a page worth reading a few times. It is fascinating stuff. Seeing your interest in this, I believe you will find you have invested your time well.

HTH
Craig
     
Dedicated MacNNer
Join Date: Dec 2001
Location: Promised Land
Status: Offline
Reply With Quote
Feb 6, 2004, 11:52 AM
 
The kernel will always try to keep at least 10% of memory free for it's own use. If the kernel falis to get memory, then you will have much bigger problems than a slow system (ie a panic). So to avoid this OOM situation, the kernel starts paging userland processes before physical memory is exhausted.

HTH.

BTW, I consider 512MB as a minimum, and 768MB will give you some extra headroom.
G5 2.5 DP/2GB RAM/NVidia 6800 Ultra
PowerBook Al 1Ghz/768MB RAM
6gb Blue iPod Mini
     
Junior Member
Join Date: Nov 2003
Location: Bermuda
Status: Offline
Reply With Quote
Feb 6, 2004, 01:20 PM
 
Great info guys, thanks!

I had no idea about the "leaks" command - that is cool. Although when I tried to run it, the system paged so hard that I had to force quit out of Safari for the second time today.

I don't really run any shareware programs other than briefly (Xjournal to post up to a LiveJournal, and occasionally Poisoned). I have MenuMeters running, but that is just a recent thing and I had this problem since day one of buying this computer (well, day 2 or so since it needed some uptime to generate issues).

Frustrating that I only have the minimum and that it takes so much to do fairly minimal tasks - but if that is the case, I will get the 1GB of RAM from Crucial this weekend.

I will read up on that link, thanks!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:30 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2