Optimizing memory management

Discussion in 'OS X Mountain Lion (10.8)' started by activate, Jun 22, 2013.

  1. activate, Jun 22, 2013
    Last edited: Jun 22, 2013

    activate macrumors regular

    Joined:
    Dec 24, 2011
    #1
    I'd appreciate if someone could suggest some guidelines to maintain a stable system from memory perspective.

    My system: Mac mini 2011 server running 10.8.3 (I do not use the server app)
    Hard drive: 132gb of 500gb available
    Memory: 10gb

    I recently upgraded from 4gb to 10gb and yet recently the system slowed down substantially. Free memory was less than 1gb. After I restarted the mac, free memory went upto over 5 and as I monitor it slowly creeps down to the below.

    [​IMG]

    The things that I think that may be memory intensive are
    1. XBMC
    2. Safari and Firefox
    3. Total spaces which is a desktop management app. It is running 5 desktops.

    I guess my questions are:

    * Do installed apps that are not running still consume memory
    * Why do I slowly loose memory over time, even if I close apps.
    * Any suggestions or ideas would be great.

    PS. I am not using photoshop, FCP etc. I do have a reasonable number of small utility style apps as you can guess by the length of the scroll bar. I also do run onyx once a month.

    Thanks, appreciate your help.
     
  2. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #2
  3. activate thread starter macrumors regular

    Joined:
    Dec 24, 2011
    #3
    I wish I'd grabbed the image when the issue last rose. From memory (my ;) )the page ins were about 14gb and the page outs I think were 1gb... That data is pretty close to what it was but the concern was that I couldn't use the system without restarting it and that the memory use was so tight.
     
  4. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #4
    As you can probably see from the link I provided and which you quoted, PAGE INS are not that important with performance. It is the Page Outs and the Swap Used and 1 GB of Page Outs is okay with 10 GB of RAM. If you have the money and the slow downs from paging out 1 GB of RAM (which should take 10 to 20 seconds with an HDD), get another 8 GB module.
     
  5. benwiggy macrumors 68020

    Joined:
    Jun 15, 2012
    #5
    1. No. Apps that are on the disk but not launched consume no RAM.
    2. Few things in life are perfect. It's hard to say particularly what might be doing this. All those little utilities might be causing trouble collectively, or it might just be a Safari memory leak or something.

    3. Don't run Onyx once a month. Emptying caches will slow your Mac down. Rebuilding Spotlight index will slow your Mac down.
    A restart every now and then should be all the "maintenance" you need do.

    It's possible that the slowdowns might not be memory-related. It could be CPU bottleneck; external drives spinning up, or other factor.
     
  6. jennyp macrumors 6502

    Joined:
    Oct 27, 2007
    #6
    But apps that have recently been running and then quit take up RAM don't they? Perhaps I have that wrong?
     
  7. benwiggy macrumors 68020

    Joined:
    Jun 15, 2012
    #7
    Some data belonging to those apps will be held in Inactive Memory, which will be freed to other apps if needed.
    In short: do not worry about InActive Memory. Consider it "Free".

    Also: using RAM is good. Use your RAM! Don't hoard your precious Empty RAM, which you paid for, never to be used. Fill that RAM with data, I say!
     
  8. activate thread starter macrumors regular

    Joined:
    Dec 24, 2011
    #8
    Says the owner of 16gb ram :D kidding. Yeah I agree, it is there to be used and improve performance. For me, understanding how apps use it though, make it easier to manage the system without unnecessarily buying additional ram.
     
  9. benwiggy macrumors 68020

    Joined:
    Jun 15, 2012
    #9
    The point is that there is no management to do. As I said, we haven't determined that your slowdowns are caused by lack of RAM, as you've got Free RAM when it happens.

    Here's the Apple Developer reference documentation for memory management:
    http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/MemoryMgmt.html

    Fill your boots!

    My first Mac had 8 Megabytes of RAM. The System took 2Mb. And the consequences for using it all were much worse than a little sluggishness!
     
  10. activate thread starter macrumors regular

    Joined:
    Dec 24, 2011
    #10
    Without sounding like "how long is piece of string ?",since there was free ram (although small) at the time of slowdown, and there were no cpu spikes or apps not responding, and I checked the spotlight wasn't indexing....are there any other common scenarios, that I missed in this troubleshooting.
     
  11. benwiggy macrumors 68020

    Joined:
    Jun 15, 2012
    #11
    Hard drives are the biggest bottleneck, regardless of RAM size or CPU power. When you replace an HDD for an SSD, you suddenly realise how much of your "waiting time" was caused by the mechanical disk.

    Also, sometimes, there are going to be processes that are going to work the CPU hard, and other processes are going to slow down as a result. It's not necessarily a bad thing that needs to be attended to and avoided to.
    Your computer may just need to think about something a bit more than usual.
     
  12. MrNomNoms macrumors 65816

    MrNomNoms

    Joined:
    Jan 25, 2011
    Location:
    Wellington, New Zealand
    #12
    You'll find that a large portion is being used for a buffer so in effect the page in/page outs don't mean a hill of beans as the data is simply being shuffled around in memory rather than actually physically writing to/from the hard disk. Windows is the same situation along with most other *NIX.
     
  13. activate thread starter macrumors regular

    Joined:
    Dec 24, 2011
    #13
    Thanks guys. Yes I understand the mechanical disadvantage of an HDD in comparison with a SSD which is planned ahead. Another thought came to mind. This Mac mini uses intel 3000 graphics. Since the majority of use of this system is to render video, could the graphics capabilities be a limiting factor and present itself with slowdowns. I don't know how the GPU memory and CPU memory interlace, but just a thought.
     
  14. smithrh macrumors 68020

    smithrh

    Joined:
    Feb 28, 2009
    #14
    I'm wondering if the OP ran into the same situation I've experienced more than a few times - lots of inactive RAM, but ridiculous swapping activity.

    While Apple did make some good improvements with memory handling in ML, there are still issues. It looks like Apple is more than aware of this as Mavericks will have even more improvements and changes.
     
  15. activate thread starter macrumors regular

    Joined:
    Dec 24, 2011
    #15
    Yes, I am running mavericks on another machine and I am very interested in how the new technologies improve resource handling on the Mac mini when I can try it out at some later stage.
     
  16. smithrh macrumors 68020

    smithrh

    Joined:
    Feb 28, 2009
    #16
    Be aware, some of the new features require apps to be re-worked to understand messages that Mavericks will be sending them wrt memory pressure levels.

    So, you will need both Mavericks and updated apps to get the full effect.
     

Share This Page