image
image

Go Back   macosx.com > Mac Help Forums > Mac OS X System & Mac Software

Reply
 
LinkBack Thread Tools
  #1  
Old November 15th, 2004, 06:40 PM
It all started at 3......
 
Join Date: Feb 2004
Location: Tychy, Poland
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
ian27 is on a distinguished road
Page ins and page outs - could somebody please explain this to me in idiot fashion?

Hi guys,

I have been having some sluggish performance recently and I'm guessing it could be something to do with memory allocation. I have been reading a few things on this board and have found that page ins/outs can have an effect on performance (although I'm still not entirely sure what it all means).

I have closed all my applications except for my browser and the activity viewer to see what is going on. My page readings on the system memory page state:

Page ins/outs 182139/247702.

I have read somewhere that if you have more page outs than ins then you have a problem. Therefore my questions are:

a. Is this actually true and what do page in/outs actually mean?
b. Will adding more RAM to my machine help? I currently own an eMac 1.25ghz with 512 RAM, running OS 10.3.5.
c. What other tips might help its performance?
d. What is the difference between inactive memory and free memory?

In addition, my applications also seem to use up a lot of VM. Could this also cause performance problems?

Thanks in advance for your time.

Ian
__________________
http://www.hititstudios.com
Reply With Quote
  #2  
Old November 15th, 2004, 06:59 PM
symphonix's Avatar
Scratch & Sniff Committee
 
Join Date: Jul 2001
Location: The Australian Jungles
Posts: 4,025
Thanks: 2
Thanked 4 Times in 4 Posts
symphonix is on a distinguished road
OK, to summarise what it means, your computer has a certain amount of RAM, which is its "memory". It simulates more RAM by allowing extra data to be saved to the hard disk, which is known as Virtual Memory.
To do this, it breaks your memory space up into "pages". Applications that need access to data that is in memory call the data by page. If an application calls a page and it is in the RAM, then it is a "page in" occurs. If an app calls for a page from memory, and that page is currently stored on the hard disk and has to be read back into the RAM, then a "Page Out" occurs.
A "Page-out" slows the operation of the system down because it has to read the data from a hard disk into RAM first, rather than reading straight from the RAM. Hard disks take about 300 times as long to transfer a page of data, which adds up to slow performance.

If page-outs exceed page-ins, you definitely don't have enough RAM. Ideally, page-outs should be less than 20% of the number of page-ins (the fewer page-outs, the faster your machine is performing) On my machine, I aim for less than 5%.

Adding more RAM, or reducing the number of open applications, are the only ways to reduce page-outs. While freeing up memory by working with fewer and smaller files and apps may help, more RAM is the only reasaonable solution.
__________________
- iMac G5 1.8GHZ 17" | SuperDrive | 160GB | 512MB | Airport Extreme | Bluetooth Keyboard & Mouse | Wacom Intuos II
- Pentax *ist DL - JVC MiniDV Camcorder - Airport Express - iPod Nano 1gb white
Reply With Quote
The Following User Says Thank You to symphonix For This Useful Post:
lbj (April 17th, 2009)
  #3  
Old November 15th, 2004, 07:01 PM
rbb rbb is offline
Registered User
 
Join Date: Oct 2004
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
rbb is on a distinguished road
You have a limited amount of RAM in your machine. Each process thinks it owns the entire machine, it has all the processor avalible, and it has infinite RAM. In order to do this, the OS has a swap system. When something is put into RAM, it is placed into a 'page' in RAM. When a page is not being used, then it is 'paged' out, and put into swap, which is on the hard drive.

As you can imagine, using swap is a great idea, but your hard drive is slow as compared to RAM, so if you have more RAM, you do not have to swap as much.

As for the number of page ins/outs, I dont see that as a problem. It just means that more stuff is being pulled out, than was being put in.

The question you want to ask is, over what time period did this occur? On my machine:

[bob@Freebird] ~%uptime
18:59 up 1 day, 5:36, 4 users, load averages: 0.18 0.14 0.14

86047 in
37538 out

This is normal to me.
Reply With Quote
  #4  
Old November 15th, 2004, 07:29 PM
It all started at 3......
 
Join Date: Feb 2004
Location: Tychy, Poland
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
ian27 is on a distinguished road
Hi guys, thanks for your prompt replies.

