Sponsored in part by... Freeverse Freeverse, Inc.'s SOUND STUDIO 3.5.5 - Sound Studio is for anyone
who needs to record or edit audio with a professional tool, but at
a consumer price. Perfect for Podcasts, Music, More! Now updated
for OS X 10.5 Leopard. <http://www.freeverse.com/soundstudio>

 [F] TidBITS  / TidBITS  / TidBITS Talk  /

Classifying memory allocations

[petichok]petichok (apparently) - 09:17am Mar 21, 2006 PST
via email

Can anyone help me understand the different classifications of memory
in the Activity Viewer utility? Processes are listed with "Real Memory"
and "Virtual Memory," which mostly makes sense to me. But then in the
tab on the bottom (in Panther, at least), there are categories for
Wired, Active, Inactive, Used, Free, VM size, and Page ins/outs. What
are "typical" values for these different breakdowns so I can compare to
the figures when my computer is running more slowly than usual?

In a sort-of-related question, I've sometimes seen a process named
"(null)" with 1.14 GB of Virtual Memory (I had 768 MB installed at the
time). Is this a bad thing?

Thanks for your help!


--Peter Bird--
Albany, NY


Mark as Read
  OutlineAll MessagesOlder MessagesOldest MessagesNewest MessagesNewer Messages

