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 > macOS > Memory Usage in OS X

Memory Usage in OS X
Thread Tools
OSXFreak
Junior Member
Join Date: Feb 2003
Location: Good old Blighty (UK)
Status: Offline
Reply With Quote
Apr 23, 2003, 04:53 PM
 
I recently switched to a 17"Pb with 512Mb RAM (OS X.2.5). Please can someone explain why my RAM progressively dwindles (according to TOP) until I apparently have very little physical RAM left? Does OSX suffer from serious memory leaks? I mainly use the iLife suite and Photoshop 7.0. Is there anyway to get some of that RAM back without continually restarting?
I merely like XP; I'm having a passionate love affair with OS X
     
OSXFreak  (op)
Junior Member
Join Date: Feb 2003
Location: Good old Blighty (UK)
Status: Offline
Reply With Quote
Apr 23, 2003, 05:56 PM
 
Does anyone else experience this?
I merely like XP; I'm having a passionate love affair with OS X
     
Toyin
Mac Elite
Join Date: Nov 2000
Location: Boston
Status: Offline
Reply With Quote
Apr 23, 2003, 06:13 PM
 
There are numerous topics on memory usage in OSX. I'd do a basic search and see what you come up with. My limited understanding of ram is as follows.
There are 3 types of Ram. Active, Wired, and inactive.
-Wired is constant and is what the system uses.
-Active ram is what you're currently using.
-Inactive ram is usually from programs that you've quit or haven't used in a while. This makes switching and relaunching apps faster.

If another program needs ram, it will take ram from the inactive ram 1st. If the inactive ram is being used by another app that is running, it's memory will be 'paged out' to the hard drive.

So to answer your question. I'll often see my Inactive Ram used to the max (1.5gb). If I see the active ram creeping up then I search for a memory leak.
-Toyin
13" MBA 1.8ghz i7
"It's all about the rims that ya got, and the rims that ya coulda had"
S.T. 1995
     
WombatPredator
Junior Member
Join Date: Apr 2002
Location: In spaaaaace
Status: Offline
Reply With Quote
Apr 23, 2003, 06:16 PM
 
Toyin is pretty much bang on.

In modern operating systems, it is a Good Thing to use up all the RAM you have. The OS is smart enough to juggle it as it is needed.

Think of if as a much better use of your RAM investment, if you will.
     
ism
Grizzled Veteran
Join Date: Sep 2001
Status: Offline
Reply With Quote
Apr 23, 2003, 06:19 PM
 
It must be due to some application. I find memory usage very good in OSX, I can get back inactive memory easily by quiting applications.

Any way no need to restart. At the most log-out, quiting applications should do it. Use something like Memory Monitor to get more of an idea with what's going on. Or memory usage getter
     
sambeau
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status: Offline
Reply With Quote
Apr 23, 2003, 07:00 PM
 
You do not need to get back inactive RAM. The OS does this for you. If an application isn't doing anything it won't use any ram - inactive RAM is usually kept on your hard disk.

If an inactive application is using lots of cpu then you have a problem with it and it is probably worth quitting it. My HP scanner software springs to mind..

My advice is stay away from top unless your machine starts to crawl for no reason! It'll only make you worry about stuff you don't need to worry about.
     
Toyin
Mac Elite
Join Date: Nov 2000
Location: Boston
Status: Offline
Reply With Quote
Apr 23, 2003, 07:08 PM
 
Better yet, get Menumeters. It's freeware that lets you monitor a number of things on your menubar. I've currently got my network, Ram, Hardrive, and CPU activity on the menubar. I used to find the CPU monitor extremely helpful. I'd suddenly notice that both processors were pinned. It usually turned out to be Internet Explorer or Chimera and some rare occasions another process that had gotten out of control.
-Toyin
13" MBA 1.8ghz i7
"It's all about the rims that ya got, and the rims that ya coulda had"
S.T. 1995
     
OSXFreak  (op)
Junior Member
Join Date: Feb 2003
Location: Good old Blighty (UK)
Status: Offline
Reply With Quote
Apr 24, 2003, 01:47 AM
 
Thanks very much for all of your answers. I actually did a test last night loading as many apps as I possibly could, then quitting them all, and I actually ended up with more free memory (according to TOP) after the exercise than before. Seems I'm looking at this far too simplistically.
I merely like XP; I'm having a passionate love affair with OS X
     
sambeau
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status: Offline
Reply With Quote
Apr 24, 2003, 08:33 AM
 