From what you say I'm guessing this may also answer this question. Sometimes I'll check the available space on my internal hard drive and it will have say, 10GB available. Then when I restart the machine is suddenly has say 11GB available. I'm presuming this must be because it has emptied the VM or something like that anyway?

Also, rbb, you asked what time period the page outs occurred over. How can I check this?

Thanks again fellas - your help is very much appreciated.

Ian
__________________
http://www.hititstudios.com
Reply With Quote
  #5  
Old November 15th, 2004, 08:03 PM
rbb rbb is offline
Registered User
 
Join Date: Oct 2004
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
rbb is on a distinguished road
The command uptime.

The extra space, I am going to say is from clearing out /tmp
All my machines are setup to delete the contents of /tmp upon reboot.
Reply With Quote
  #6  
Old November 16th, 2004, 12:30 PM
perfessor101's Avatar
Registered User
 
Join Date: Feb 2004
Posts: 748
Thanks: 0
Thanked 0 Times in 0 Posts
perfessor101 is on a distinguished road
I recently read a supposedly authoritative source that said there is a very big difference in Panther performance between a machine with 512 MB RAM and 640 MB. That source recommended 640 MB as the "sweet spot" although performance continues to improve all the way up to 1 GB and more. I cannot verify that scientifically, but from my experience I would be inclined to believe that is true.

Perhaps this will help you understand OS X memory usage a little better:
  1. all memory in OS X is "virtual". Some of that virtual memory is in RAM, some in system and application files on the hard drive, and some may be in swapfiles
  2. Wired RAM is memory that is pernamently "locked" by the OS and cannot be made inactive or moved to swapfiles. It must be there for the operation of the OS
  3. Active RAM is memory that is currently in use by either the system or an application.
  4. Inactive RAM may be thought of as a first stage swapfile. It contains instructions and data that are not currently in use within the OS or an application, but is left in RAM in the event it is needed again. If more Active RAM is needed, the Inactive RAM will be reassigned and if it contains data for a currently open application, that data will be rolled out to a swapfile. Otherwise the memory will simply be overwritten.
  5. Free RAM is just that. It is RAM that is currently not mapped into Wired, Active, or Inactive RAM. If more Active RAM is needed, the Free RAM will be the first to be remapped into Active status.
  6. Swapfiles are used to contain data being used by currently open applications for which there is currently no room in either Active or Inactive RAM
  7. System resources, fonts, application files, frameworks (shared libraries) are mapped into the virtual memory address space for each application whether they are in Wired, RAM Active RAM, Inactive, RAM, or in files on the HD, but these resources are never placed in the swapfile(s) because they are already available on the hard drive and there is no point in duplicating the code.
  8. Pageins occur anytime something is moved into Active RAM whether that is from Inactive RAM, the swapfile(s), or another file on the hard drive.
  9. Pagouts occur anytime anything is moved out of Active RAM which includes mapping into Inactive RAM, as well as writing to a Swapfile. Only data is ever written to the hard drive since instructions are already on the hard drive.
All in all this is a very efficient use of memory. It also has the benefit of providing an almost invulnerable wall protecting the operating system and each application from inadvertent intrusion by ill behaving code. This is one of the "secrets" of OS X stability.
__________________
G4/1.25 MDD, 1.5 GB, OS X 10.4.5
G4/133 Quicksilver, 1.2 GB, OS X 10.4.5
iBook G4/1.25, 1 GB, OS X 10.4.5
Reply With Quote
  #7  
Old November 16th, 2004, 05:21 PM
It all started at 3......
 
Join Date: Feb 2004
Location: Tychy, Poland
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
ian27 is on a distinguished road
Thanks perfessor101, the information that you have given is extremely helpful and certainly answers a lot of my questions.

Well it looks like some more RAM will certainly benefit me. It's lucky that I've just been paid for my last project

Thanks again for all your help.

Ian
__________________
http://www.hititstudios.com
Reply With Quote
  #8  
Old July 25th, 2008, 05:17 AM
Registered User
 
Join Date: Jul 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
spankey is on a distinguished road
Hay all,

can someone explain exactly what this means

12:06 up 3:18, 2 users, load averages: 0.24 0.38 0.40

I know : this is the actual up time - 12:06 up 3:18

But what do these represent? load averages: 0.24 0.38 0.40
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting 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 Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 11:05 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2008 DigitalCrowd, Inc.