Lots of Memory Being Used

Discussion in 'OS X Yosemite (10.10)' started by TrenttonY, Dec 13, 2014.

  1. TrenttonY macrumors 6502a

    Joined:
    Nov 14, 2012
    #1
    My new 13 inch Macbook Pro with 8gb of ram is always running between 6-7.5 gb ram (out of 8) when nothing is open. How do i fix this?
     
  2. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #2
    That is normal. With most UNIX and UNIX based operating systems, like Mac OS X, free memory is wasted memory.
     
  3. TrenttonY thread starter macrumors 6502a

    Joined:
    Nov 14, 2012
    #3
    So using 7.95 gb of ram with just Safari and iTunes open is okay?
     
  4. MikhailT macrumors 601

    Joined:
    Nov 12, 2007
    #4
    Yes. Just look at the swap usage, if it is actually hitting your disk, then you have a problem. If not, then don't worry about it. OS X will release memory as needed to open your other apps.

    Open your other apps and look at the RAM usage, it'll adjust.

    On my iMac with 32GB, only 7 tiny apps (only using up to 800MB combined) will put 10GB of memory to the used section.
     
  5. TrenttonY thread starter macrumors 6502a

    Joined:
    Nov 14, 2012
    #5
    My says "Swap Used 0 bytes)
     
  6. MikhailT macrumors 601

    Joined:
    Nov 12, 2007
    #6
    Then it's fine, it is not hitting your disk at all despite nearly all of the RAM being used.

    Open more of your apps, see if you can reach 8GB to start hitting your hard drive. You'll notice it'll take a lot and then OS X starts compressing your RAM to use it as much as possible before it even hits your disk.
     
  7. simonsi macrumors 601

    simonsi

    Joined:
    Jan 3, 2014
    Location:
    Auckland
    #7
    The RAM doesn't just have what IS open in it, it has as much of was HAS been opened since the last reboot in it - just in case you want it again.

    If you need to open a new app, it will free up RAM to do so, but if you want to reopen an app you have had previously open, it will just run it from the copy already in RAM.

    It isn't like windows where only what is running is in RAM, keeping a bunch of RAM empty...for no purpose.
     
  8. TrenttonY thread starter macrumors 6502a

    Joined:
    Nov 14, 2012
    #8
    Gotcha! If you couldn't tell I just switch from Windows.
     
  9. simonsi macrumors 601

    simonsi

    Joined:
    Jan 3, 2014
    Location:
    Auckland
    #9
    Another Unicorn lives! :D
     
  10. AFEPPL macrumors 68030

    AFEPPL

    Joined:
    Sep 30, 2014
    Location:
    England
    #10
    It doesnt matter if you've just rebooted or not, the OS will swallow 7GB to just put up a screen and safari. Its become very bloated now.
     
  11. simonsi macrumors 601

    simonsi

    Joined:
    Jan 3, 2014
    Location:
    Auckland
    #11
    Not on my 4GB MBA it doesn't, even virtual only gets up to 7GB with 4 users logged in, Safari on most of them, iTunes, and after being up for a week....

    Obviously YMMV.
     
  12. chabig macrumors 68040

    Joined:
    Sep 6, 2002
    #12
    It's too late to duck, but the entire thread just went over your head.
     
  13. Mr. Buzzcut macrumors 65816

    Mr. Buzzcut

    Joined:
    Jul 25, 2011
    Location:
    Ohio
    #13
    Last comment is very outdated.

    "As you'll see if you step through the entire gallery, Windows tries its very best to avoid leaving any memory at all free. If you find yourself with a big enough chunk of memory here, you can bet that Windows will do its best to fill itby copying data from the disk and adding the new pages to the Standby list, based primarily on its SuperFetch measurements. As Russinovich notes, this is done at a rate of a few pages per second with Very Low priority I/Os, so it shouldn't interfere with performance.

    In short, Windows 7 (unlike XP and earlier Windows versions) goes by the philosophy that empty RAM is wasted RAM and tries to keep it as full as possible, without impacting performance."

    http://www.zdnet.com/article/windows-7-memory-usage-whats-the-best-way-to-measure/
     
  14. AFEPPL macrumors 68030

    AFEPPL

    Joined:
    Sep 30, 2014
    Location:
    England
    #14
    No, I understand how the memory management works.... and at a high level i agree free memory is simply wasted in theory. The OS needs around 7GB to wake up, if you don't have that amount the OS will either compress unused parts of the memory and/or use virtual memory. Activity Monitor provides a real good graphic showing the memory pressures, whats consumed by APPs, whats in swap. As long as the pressures graphic is green all is good even if the amount of "memory used" is 100% of the physical.

    we think, therefore we are.....
     
  15. dyn macrumors 68030

    Joined:
    Aug 8, 2009
    Location:
    .nl
    #15
    Even then there is no problem. Swapping is actually quite normal. There are apps that will use it and there are times when things will swap out to save memory. You should see an increase in swap when you leave your computer running for several days (put the machine to sleep rather than shutting it down), even when there is free memory. It's part of memory management in an OS.

    As of Mavericks you need to look at the memory pressure. If that graph is green everything is ok, if different then you have a problem and does it warrant to worry.
     
  16. MikhailT, Dec 14, 2014
    Last edited: Dec 14, 2014

    MikhailT macrumors 601

    Joined:
    Nov 12, 2007
    #16
    Sorry, no. Swapping should be minimized as much as possible especially if you're on SSD. If you're right, then there is zero point of OS X having the compression technologies and no need to worry about memory leaks.

    Swapping is a backup to your memory, it should be not used to extend your memory. You're not only harming your drives but also your overall performance.

    And no, your swap usage should NOT be increasing in any conditions. That's an inefficient memory management if your swap is increasing over time. If it is increasing, it means you need more memory or shut down your apps more often. Also a sign of serious memory leaks.

    I've seen zero swap on my 16GB laptop after running a month without any reboots. Keep in mind hibernation file is not the same as swap even though the action is the same (pushing the RAM data to disk in order to sleep the laptop).
     
  17. simonsi macrumors 601

    simonsi

    Joined:
    Jan 3, 2014
    Location:
    Auckland
    #17
    Apps don't use swapping, they know nothing about it.

    Swapping/paging is an OS activity used as part of the OS' memory management, if it has a better solution (more RAM or compression), it will use it to keep performance up. If the OS is swapping then it has run out of better options and performance is starting to degrade.
     
  18. leman macrumors 604

    Joined:
    Oct 14, 2008
    #18
    There are scenarios where swapping is the optimal strategy. For instance, if you have a low-priority, background-running (non-UI) application. Imaging for example an indexing daemon. It starts up periodically, does its thing and goes back to sleep. It would be wasteful to keep it in RAM all the time (even if you have a lot of it), but it is also not very efficient to relaunch it from scratch every time it starts. Swapping it to the disk when its paused is the best way to achieve high performance and high efficiency, with optimal resource utilisation. Note: I have no idea whether OS X actually works that way. But that is what would make sense to me.
     
  19. simonsi macrumors 601

    simonsi

    Joined:
    Jan 3, 2014
    Location:
    Auckland
    #19
    If you have enough RAM it is never "wasteful" to keep data there, what would you be wasting?

    If you don't have enough RAM for the processes you want to run then swapping is part of a memory management strategy for the OS but trust me, it is never optimal to swap when there is any other option.

    In <rough> terms, RAM is 100,000 times faster than spinning disk (HDD), 20,000 times faster than SSD to access the same data.
     
  20. simonsi macrumors 601

    simonsi

    Joined:
    Jan 3, 2014
    Location:
    Auckland
    #20
    Excellent - yes it would be outdated, haven't bothered keeping up with windows memory management since XP pushed me across to OSX.

    Glad to see all OS' agree that empty RAM is wasted - just the algorithms differ on what to fill it with....thanks for the clarification :)

    Interesting to note a high proportion of currently-moving-to-OSX ex-Win users have the same misunderstanding of current windows behaviour (hence asking about OSX running full memory). I guess Microsoft didn't do a good job of selling that change to the general user-base, or they are migrating from XP-era versions....
     
  21. leman macrumors 604

    Joined:
    Oct 14, 2008
    #21
    Well, you are wasting RAM. In my above example, keeping the indexing daemon data in the RAM can be wasteful because the same RAM can be used, say, for caching while the daemon is inactive. Restoring the deamon from swap is of course marginally slower than from RAM, but it does not matter, as it is not a time-critical application. Swapping the deamon data to disk is extremely efficient, because only changed pages needs to be saved, most of the saved state remains unchanged and does not need to be touched.

    Again, I do not think that this is true. If swapping does not degrade performance, but actually frees up system resources while optimally using them, then it is the optimal solution. Unless you really have tons of RAM. The cost/benefit equation is quite fragile here.
     
  22. Mr. Buzzcut macrumors 65816

    Mr. Buzzcut

    Joined:
    Jul 25, 2011
    Location:
    Ohio
    #22
    Or friends with Macs are filling them full of misinformation about the "benefits" of moving to OS X! :) Joking, of course. I think people get in these forums and start tinkering without reading much background info. They worry about stuff they don't understand and start making changes to fix problems that don't exist. As an example, it doesn't really matter what the problem is but you can be assured someone will suggest resetting SMC and PRAM, and repairing permissions.

    I'm not suggesting everyone needs to understand memory management but I think they should read up on it a bit if they are going to spend time worrying about it or take some kind of "corrective" action like using memory cleaners or needlessly killing processes.
     
  23. simonsi macrumors 601

    simonsi

    Joined:
    Jan 3, 2014
    Location:
    Auckland
    #23
    Yep to all of that :)
     
  24. dyn macrumors 68030

    Joined:
    Aug 8, 2009
    Location:
    .nl
    #24
    Swap is absolutely NOT a backup to your memory and it certainly isn't in OS X. Swap is just memory on disk and it is quite useful. Why? Because it frees up actual memory. It is something that is heavily used in virtualisation products because it makes far more efficient use of memory than without it. Swap is more like a parking lot where you can park stuff that you don't quite actively use. Similar to App Nap.

    In general yes but not in OS X and not with certain applications or in the virtualisation world.

    What you are describing is only part of the story. Memory management is not something that is only done by the OS for very obvious reasons. The app knows about its memory, the OS doesn't and vice versa. Therefor they have to work together. That's why apps can use more memory than they need and why they return memory when other apps need it more. And that's also why they are able to swap. The app requests the OS to swap.

    And because of that about 99% of the people here have the same misunderstanding of memory management. Memory management is done differently in the non-Windows world. Windows has been catching up to that as of Windows 7 (and they did a great job). However, the knowledge about memory being used as little as possible and the same for swap is just outdated. We have moved on years ago.

    One thing to note is that RAM and swap are only small parts of the entire memory system. Another important thing to note is that this system used by both software and hardware (PCIe devices and such; the reason why 32 bit Windows systems can't address more than 3.25GB of memory, the other 0.75GB is for things like PCIe devices, graphics, etc.).

    The following articles describe more about OS X memory usage. Read them very very carefully:

    And the main article: Memory Usage Performance Guidelines

    The above links are all part of developer.apple.com and are aimed at developers who write software for OS X. It tells them how their applications should interact with the memory system in OS X. It's all very technical. The only thing Average Joe needs to remember is what the help function in Activity Monitor tells them and that is to look at the memory pressure. If it is any other colour than green you have a problem, if not then all is well. You can safely disregard the other numbers.
     
  25. DaKKs macrumors 6502

    Joined:
    Aug 15, 2012
    Location:
    Stockholm, Sweden
    #25
    I think some people here are confusing swap space and scratch space. The principle is the same, but its not quite the same thing.
     

Share This Page