People should not be dismissing this
There are
definitely two major bugs in Mavericks (which I started noticing as soon as 10.9.5 came out) that persist through to Yosemite (including 10.10.2) and appear to recur even if the machine is completely reformatted and the OS reinstalled from clean.
A lot of people are dismissing these. Don't. Just because it doesn't happen to you doesn't mean it's not there. That's how Apple software "works" (or rather, fails) these days - it's full of heisenbugs. Everyone sees something different, even on ostensibly identical machines.
Mystery massive jump in Kernel Task usage
The first is the mystery jump up of Kernel Task from a typical ~1GB to a very large value (it seems to cap at 5GB in my case on my 16GB RAM MBP, but that's because the rest of it ends up in swap, and the whole machine gets slow - but
not always - sometimes I don't notice all the background leaking and swapping for hours). I see this most often in Safari, and it's related to QuickTime and HTML 5 video, or Click2Flash's replacements. Quit Safari, and Kernel Task goes back to normal (but if it's leaked into swap, you don't get that back, sigh).
If other QuickTime-using apps are running at the same type, usually quitting Safari alone isn't enough. They all have to go. Beamer, a "send-file-over-AirPlay" app, is another example of one which can either provoke, or must also be killed to restore, the kernel task massive leak. People have reported similar things with e.g. Lightroom - it probably links into whatever software architecture is involved with QuickTime video playback and provokes the bug.
User space software should never be able to cause faults like this; so whether it's an application level programming bug or not, the
kernel is at fault for leaking so catastrophically in response, or an
Apple driver is at fault if it's happening down at the kext level, because it occurs on machines with no custom kexts installed whatsoever.
This was the bug that plagued me and ruined my Mac from 10.9.5. I did a full reinstall of the OS. For a while, it seemed OK... But then I got the other bug.
Mystery massive swap file use (especially after sleeping)
It's exactly as someone else here says - you reboot, nothing's running, but there's a little bit of swap used for no reason. That's the telltale that your machine has a problem. Even if it's apparently using 0KB, you'll find a 1GB swap file there, so a byte or two really _did_ get allocated. On my Yosemite machine at work, it's got 0 bytes on startup and no page files at all; my two machines behave very differently.
On waking from sleep, if you're quick and have e.g. iStat menus running, you will sometimes - but not always - find that there's been a giant leap in swap usage. Usually at least couple
more GB each time. It'll start to reduce down as you watch.
If you're observant, you'll probably notice that other applications appear to report much reduced memory usage from before you slept the machine - e.g. Safari would've been using 3GB, but now it's mysteriously apparently only using 1GB, even though you didn't touch it; the machine was asleep. Again, you really need iStat to "see" this quick enough using the menus off the menu bar. Activity Monitor's a bit too slow and clumsy.
If you're
really observant, I'm betting that you'll find in Console that your machine woke up by itself while asleep, logged a bunch of stuff including some very cryptic kernel messages about memory usage, then went back to sleep. Basically, it looks like the machine wakes up for no reason, the kernel ***** itself, throws lots of application memory out into swap and somehow makes it look as if the applications are thus using less RAM (technically they are!). When you wake up the machine, lots of software runs, so it all has to get paged back in again and the kernel also perhaps re-assesses page file use, thinks "WTF is all that doing paged out", and tries to clean up. But it's far too late and the whole stack is far too leaky and buggy in totality, so you end up with fragmented swap that just grows, and grows, and grows.
Often the tell-tale for this is that sometimes when you wake the machine, it wakes immediately - no leak. Other times, there's a second or three of delay. That's when it's leaked. OS X is furiously reallocating memory behind the scenes, with lots of disc and CPU usage associated with that process; thus, slow wakeup.
I've spent literally hundreds of hours swapping apps in and out, doing clean installs and so-on, and I cannot find any user-installed reason for what's happening. I'm forced to conclude it's a nasty OS problem.
I usually reboot at around 9GB swap. One thing to bear in mind is that your SSD - including, if you have one, your non-user-replaceable, super-super expensive Apple SSD - has limited write cycles, and all this swapping is
hammering it.
Stop making excuses for Apple - this is a bug that's doing
genuine physical harm to the machine via SSD write cycle wear and tear!
Bug report
19540739, if anyone cares. Got one fast response asking for a sysdiagnose while it is happening - it happens while the machine is asleep FFS, so whoever responded didn't bother reading the report! - but I did my best and I've sent three under various different conditions anyway, including one when I caught the OS just after wakeup doing its hasty page-back-in routine. No response.
Who else sees it?
This is by far the best thread I've found online with descriptions and screenshots that exactly match what I've seen. People here are generally less dismissive too, which is good - it's certainly very hard to explain away a machine that's using swap when its memory pressure graph is saying that most of its memory is essentially unused! (Except for caching etc).
It is hard to Google for this because you just get hundreds of hits from people mistaking queries about kernel leaks for "normal usage" and tedious discussions about how OSs are meant to allocate memory, which sometimes really is the right response, but other times just ignores the fact that a real bug is being demonstrated.
Anyway - two different things, both really, really nasty. Who knows, they might be manifestations of the same bug; but quitting apps has always eventually solved (for some value of solved) the "kernel task chews memory" fault, while there's no solution to the "it's leaked swap all over the disc" bug apart from a reboot.
If you're one of those people who shuts down and restarts your machine every day, then it's less likely you'll have seen at least the swap file leak; it seems to be provoked by sleep only, and even then, only for sleeping over quite long periods. Might just be chance though.
As for me - after spending hours reinstalling the OS from clean, I've now two bugs! I never saw the swap leak until after the reinstall. Now it's happening consistently and Yosemite has made no difference at all.
Apologists just have to face up to it; OS X has been in sharp decline in quality since Lion, and shows few signs of improvement so far. Just look at the size and cash reserves of Apple! They really don't need defending. What they need to do is spend some of that money on better quality engineers (or better in-house training) and a more effective/larger test team. Bit by bit, more and more of the OS is getting broken, but it's always really intermittent and weird. Everyone has different bugs. That's a sign of serious erosion in the underlying architecture - major systemic coding errors - race conditions, unusual hardware driver interactions and so-on, which make the entire system absurdly sensitive to every possible little environmental and software difference you can think of from machine to machine.
I mean, come on. With iOS 8, Apple released an OS update that made their flagship phone unable to make phone calls. Seriously, this isn't a company that needs defending with the prices it charges. It needs to be shouted at until it gets the message.
There's a rumour that iOS 9 will focus on fixing bugs. I hope it's true, and I hope it's going to happen to OS X; because right now, my machine's a leaky, slow mess that's cost me thousands of dollars (high end current model 15" retina, 16GB/1TB) and performs at times the best, but oftentimes the worst of any computer I've owned. When it's not leaking, it's great; but then it all hits the wall, reboot, repeat, give up, go to Windows 10 because it might not work either, but at least I can get cheap hardware
