5 ms·
The problem with the way how OS X keeps data cached in the inactive memory is based on the assumption that you are going to re-use the same app within reasonabl
by mellifluousmind 15y ago
The problem with the way how OS X keeps data cached in the inactive memory is based on the assumption that you are going to re-use the same app within reasonable amount of time. With the current behavior/performance response (without knowing exactly how Apple engineers implemented it), it really feels like a giant garbage collection system that takes age to free up its own memory with no real sense of concept that if you don't use certain apps for day, chances are, it is going to take a long while before I use them again.
I am one of the devs out there running a Macbook Pro with 8Gig of memory (I wish I could have more but I have a 2010 old model). For web development, I have at least Firefox/Chrome/PhpStorm/SmartGit/Mamp/Thunderbird/Terminal/Notational Velocity/Dropbox/Alfred/Sophos AntiVirus open at all times. Now, a long the way, I may open a few other apps that I use rarely, like Photoshop/CyberDuck/VMWare Fusion/iTune/iCal/iOS Simulator/Preview/LibreOffice/Skype. Now, pretty quickly 8Gig gets used up, and the system runs to the ground shortly after.
If I then have VMWare Fusion shutdown for awhile, and relaunch later, the system really just can't take it anymore. The last resort? purge&
At least, that's my day-to-day experience with OSX. Personally, I find the memory management really lousy, worse than other other OSes I used in the past (both Windows & Ubuntu/Fedora/Gentoo).
So why the heck I use Mac still? Because of the driver support is still far better than Linux. With Mac, you are less likely in need of blacklist of some drivers because of freeze up issues.
Either way, I am definitely not a happy camper with the current memory management system in OS X
- jrmg 15y agoThe inactive count is a misleading figure in many ways. It includes both 'dirty' and 'clean' (i.e. identical to what's on disk, and hasn't been altered) memory that's not been used for a long time. Purging 'clean' memory is instantaneous. The only cost you'll see is writing 'dirty' memory out to disk. Your explicit purging is changing the cost of writing dirty data out from an ongoing cost to a single, longer, upfront cost. Instead of writing only when more RAM is required, you're forcing it all to happen at once. Incidentally, the OS does try to keep an area of free RAM so that some memory can be allocated instantly, it's not only swapping things out when RAM is absolutely full. It's possible though to outrun this process if an app tries to allocate huge amounts of RAM at once though (i.e. more than is kept free for this purpose). For your specific case, presuming apps are behaving well (see below) you would be better off quitting apps and relaunching them when you need them later. This will free up app the dirty RAM they've allocated (just like when you purge), but the 'clean' inactive RAM will not be purged (because that's not necessary - as I said, it's free to purge that kind of memory when it's needed for something else). You also want to run Activity Monitor when your system is in it's bad state and see if it's one of the apps you're using in particular that's allocating lots of memory (check out the "Real Mem" column). The OS can't do anything if it's an app that's really allocating and writing to memory, it's obviously not able to just discard this written-to memory. Really though, if you want to do all those things at once, more RAM might be required. Remember, with VMWare and the iOS Simulator running, you've got two whole other OSes running at the same time, it's reasonable they'd require lots of memory to work well!). By the way, the purge command was written to simulate /worst case/ conditions when performance testing. It's designed to flush out caches so that the system has to e.g. load all an app's code from disk when launching. [Source: I worked analysing this kind of thing at Apple until a couple of years ago].
- technomancy 15y ago> So why the heck I use Mac still? Because of the driver support is still far better than Linux. I feel like this is a stereotype that just won't die. Yes, up till a few years ago you might have to do some poking in /etc to get things working, but as long as you spend a few minutes looking up basic background info before you buy those problems just don't happen these days. I haven't had to edit a config file to get hardware working since 2007.
- calloc 15y agoI've had to edit configurations files to get hardware working in the last month. On a laptop we have here at the office I had to disable a certain driver from loading before a different driver or else the two would squabble over the wifi card and it would never show up. The other thing that is more software related than hardware is that it is a MS Windows shop, all of the local domains are machine.domainname.local. This conflicts with MDNS as you could imagine, so the Linux machines are unable to access any of the resources on the machines named machine.domainname.local because MDNS would respond with a failure. Had to modify /etc/nsswitch.conf to fix that issue. Linux is not without its failures. Saying it just works is certainly not the case. Whereas the Mac OS X machines I deploy come out of the box, get configured and are ready to go. Drivers work, software works, don't need to go googling for hours trying to figure out why ping won't resolve a machine.domainname.local address but dig is doing just fine.
- technomancy 15y ago> Saying it just works is certainly not the case. I said if you spend a little time scoping these kinds of things out up-front, it's very easy to get a machine on which it will work without issues. Obviously if you found a machine lying around the office and tried to load an OS on it, your chances of it working well are not going to be as good. You can't just load OS X on random hardware and expect it to work either.
- nailer 15y agoAfter 10 years of Linux desktops, including purchasing a laptop with low-performance hardware just because it used entirely OSS drivers, I still has issues with basic things like multiple monitor support (it worked, but only when I disabled compositing, which makes redraw suck). Sorry, from my personal experience that still isn't true, as much as I wish it were.
- dedward 15y agoInteresting - I do about the same thing (Minus the Antivirus.... that could be your big pig there), with 8 gigs of physical ram, and I have paging (swapping?) disabled.... and I've never had a "not enough memory" crash or whatever. With vmware going, iTunes, Xcode building stuff, skpye, dropbox, item, mail, a few browsers, a bunch of tools..... a video going maybe on the second monitor. On a mid-2009 mbp.