Originally posted by OSXFreak:
I actually did a test last night loading as many apps as I possibly could, then quitting them all, and I actually ended up with more free memory (according to TOP) after the exercise than before. Seems I'm looking at this far too simplistically.
You will do straight away as the memory has been cleared out. It will soon fill up again as more stuff is cached just-in-case.

Think of it like this:

You take four books off the shelf and open them at a recipe. Your table is now pretty full and you want to start cooking so you photocopy the four recipes you need and staple them together. Now you don't need the books, but rather than putting them back on the shelf you stack them up at the back in case you need them.

Your table looks pretty full at the moment..

You do your cooking and decide to do some DIY instead. You clear the table and put the books back on the shelf and the photocopies go in the bin..

Now before get out your DIY books, the table looks pretty empty.

However, what if you want to do cooking and DIY on the same table at the same time?

OSX handles the careful swapping of books and tools so that when you you switch from cooking to DIY your table has everything you need (including space to work) and when you switch back to cooking - everything is back how it was.

Who cares how this is acheived as long as when you reach for a spatula you don't get a buzz saw and when youn need to roll out some pastry, enough table has been cleared and cleaned.

Stop reading the top memory usage. It only tells you how much table is being used at that instance - not how efficiently your table is being managed.

If you want to worry about this kind of thing - learn about pageouts as this tells you whether or not you need to buy a bigger table.

     
Love Calm Quiet
Mac Elite
Join Date: Mar 2001
Location: CO
Status: Offline
Reply With Quote
Apr 24, 2003, 01:18 PM
 
I find, from watching Memory Monitor that for SOME apps, quitting frees up memory. Safari, for example, which (as more sites have been visited) starts building up quite a memory claim; closing all Safari windows does not free up the memory, but quitting does.
On the other hand Explorer... quitting only frees up SOME of the memory it claims. I have to use MacJanitor to get the rest back (though some of it can be reclaimed even without quitting IE).
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Apr 25, 2003, 12:39 AM
 
sambeau:

What are you cooking dude?
     
DeathMan
Mac Elite
Join Date: Aug 2001
Location: Capitol City
Status: Offline
Reply With Quote
Apr 25, 2003, 02:11 AM
 
It seems like people are still wanting to have free memory. It is pointless to have free memory. get a monitor or something that will watch page-outs. If you start paging out like crazy, then you'll know you have some memory problems somewhere. If you aren't getting that, don't even worry about how much memory is being used at a given time. OSX loves memory, as people say, but its also fairly skilled at managing its memory.
     
sambeau
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status: Offline
Reply With Quote
Apr 25, 2003, 06:04 AM
 
Originally posted by Love Calm Quiet:
I find, from watching Memory Monitor that for SOME apps, quitting frees up memory. Safari, for example, which (as more sites have been visited) starts building up quite a memory claim; closing all Safari windows does not free up the memory, but quitting does.


Closing the window has nothing to do with it, really. If OSX needs an inactive apps memory it will take it *WHEN IT NEEDS IT*. Closing a window may free the window's graphical memory - but strictly speaking it doesn't have to at that point.

Most of the memory used by safari will not be effected by closing a window - all sorts of caching will be going on - no doubt within Safari as well as OSX. If memory doesn't have to be moved/freed etc why bother until another app or needs some of it. Why work if you don't have to?

STOP READING TOP!!!

     
sambeau
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status: Offline
Reply With Quote
Apr 25, 2003, 06:38 AM
 
Originally posted by besson3c:
sambeau:

What are you cooking dude?
Spaghetti & Meatballs with lots of fresh basil.

Oh, and I'm building an ark on the same table.

     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Apr 25, 2003, 09:32 AM
 
I agree with Sambeau completely...

Top is basically meaningless... the same goes for CPU usage as far as I understand - CPU cycles will be used when available. Don't worry if an app is temporarily taking up 70% of your CPU!

The only exception to this seems to be Photoshop. It will eat up cycles while sitting idle. You can adjust this in the app's prefs, but I don't understand why OS X can't manage Photoshop's resource consumption?
     
aehaas
Dedicated MacNNer
Join Date: Jun 2001
Location: Osprey, Florida
Status: Offline
Reply With Quote
Apr 25, 2003, 11:10 AM
 
How does one adjust the amount of cpu usage or priority in Photoshop 7 running in OSX? I do not see such a pref under Prefs in the Photoshop menu.

aehaas
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Apr 25, 2003, 11:13 AM
 