Chris Pepper (apparently) - Mar 21, 2006 2:51 pm (#1 Total: 8)  

Reply to this message
via email  

Photo of Author
Posts: 838
Re: Classifying memory allocations

At 8:17 AM -0800 2006/03/21, petichokmyrealbox.com wrote:
>Can anyone help me understand the different classifications of memory
>in the Activity Viewer utility? Processes are listed with "Real Memory"
>and "Virtual Memory," which mostly makes sense to me. But then in the
>tab on the bottom (in Panther, at least), there are categories for
>Wired, Active, Inactive, Used, Free, VM size, and Page ins/outs. What
>are "typical" values for these different breakdowns so I can compare to
>the figures when my computer is running more slowly than usual?

        Wired memory cannot be swapped out, so it's always a fraction
of 'real' memory. Page ins/outs are pieces of programs and/or data
being swapped from/to the VM swapfiles on disk. Free is normally
small, because the system tries to keep memory full as a cache if
nothing else. Free memory isn't doing you any good, after all...

        Try "man vm_stat" for more info.


                                                        Chris
--
Chris Pepper: <http://www.reppep.com/~pepper/>
Rockefeller University: <http://www.rockefeller.edu/>

Nigel Stanger (apparently) - Mar 21, 2006 2:53 pm (#2 Total: 8)  

Reply to this message
via email - Dunedin, New Zealand  

Photo of Author
Posts: 412
Re: Classifying memory allocations

On 22/3/2006 4:17 AM, "petichokmyrealbox.com" <petichokmyrealbox.com>
spake thus:

> there are categories for
> Wired, Active, Inactive, Used, Free, VM size, and Page ins/outs. What
> are "typical" values for these different breakdowns so I can compare to
> the figures when my computer is running more slowly than usual?

Given that it depends on how much RAM you have and how many processes you
have running, I don't think anyone can really tell you what constitutes
"typical" usage on your. A lot of those values are continuously changing, so
there may not even be a "typical" usage. I certainly wouldn't have a clue as
to what typical might be on my machine. For example, my current readings are
Total RAM 1GB, Wired about 110 MB, Active about 410 MB, Inactive about 406
MB, Used about 930 MB, free about 93 MB, VM size 7.42 GB, Page in/out
66934/2441.

As far as the categories go however (off the top of my head, please correct
any mistakes I make, and my apologies if you know some of this already):

Wired = memory that has been permanently allocated. It's "wired down" and
therefore can't be swapped out. This is generally used for system level
stuff.

Active = memory that is currently being or was recently accessed. Generally
not a candidate for swapping out unless things get really critical (see
below).

Inactive = memory that has been allocated but hasn't been accessed for a
while. Prime candidate for swapping out if need be (see below).

Used = Wired + Active + Inactive, i.e., memory that is in use.

Free = Total RAM - Used, i.e., memory that isn't in use.

VM size = pretty much what it says. Your processes have allocated that much
memory (so the processes on my machine, for example, have allocated nearly
7.5 GB of memory). Only a subset of the entire virtual memory space can be
kept in actual physical RAM, of course. If more physical RAM space is
required, stuff that hasn't been accessed for a while will be dumped into
the swap space until it's needed again, thus freeing up physical RAM.

Page ins/outs = how much stuff is being read from/written to swap to/from
RAM. While these numbers will always increase over time, under normal
conditions they should only increase relatively slowly (you may get bursts
when you, for example, switch to an application that you haven't used for
some time). If they're ticking up quickly and *continuously*, that means
that your system is spending a lot of time swapping data between RAM and
disk (in the worst cases, the machine spends more time doing this than
anything else, a state known as "thrashing"). This will definitely slow
things down, but generally this won't happen unless you've exhausted
physical RAM (i.e., Free = 0), and you have *lots* of things running.


--
Nigel Stanger, Dunedin, NEW ZEALAND.
http://public.xdi.org/=nigel.stanger
--
Nigel Stanger, <http://www.business.otago.ac.nz/infosci/>
Dept. of Information Science, <http://xri.net/=nigel.stanger>
University of Otago, Dunedin, NEW ZEALAND. +64-3-479-8179

Jackdaws love my big sphinx of quartz.


david shayer (apparently) - Mar 23, 2006 12:16 pm (#3 Total: 8)  

Reply to this message
via email  

Photo of Author
Posts: 253
Re: Classifying memory allocations

At 1:53 PM -0800 3/21/06, Nigel Stanger wrote:
>Page ins/outs = how much stuff is being read from/written to swap to/from
>RAM. While these numbers will always increase over time, under normal
>conditions they should only increase relatively slowly (you may get bursts
>when you, for example, switch to an application that you haven't used for
>some time). If they're ticking up quickly and *continuously*, that means
>that your system is spending a lot of time swapping data between RAM and
>disk (in the worst cases, the machine spends more time doing this than
>anything else, a state known as "thrashing"). This will definitely slow
>things down, but generally this won't happen unless you've exhausted
>physical RAM (i.e., Free = 0), and you have *lots* of things running.

Page ins will go up continuously. Every time you load code or data from disk, it's a page in. Page outs only happen when the system doesn't have enough physical RAM to hold everything, and has to swap something out to disk. If this happens too much, your system is "thrashing".

Page outs are key. You want your page outs to be low. How low? Depends on your system.

I had 768M in my PowerBook, and my page outs often hit 30,000 after a couple of days. I doubled my RAM, and now my page outs stay at 0. And my PowerBook doesn't put up the SPOD nearly as much.

--
David

Nik (apparently) - Mar 23, 2006 12:30 pm (#4 Total: 8)  

Reply to this message
via email  

Photo of Author
Posts: 370
Re: Classifying memory allocations

One note on memory allocations in OS X: A lot of programs generate
gigantic amounts of virtual memory for certain operations. For
example, LaunchBar sometimes bloats up to 700 megs of virtual memory
when indexing my drive (granted, it has a lot to index). The fact
that it's using this much virtual memory isn't really a problem,
given how OS X handles it. As soon as OS X asks for that swap space,
LaunchBar gives it up, but until then, it just hangs out in a swap file.

So, don't be too troubled by apps with massive virtual memory
allocations. It probably just means that the OS hasn't had any need
for that swap space in a while.

The only exception would be if you don't have much space for swap
files on your computer. This was the case on my old Powerbook with a
6 GB hard drive. I gained great performance increases by quitting
apps with large swap files just to clear up disk space and reduce the
fragmentation of the swap files. (I also finally upgraded to a 20 GB
drive and my problems went away -- that might be a far easier solution.)

--Nik

Matt Neuburg - Mar 23, 2006 12:30 pm (#5 Total: 8)  

Reply to this message
 

Photo of Author
Posts: 2577
Re: Classifying memory allocations

On or about 3/21/06 8:17 AM, thus spake "petichokmyrealbox.com"
<petichokmyrealbox.com>:

> Can anyone help me understand the different classifications of memory
> in the Activity Viewer utility? Processes are listed with "Real Memory"
> and "Virtual Memory," which mostly makes sense to me. But then in the
> tab on the bottom (in Panther, at least), there are categories for
> Wired, Active, Inactive, Used, Free, VM size, and Page ins/outs. What
> are "typical" values for these different breakdowns so I can compare to
> the figures when my computer is running more slowly than usual?

My free MemoryStick application helps you watch these values and the Help
document explains them to you and tells you what their implications are. m.


[Look for download links on Matt's home page below. -Adam]


--
matt neuburg, phd = matttidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



Nigel Stanger (apparently) - Mar 24, 2006 5:45 am (#6 Total: 8)  

Reply to this message
via email - Dunedin, New Zealand  

Photo of Author
Posts: 412
Re: Classifying memory allocations

On 24/3/2006 7:16 AM, "David Shayer" <tidbitsentience.com> spake thus:

> Page ins will go up continuously.

Well, when I was writing my original email, over the space of maybe 15--20
minutes my page in count increased by the grand total of 2. Hence I stand by
my original statement :) If everything you need is already in RAM, then
there's no reason for page ins to happens. In extreme conditions that are
getting close to thrashing, you'd generally find that both page ins and outs
would shoot skywards as the system tries to shuffle things around.

--
Nigel Stanger, Dunedin, NEW ZEALAND.
http://xri.net/=nigel.stanger

Lewis Butler (apparently) - Mar 24, 2006 3:49 pm (#7 Total: 8)  

Reply to this message
via email  

Photo of Author
Posts: 930
Re: Classifying memory allocations

On 21 Mar 2006, at 09:17 , petichokmyrealbox.com wrote:
> But then in the tab on the bottom (in Panther, at least), there are
> categories for
> Wired, Active, Inactive, Used, Free, VM size, and Page ins/outs.

These are global values that give you a kind of overview of your system.

Wired is non-swappable memory, this is the amount of memory the
system is using that can't be paged in and out. This should be,
ideally, no more than 1/4th of your total memory (your total is used
+free). On my system the wired is ~250MB and the total is 2GB, so
that's good. On the much less used iMac, it's about ~130MB.

The only reason to look at Free is to add it to Used to get your
total. Free should be very small unless you just rebooted your machine.


The other number you care about is pageins and page outs. High
numbers here can indicate two things, eitehr a lot of apps open and
a lot of switching between apps, or a performance problem on your
system. Generally, the faster you computer and the more RAM your
throw at it, the lower these numbers will be.

> What are "typical" values for these different breakdowns so I can
> compare to
> the figures when my computer is running more slowly than usual?

There are no typical values across machines. The best you can do is
look at them every now and then and see if they look "normal" to you.

> In a sort-of-related question, I've sometimes seen a process named
> "(null)" with 1.14 GB of Virtual Memory (I had 768 MB installed at the
> time). Is this a bad thing?

Are you running Classic? If so, this is likely the memory used by
Classic.

--
Can I tell you the truth? I mean this isn’t like TV news, is it?



Nigel Stanger (apparently) - Mar 27, 2006 8:23 am (#8 Total: 8)  

Reply to this message
via email - Dunedin, New Zealand  

Photo of Author
Posts: 412
Re: Classifying memory allocations

On 25/3/2006 10:49 AM, "Google Kreme" <gkremegmail.com> spake thus:

> Free should be very small unless you just rebooted your machine.

I think that really depends on what you're doing. I rebooted my machine
after the latest security update five days ago and have done quite a lot in
the interim (I currently have my usual crop of about a dozen apps open, plus
all the background stuff). I'm actually rather surprised to find this
morning that I have nearly 1/3 free memory (310 MB out of 1GB). Clearly the
system won't use RAM if it has nothing it needs to store in it.

--
Nigel Stanger, Dunedin, NEW ZEALAND.
http://xri.net/=nigel.stanger



  OutlineAll MessagesOlder MessagesOldest MessagesNewest MessagesNewer Messages


 [F] TidBITS  / TidBITS  / TidBITS Talk  / Classifying memory allocations




Add a message

To add a message to this discussion, you must be a registered user. Enter your email address below. If you have an account associated with the email address you enter, you will be prompted for your password. If not, you'll be able to create a new account with no fuss.

Enter your email address:

Submit