OSX Ram management sucks

Discussion in 'macOS' started by Burnsey, Mar 12, 2008.

  1. Burnsey macrumors 6502a

    Jul 1, 2007
    I have safari and preview open and most of my ram is inactive. The system has slowed to a crawl, beach balls galore. How do I make the inactive ram active? So far the only solution I can think of is to open many massive photoshop CS3 files and let it eat the inactive ram (immensely slow) and then quit it to recover the ram and make it free. I am in the process of doing that and it's painfully slow (compared to opening those PS files when instead of being inactive, the ram is free). I have 2GB by the way, am I missing something?

    Edit: after doing the PS thing, I got all my free ram back, but a few seconds later all of the green began slowly being taken over by the blue, and now a couple of minutes later, I'm back where I started! And everything is SLOW!

    Attached Files:

  2. Eidorian macrumors Penryn


    Mar 23, 2005
  3. Burnsey thread starter macrumors 6502a

    Jul 1, 2007
    yes I know how to read the ram in activity monitor, the problem is all my ram is either being used (15%) or inactive (85%), which slows the system down more than if it were free. How do I make the inactive ram free again?

    I don't think I need more ram, I'm just using the web.
  4. AliensAreFuzzy macrumors 68000


    May 30, 2004
    Madison, WI
    Did you read the doc that he linked to?

  5. synth3tik macrumors 68040


    Oct 11, 2006
    Minneapolis, MN
    The issue is that Safari even though it is great is a total RAM hog.

    OS X has great RAM management IMHO.
  6. Burnsey thread starter macrumors 6502a

    Jul 1, 2007
    So now I restarted, and am using the same applications again. The whole system is much snappier, seeing as most of my ram is now free. This is how it should be! instead of last time where under same conditions my free ram started being converted to inactive ram for no apparent reason, slowing things down.

    Attached Files:

  7. Eric5h5 macrumors 68020

    Dec 9, 2004
    2GB of RAM is way more than enough for most things. So don't get more RAM.

    And yes, the subject is beaten beyond death. Inactive RAM basically = free RAM. There is absolutely no need to "free" it since it's already free if anything needs to use it. OS X memory management is fine; it's supposed to work that way and having most RAM inactive rather than free is in fact normally faster. You have some other problem...try running a hardware test.

  8. Burnsey thread starter macrumors 6502a

    Jul 1, 2007
    I don't want it to do that, I just want it to dump that ram and make it free. having it as free is much better for me than keeping it as inactive, even if it does slow down applications which I have previously used but are now quitted.

    and there is no good reason why 85% of my 2GB of ram should be inactive in the first place. To me, inactive ram does NOT equal free ram, because clearly it slows my system down significantly when compared to just free ram. When it is all blue, the system is SLOW as heck, but when all green it is FAST. When I'm using only Safari and preview, I expect it to be fast.

    btw safari does use a ton of ram, but that is not the problem.
  9. deputy_doofy macrumors 65816


    Sep 11, 2002
    Your issue is definitely something else, seeing that we both have the same laptop. It's rare that I restart and I sometimes have Parallels running Windows XP (w/ 512mb allotted to Windows), Firefox, and who knows what else. I don't get the problem you're describing on my machine.
  10. err404 macrumors 68020

    Mar 4, 2007
    More often then not, when my machine is suddenly acting slower then it should, it's due to Finder. Are connecting to any mapped drives? Stalled Finder threads trying to communicate with network shares seems to be a chronic issue.

    BTW - looks like triplets
    15" (Glossy) MacBook Pro/2.33GHz C2D/2GB RAM
    unless I'm running parallels, 2G has never felt too small.
  11. Eric5h5 macrumors 68020

    Dec 9, 2004
    That's not the case, though. I'm not saying your system isn't slowing down, but neither inactive RAM nor OS X's (quite good) memory management is the cause. After my G5 has been going for several days, usually 95+% of unused RAM is inactive, and it's still just as fast as it was when I started it up. So, I'm suggesting finding the actual cause, instead of focussing on trying to "free" inactive RAM, since that's not the problem.

  12. err404 macrumors 68020

    Mar 4, 2007
    When your machine is slowing down, open Activity Monitor and look under the CPU tab. Are any processes using more then say 10%?
    Also try looking in the Desk tab at the IO per second.

    If your machine is idle both the CPU and Disk IO should be very low regardless of the amount of inactive RAM.
  13. Burnsey thread starter macrumors 6502a

    Jul 1, 2007
    Ok I tracked the problem to transmission. Although my CPU usage all through this has never exceeded 20%, every time I open transmission, all my active ram suddenly turns into inactive, the hard disk starts working really hard, and the system slows down.

    transmission -> inactive ram -> HD -> slow down, CPU doesn't budge from 8ish%. I have no idea why!
  14. Mindflux macrumors 68000


    Oct 20, 2007

    Sounds like transmission is checking the crc of the torrents when you open the program (which is normal) and chews through cpu and memory, once that's done your hard disk is of course going to be very active writing torrent data to your drive and from your drive.

    Did you really expect it to be any different? Remove all of your torrents from transmission, reboot to clear your inactive ram and re open transmission. I'm willing to bet the symptoms disappear when you aren't actively pirating ;)
  15. Mr Black macrumors member

    Mr Black

    Sep 6, 2007
    Ontario, Canada
    Inactive ram is just "free ram" that was allocated to a process and is now not used, its kept inactive because it wont hurt performance, it's technically free but if you open an application that you previously had closed it will hasten loading times for that application. Regardless what would it matter if you had to wait a few more seconds for an app to open if you have the time to waste opening and closing arbitrary photoshop documents?
  16. MaskedDave macrumors newbie

    Jul 22, 2009
    Garageband Memory Issues

    Hi, not exactly related to this problem, but it does relate to Mac memory management.

    I've got 2GB of RAM installed in my Macbook and when I'm using Garageband to record my podcast (www.inappropriatebehaviour.co.uk ;) ) I turn off all other running applications.

    However, according to the memory monitor I'm using, it'll only ever use up to a quarter of the available RAM, which would be fine if it didn't frequently crawl to a halt.

    I'm assuming there must be some sort of upper limit set either on the application or on the OS for a per application basis, but I can't find any documentation or reference to this.

    I just want to actually make use of all the RAM I have, is this possible?
  17. SubliminalMac macrumors member

    Aug 25, 2007
    Developer Problem

    Would this be the reason that covers when I eject all the mounted partitions like windows 7 bootcamp it speeds right back up!
    however, non connected. I am having the same problem is the other guy only its firefox and transmission... APPLE FIGURE THIS OUT SEEMS LIKE THESE GUYS DON'T KNOW HOW TO ENGINEER OR MANAGE MEMORY THAT THE PROGRAMS USE!
  18. vhato macrumors newbie

    Jan 18, 2010
    From watching all the performance monitors it "appears" Inactive Ram isn't "Free Ram" at all as suggested earlier in the thread. I am thinking as I open an application, OS X swaps what is necessary from Inactive Ram to the HDD Swapfile as seen in a increase in Disk IO. However, what is also discerning is Activity Monitors Inaccuracy. As the Disk IO increases to high levels, the CPU sits at around 2-6%. If the Activity Monitor properly did its job, it would show the CPU usage during heavy disk use. It doesn't even show us work queues so we can see how much more work the Disk and CPU have to complete. Activity Monitor is essentially useless.

    OS X inactive memory management works well for its purpose of an application cache, but damn. Once all my ram is dedicated to Inactive Ram, leaving me with about 10mb free, the system does slow to a crawl.

    I would prefer OS X monitor when the CPU is less than 10% for a period of time. Once that threshold has been met, begin freeing Inactive Ram by either swapping 25% of the oldest information to disk (while it determined it was idle) OR just freeing it up.

    I leave my iMac on all the time, and Apple's inefficient use of Inactive Memory is rediculous. Maybe its great for the typical 12 year old using FaceBook, listening to Music and sending E-mail, but real users expect a snappy system when they open a new application.

    Does a tool exist that I can click on that will allow me to manage Inactive Ram?
  19. Poncho macrumors 6502


    Jun 15, 2007
    Just enter "purge" into the Terminal and hit enter.

    Or use iFree memory, like what I do.
  20. maflynn Moderator


    Staff Member

    May 3, 2009
    Here's my $.02

    OSX's memory management is very good, what isn't very good is the fact that OSX is quite bloated, consuming way too much resources, safari continually has memory leaks and mail can be a memory hog. In short while the memory management is very good, the bloat leaves little to play with, especially if you only have 2gig. Get 4 and you're system will feel brand new.

    FWIW, Linux has a great memory management system and is quite svelte, I can get buy with 512k on fedora very easily, where as I need 4gig with osx
  21. vhato macrumors newbie

    Jan 18, 2010
    I will try iFree.

    My iMac has 8GB Ram and my MBPro has 2GB. They both suffer.

    I guess this is more of a Unix/Linux issue. The flat memory model has huge advantages in server environments, but on a desktop side where things change alot, I just don't think Apple has paid attention to it, OR maybe these improvements require too much of a kernel change making it less Unix like.
  22. atyoung macrumors newbie

    Jan 16, 2010
    Eugene, OR
    I love how I recently upgraded my RAM to 4 gig, and now I average 1.25 active, when before I was averaging .75 gig. heh Funny how that works.

    Regardless instead of activity mon try typing top in a terminal. It's about as accurate as your going to get.

    Now as for the inactive vs free, theres a little truth to both theories presented in this thread.

    Inactive memory is still owned by some process or another, as such if the process wakes up and needs the memory, it will move back into active accordingly.

    You will note that, if you use the purge command you'll find that not only a brief second (or more depending on system spec and whats running) of pause due to the fact that some of that memory is owned by processes still active and as such can't be fully released so you are effectively forcing it to swap slowing your system to a grinding halt while it tries to safely write the memory to your HD which in turn is pushed back to inactive as it finds out you are no where near using up all the physical memory and are essentially wasting harddrive writes and cpu time for a different color on a pie chart, but that you simply cannot actually get inactive memory down to 0.

    There is good reason for this, there may be chunks of memory for which a process may not access very often, and as such it get put into inactive so that it may be used for a process that needs more active memory, should there be not enough free.

    At the point that the memory left in inactive is requested by a new memory needy process the system decides if the memory needs to be swapped (because of the nature of the memory be it writeable, read only, whatever and activity of the owner process) it is here that that it will either be given to the new process whole heartedly or swapped and then given over (this is all assuming there isn't enough in the free column to handle it, or that you are not running a process that already has memory in the inactive that simply needs to be called back up into active, which is likely).

    It's this point which claims at minor slowdown come into play, as the decision to swap or not and the actual process of swapping can be quite intensive thus causing symptomatic slowdown perceived by the end user. 9 times out of ten the slowdown is the CPU hit combined with swapping owned memory (if whats being run is exceeding the free memory).

    Swapping is even slower on fairly full harddrives also, much like the fuller your harddrive the slower your system. More data, longer to find the data your looking for, or the swapped data in this case. This is why most nix system admins generally setup a separate swap partition (even going as far as to have a separate drive dedicated to it), and generally put it at the top of the table so its not hard to find, which is one of my biggest gripes about OSX's default setup, which imho should default to something similar.

    BSD was started in 1977, by people much smarter than most, and the memory management system has evolved for over 3 decades, with the input and tweaking thousands of people who are arguably smarter than the people who first wrote the thing. In short, BSD knows a hell of allot more about memory management than the average mac user, and purging on your own should be avoided, and could lead to unexpected instability. YMMV

    Want to add linux seems to handle this better on the surface due to its paging model, it separates machine dependent and machine independent layers at a much higher level in the software making the paging process snappier. The downside to that being that the software code is more, how can I put it, selective making the software less adaptable to underlying hardware changes, which means more code and why some linux users are obsessive to compiling their bins to the kernel (gentoo and the like).
  23. larkost macrumors 6502a

    Oct 13, 2007
    No, it's not funny, it is a good trade-off that a programmer made. The more RAM you have the more MacOS X will try to use as a disk cache. Since RAM is typically thousands of times faster to access than hard disks this is a great performance improvement trade-off. This is an example where Apple's system programmers know better than you about what will get good performance.

    No, this is wrong. Inactive memory is typically code or data that a program has loaded from disk, and then later released, either by freeing it in code or by terminating. Rather than simply dumping this memory into the "free" pool MacOS X (and other *nix-like OSs) leave this already read material in memory until something else needs it. If that program (or some other program) needs that data or code then it is instantly available rather than having to wait for the system to read all of that from disk (again).

    However, there is no ownership implied at all of this "inactive" memory space to the process that once owned it at all. In fact as I indicated before that process often is no longer even running.

  24. obgamer macrumors newbie

    Feb 18, 2010
    OK, but ...

    Yes, memory thrashing is the problem, and could mine be a VM bad guess? I don't see how - seems more like VM stupidity.

    I've been browsing MR and various other sites trying to determine what to do about this *problem*. And it is a problem, no matter when a *nix or BSD user says that it's fine, great, perfect.

    I've loaded up my MB Pro 2Gb with various things running: Mac Safari with many windows/tabs, Mac MSWord with a few docs, Mac MSExcel with one doc, Mac FFox with several windows/tabs, average Mac Mail session, TextEdit with several docs, and Activity Monitor so I can watch what's going on.

    When I then open Parallels/WinXP allocated for 768Gb the show comes to a *halt*. It appears that *any* memory transaction produces a swap and I've let this continue for at least 20 minutes.

    Now, here's the punch line: for the entire time, ~450 Gigabytes, and that's spelled out for emphasis, of memory remains in that oh-so-fabulous "inactive" state. No two ways about it, happens every time, haven't found a solution. I've marked a link where users are recompiling dynamic_pager to cut the swap file down to nothing, but I keep believing that there must be some way to handle this with o-o-b OS X (I'm running the latest Snow Leopard).
  25. gnasher729 macrumors P6


    Nov 25, 2005
    When you use Parallels, you have effectively two computers running at the same time. The way you did it, you end up with a Mac with 1 1/4 GB of memory, and a PC with 3/4 GB of RAM. And it seems the PC is not happy with having only 3/4 GB. And it doesn't matter how much RAM is free on the Macintosh side, the PC cannot use it.

    When you use Parallels or similar software, you need enough RAM for a Macintosh plus enough RAM for a PC.

Share This Page