Prefs -> Memory & Image Cache -> Max memory used by Photoshop.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 25, 2003, 08:17 PM
 
Originally posted by besson3c:
Top is basically meaningless... the same goes for CPU usage as far as I understand - CPU cycles will be used when available. Don't worry if an app is temporarily taking up 70% of your CPU!

The only exception to this seems to be Photoshop. It will eat up cycles while sitting idle. You can adjust this in the app's prefs, but I don't understand why OS X can't manage Photoshop's resource consumption?
Most apps should not take up 70% of a modern CPU. They simply shouldn't have that much going on. A modest application will not take up 70% of your CPU just because nothing else needs them. This is reflected in idle_thread in top.

And Photoshop is not the only program that takes up resources when sitting idle. A good many Carbon ports do, actually. I have QuickTime Player sitting with no windows open, nothing happening, and it's got 1.5% processor usage. Ditto for iCab. iTunes 2 would take 10% of the processor just for being open.

OS X does try to distribute resources intelligently, but it has no real way of knowing whether or not a program's request for resources is reasonable.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Apr 25, 2003, 08:33 PM
 
Why shouldn't an application take 70% of the CPU if it is needed?

I would *want* an application taking as much CPU as is available...

I've never bought the idea that iTunes is flawed because it takes 10% of the CPU to play an mp3. For one, the sound enhancer is a factor, but also what evidence is there that this is a problem? I'm honestly interested in being proven wrong...
     
aehaas
Dedicated MacNNer
Join Date: Jun 2001
Location: Osprey, Florida
Status: Offline
Reply With Quote
Apr 25, 2003, 08:46 PM
 
The memory (70%) is the maximum of total RAM that may be allocated to Photoshop, not the maximum CPU usage.

aehaas
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 26, 2003, 02:17 AM
 
Originally posted by besson3c:
Why shouldn't an application take 70% of the CPU if it is needed?
I don't know who you're asking. Nobody suggested that an app should take less than it needs. I did suggest that most apps do not generally need 70% of your CPU, but that's a completely different topic.

I would *want* an application taking as much CPU as is available...
Before any applications use it, there's always 100% of the CPU time available. Personally, I would prefer that a program take as little of my system resources as is necessary to do its job and leave the rest for other apps.

I've never bought the idea that iTunes is flawed because it takes 10% of the CPU to play an mp3.
Once more, this was not brought up. To reiterate: "iTunes 2 would take 10% of the processor just for being open."
iTunes 2 took up about 35% of the processor on that computer to play an MP3.

For one, the sound enhancer is a factor, but also what evidence is there that this is a problem? I'm honestly interested in being proven wrong...
Well, it would certainly be better if it took less of my processor to play things. With iTunes 2, that was 35% of my processor for iTunes, 25% for AOL, and another 20% to the window server. Add in various other programs and it wasn't uncommon to have the processor pinned, which makes for a very choppy computing experience.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
mosch
Junior Member
Join Date: Apr 2003
Status: Offline
Reply With Quote
Apr 27, 2003, 04:40 AM
 
Originally posted by besson3c:
Why shouldn't an application take 70% of the CPU if it is needed?

I would *want* an application taking as much CPU as is available...
If it's needed, then there's no problem with using CPU, but it's also possible to write applications that work inefficiently and just burn CPU without any gain. It's the latter that people are concerned about, not the former.
     
ngrundy
Dedicated MacNNer
Join Date: Nov 2002
Location: Hobart, Tasmania, Australia
Status: Offline
Reply With Quote
Apr 27, 2003, 10:44 AM
 
Wired is RAM in use by the Kernel
Inactive is ram that has contents but is able to be cleaned out for use by other programs
Active is stuff being used by programs.

UNIX OS's uses a very different style of memory management to what OS9 used to use. In OS 9 apps used the amount of ram you told them to use and that was it. Under OSX and other Unix style OS's applications just use what they need and the OS deals with finding somewhere to put it.

I tried to understand how FreeBSD deals with memory one day because I was bored, my head exploded. There are some smart people writing the stuff to deal with memory management.

Let it do its thing, it's time to get more ram when your machine spends more time getting crap out of Virtual Memory than it does running a program
1Ghz Powerbook
40gb/1x512mb/combo/T68i
FireRAID 1 Host Independant Hotswap RAID 1 (80gb)
     
   
 
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
Top
Privacy Policy
All times are GMT -4. The time now is 04:44 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,