Improved memory management

Discussion in 'OS X Mountain Lion (10.8)' started by brijazz, Jul 28, 2012.

  1. macrumors 6502

    brijazz

    Joined:
    Jul 31, 2008
    #1
    Under Lion (and to some extent, Snow Leopard), I used to get significant pageouts despite having 8GB of RAM on my mid-2010 MacBook Pro. Since installing Mountain Lion... no pageouts after nearly 48 hours of uptime. Very promising. Thanks, Apple!

    If you're interested, my memory issues were discussed here: http://forums.macrumors.com/showthread.php?p=14771029#post14771029
     
  2. macrumors 68000

    steve-p

    Joined:
    Oct 14, 2008
    Location:
    Newbury, UK
    #2
    I have zero page outs too, even after running Aperture and a couple of VMs in Parallels for a while, which is a first. Swap used was always zero but with quite a few page outs. Something changed, and I hope it's not just that they broke page out reporting :)
     
  3. macrumors 6502

    Joined:
    Jul 4, 2011
    #3
    What about my stats?


    Mach Virtual Memory Statistics: (page size of 4096 bytes)
    Pages free: 618579.
    Pages active: 956450.
    Pages inactive: 77048.
    Pages speculative: 83342.
    Pages wired down: 359306.
    "Translation faults": 356838538.
    Pages copy-on-write: 18984077.
    Pages zero filled: 169357675.
    Pages reactivated: 426478.
    Pageins: 6605659.
    Pageouts: 1750141.
    Object cache: 26 hits of 2605335 lookups (0% hit rate)
     
  4. macrumors 68000

    steve-p

    Joined:
    Oct 14, 2008
    Location:
    Newbury, UK
    #4
    Well I have

    Mach Virtual Memory Statistics: (page size of 4096 bytes)
    Pages free: 563475.
    Pages active: 557086.
    Pages inactive: 497721.
    Pages speculative: 75622.
    Pages wired down: 400920.
    "Translation faults": 11904291.
    Pages copy-on-write: 326331.
    Pages zero filled: 10498030.
    Pages reactivated: 2166.
    Pageins: 166227.
    Pageouts: 0.
    Object cache: 12 hits of 63484 lookups (0% hit rate)

    Which shows zero page outs also.
     
  5. macrumors 6502

    Joined:
    Jul 4, 2011
    #5
    Your uptime?

    I do nothing special. Just surfing, emailing and so on...

    Therefore this seems to be HUGE pageouts.
     
  6. macrumors 68000

    steve-p

    Joined:
    Oct 14, 2008
    Location:
    Newbury, UK
    #6
    Only 12 hours but during that time I've been running multiple VMs, Aperture, iTunes, Safari, Mail, Notes, Preview, Time Machine concurrently. Previously there would have been page outs recorded but no swap used.
     
  7. macrumors 6502

    Joined:
    Jul 4, 2011
  8. macrumors 68000

    steve-p

    Joined:
    Oct 14, 2008
    Location:
    Newbury, UK
    #8
    Not good, but how much RAM do you have and how long since a reboot?
     
  9. macrumors newbie

    Joined:
    Oct 28, 2003
    Location:
    Chicago, IL
    #9
    Same here. I have been able to switch back to Safari.
     
  10. macrumors 6502

    Joined:
    Jul 4, 2011
  11. macrumors 6502

    Joined:
    Jan 5, 2011
    #11
    probably a stupid question, bu were do you guys find Object cache

    this is what i see:
     

    Attached Files:

  12. macrumors 6502

    Joined:
    Jul 4, 2011
    #12
    vm_stat :)

    ----------

    I don't understand why i so terrible stats :-(

    Does someone know? Maybe Google Chrome?
     
  13. macrumors 68000

    steve-p

    Joined:
    Oct 14, 2008
    Location:
    Newbury, UK
    #13
    You are on Mountain Lion though right?
     
  14. macrumors 6502

    Joined:
    Jul 4, 2011
    #14
    Of course.
     

    Attached Files:

  15. macrumors 6502

    Joined:
    Jul 4, 2011
    #15
    I think it was because of VMware Fusion. I used it in the last 7 days.

    Now after reboot page out is zero :) I will keep an eye on it to see when page out will grow :)
     
  16. throAU, Jul 28, 2012
    Last edited: Jul 28, 2012

    macrumors 68030

    Joined:
    Feb 13, 2012
    Location:
    Perth, Western Australia
    #16
    Some page outs if you've run vmware are nothing to worry about.

    It's the number in brackets you want to worry about.

    If your machine is running slow, AND the number in brackets (page outs/sec) is not zero, then you need more ram at that point.

    Having some paging, when you have applications in the background doing nothing is to be expected unless you are way over spec on RAM. Inactive applications are better paged out to make more room for buffer cache (i.e., if they are paged out, they are still in "inactive memory" and can be reclaimed instantly if more ram is needed).


    Seriously, people need to relax, stop looking at inactive memory and total page out numbers and let the VM subsystem do its job.

    Worry about the pages/sec while you are working, not the total numbers. Having stuff paged out that is doing nothing while the system is idle is nothing to worry about really.

    I mean, for example: i have a 34 gig iphoto library.

    After browsing my photos, i have 4.5gig in inactive memory, after quitting iphoto. I also have page outs (i have 8 gig ram)

    This inactive memory can be reclaimed as needed. But if i fire up iphoto again, or access the iphoto database from another app, it is already in RAM for future reference...

    Dumping all that cache, or having iphoto consume less memory so some idle application (i.e., one that is doing nothing) doesn't need to get paged out would be a net lose.

    Fusion will do the exact same thing to try and cache access to your VM's VMDK file, to speed up virtual disk access.

    "Free" memory is useless.
     
  17. macrumors 6502

    Joined:
    Jul 4, 2011
    #17
    Thank you for the detailed description :)

    It was only a bit surprised, because my system is very fast ;-)
     
  18. macrumors 68030

    Joined:
    Feb 13, 2012
    Location:
    Perth, Western Australia
    #18
    A system that swaps intelligently SHOULD be fast, as it can better use the RAM for cache (inactive memory). Memory that is either free or consumed by an inactive app is wasted. The inactive app is better swapped out - "depending" on various circumstances, like how often it activates, etc. The kernel can only guess at these things - based on prior application performance.

    Lion was slightly brain damaged as it appeared to try and swap too aggressively and hold onto inactive memory in preference too much (speculation: possibly because apple tested it more on SSD and neglected tuning for hard disk paging performance). i.e., the "guessing" Lion did about when to swap was poorly tuned when taking spinning disk performance into account...

    ML seems much better as far as performance goes, but the basic idea is the same. I'd wager they just slightly tweaked some numbers in the kernel that determine how aggressively it will swap things out, vs keeping them in memory so that it doesn't hammer the disk.
     
  19. macrumors 65816

    adnbek

    Joined:
    Oct 22, 2011
    Location:
    Montreal, Quebec
    #19
    I'm finding Safari MUCH better now with ML. It's used to hog tons of ram after it's been running for a while and I've done lots of surfing, but with ML no such thing.

    It could be Safari 6 more than ML that's made the difference, I don't know. But I've had Safari open since the upgrade (and have browsed a lot since then) and Safari + Safari Web Content only taking about 400-500mb of RAM. At this point with Safari 5 and Lion it would have easily been in the GBs by now.
     

Share This Page