Haven't seen the paging issues Adam was noticing, but I'm still gobsmacked by the amount of memory some applications seem to take. The OS (kernel_task, mds, WindowServer, and friends) regularly eat up .75 of a gig, and Firefox consumes .5 - 1 gig without much effort (other browsers seem to have a similar profile).
Quick poll, what are you running, and what's your memory consumption? Here's me:
Currently running: Firefox, Spotify, Mail, Calendar, Terminal, Mongo (mongo using 100mb).
It is definitely better overall with ML in that it is no longer ridiculously slow but memory consumption for typical set of tasks still is way higher than either of Linux and Windows.
For instance I have KDE4 running on Linux with Firefox, Amarok, Kopete, Konsole and all other default services (ssh etc). Used memory is 1.1GB.
I've ML running with Firefox, Terminal.app, Activity Monitor in addition to the defaults. Any my used memory is 3.92GB. Wired is 1.75GB and Swap used is 11MB!
My experience with Windows 7 is also lot better than ML - it tends to be bit more than Linux but in the same ballpark.
Edit: To put this in perspective - I just realized that my work laptop (that I RDP into and never reboot) with all possible bloatware loaded and running - Word, Outlook, RDP, Lync 2010, Java Backup process, Enterprisey stuff, Firefox with couple tabs etc. is taking up only 2.83 GB! Apple really has a memory usage problem with OS X.
Windows and Linux don't leave unused memory around - both use it heavily for page cache. However what we have a problem here with is active/resident memory use and/or VM subsystem making no so smart decisions(this part seems to have gotten better with ML).
So the end result is that when Windows and Linux can be quite usable with 2GB RAM with a rotational disk, for similar workload OS X slows down quite a bit.
Except... when apps are using a lot more memory than they do on other OS, you tend to get a low-memory situation anyway.
If I've got a 4gig machine, and running 5 apps takes up 3.8 gig, trying to run another app with necessitate swapping/paging some of the existing apps around to accommodate my new app. If those initial 5 apps only took up, say, 2.8g, I'd have less chance of hitting 'low-memory' situations in the first place.
I say this as someone with 16g mbp and SSD who still hits beach balls and unexplained pauses on a daily basis. Fewer than I used to, but it gets annoying. Not quite as annoying as win95/2k blue screens of 12+ years ago, but getting my ire up.
Beach ball is not necessarily a low memory warning (or memory related). It's showed (only) when a GUI application fails to respond to UI events. Sometimes it's because of bad threading in applications or things like that.
If you're interested in seeing what's happening, fire up Activity Monitor and hit Sample on the app when you see the beach ball. It records the call frames of all threads a couple of thousand times over a few seconds, so you can see what that app is waiting for.
If the entire system has ground to a halt such that it's difficult to actually get to Activity Monitor to do the sample, then it's likely to be a memory problem. If it's just one app, it's probably something else.
If the system is hung such that you can't get Activity Monitor to sample, use command-option-control-shift-period to run sysdiagnose. Attach the resulting /var/tmp/sysdiagnose_$(TIME).tar.gz to your bug report.
And inside that tar.gz file is a spindump.txt file, which will have the samples of whatever application is spinning at the moment, just like if you used Activity Monitor to sample it.
Odd - I've been using an 8 gig mbp with swap disabled and I've yet to crash due to running out of ram. That's running a few browsers, editors, VM instances, possibly photoshop for some tweaking. Beachballs are very rare and would be due to software errors, not out of memory conditions - those would just crash.
The problem is that OS X appears to favor swapping over evicting file caches. This ends up creating a situation where no matter how much physical RAM you add to your system, you still end up seeing frequent swap-induced beach balls.
Funny you should say that. Exactly my experience. Just left a comment on Adam's blog, but let me add it here as well.
I turned off Dashboard where I had a couple of unused widgets active running in the background (used Dashboardkiller app from MacUpdate) because I haven't used any of those widgets in months. Suddenly all of my mysterious memory/paging issues on Lion disappeared. Swap and page-outs decreased significantly. Machine is running like the first fresh install. Give it a try.
I believe it actually is a separate WebKit process per widget.
Could you quantify the Dashboard memory usage? I'm using the Weather and Delivery Status widgets, and they're only using 16.7 MB and 28.9 MB. This is on Mountain Lion.
edit: most of that memory is shared, so the real memory usage is even lower.
Note: I did not shut down dashboard because of reported memory usage, nothing was obvious from activity-monitor either, ie not listed separately as a memory-hog.
However, once I did shut it down (not just remove all the widgets, I had like 10 running, but actually prevent it from starting) my machine was finally back to normal.
I'd be curious to see if anyone here who does experience the memory problems can replicate this.
Addition: since shutting it down, the reported memory usage for the kernel task has dropped a lot, does that make sense?
My dashboard has 10 widgets, two of those are web clips. I'm seeing 90MB real memory and 220MB virtual. Maybe it's not as bad as I thought. Or maybe it's just improved since 10.6.
On a new rMBP with 8GB RAM, running eclipse, iTunes, weka (ML software), kindle reader, open office, safari, preview with a half dozen pdfs open, terminal. 5.5 GB used, 0 pages out:)
Quick thing on Terminal. I noticed that I had to limit the scroll back history in Terminal or else it eats up all your everything. For example if you have a number of term windows open and they are tailing log files or have verbose running processes open. I put it at 10k or so and things are fine now.
Comments
Haven't seen the paging issues Adam was noticing, but I'm still gobsmacked by the amount of memory some applications seem to take. The OS (kernel_task, mds, WindowServer, and friends) regularly eat up .75 of a gig, and Firefox consumes .5 - 1 gig without much effort (other browsers seem to have a similar profile).
Quick poll, what are you running, and what's your memory consumption? Here's me:
Currently running: Firefox, Spotify, Mail, Calendar, Terminal, Mongo (mongo using 100mb).
Memory Used: 3.75 GB
It is definitely better overall with ML in that it is no longer ridiculously slow but memory consumption for typical set of tasks still is way higher than either of Linux and Windows.
For instance I have KDE4 running on Linux with Firefox, Amarok, Kopete, Konsole and all other default services (ssh etc). Used memory is 1.1GB.
I've ML running with Firefox, Terminal.app, Activity Monitor in addition to the defaults. Any my used memory is 3.92GB. Wired is 1.75GB and Swap used is 11MB!
My experience with Windows 7 is also lot better than ML - it tends to be bit more than Linux but in the same ballpark.
Edit: To put this in perspective - I just realized that my work laptop (that I RDP into and never reboot) with all possible bloatware loaded and running - Word, Outlook, RDP, Lync 2010, Java Backup process, Enterprisey stuff, Firefox with couple tabs etc. is taking up only 2.83 GB! Apple really has a memory usage problem with OS X.
Unused memory is wasted. You should be complaining about the system that doesn't use all available memory.
Windows and Linux don't leave unused memory around - both use it heavily for page cache. However what we have a problem here with is active/resident memory use and/or VM subsystem making no so smart decisions(this part seems to have gotten better with ML).
So the end result is that when Windows and Linux can be quite usable with 2GB RAM with a rotational disk, for similar workload OS X slows down quite a bit.
Unused memory is wasted memory. As a user, you shouldn't care about memory usage if there's plenty available.
It's far more interesting to see what happens in a low-memory situation.
Except... when apps are using a lot more memory than they do on other OS, you tend to get a low-memory situation anyway.
If I've got a 4gig machine, and running 5 apps takes up 3.8 gig, trying to run another app with necessitate swapping/paging some of the existing apps around to accommodate my new app. If those initial 5 apps only took up, say, 2.8g, I'd have less chance of hitting 'low-memory' situations in the first place.
I say this as someone with 16g mbp and SSD who still hits beach balls and unexplained pauses on a daily basis. Fewer than I used to, but it gets annoying. Not quite as annoying as win95/2k blue screens of 12+ years ago, but getting my ire up.
Beach ball is not necessarily a low memory warning (or memory related). It's showed (only) when a GUI application fails to respond to UI events. Sometimes it's because of bad threading in applications or things like that.
understood they're not always the same thing - I often see a beachball with 6gig free, which used to perplex me a bit, now it just bugs me. :/
If you're interested in seeing what's happening, fire up Activity Monitor and hit Sample on the app when you see the beach ball. It records the call frames of all threads a couple of thousand times over a few seconds, so you can see what that app is waiting for.
... and report the bug to the app's developer! Be sure to include the sample.
If the entire system has ground to a halt such that it's difficult to actually get to Activity Monitor to do the sample, then it's likely to be a memory problem. If it's just one app, it's probably something else.
If the system is hung such that you can't get Activity Monitor to sample, use command-option-control-shift-period to run sysdiagnose. Attach the resulting /var/tmp/sysdiagnose_$(TIME).tar.gz to your bug report.
And inside that tar.gz file is a spindump.txt file, which will have the samples of whatever application is spinning at the moment, just like if you used Activity Monitor to sample it.
I had never heard about it... Wonderful.
good idea - upvoted! :)
Odd - I've been using an 8 gig mbp with swap disabled and I've yet to crash due to running out of ram. That's running a few browsers, editors, VM instances, possibly photoshop for some tweaking. Beachballs are very rare and would be due to software errors, not out of memory conditions - those would just crash.
A lot of that memory is shared memory.
What's the problem with the OS and apps using as much available memory as possible?
The problem is that OS X appears to favor swapping over evicting file caches. This ends up creating a situation where no matter how much physical RAM you add to your system, you still end up seeing frequent swap-induced beach balls.
That's child's play. Open Dashboard and watch the horror.
Funny you should say that. Exactly my experience. Just left a comment on Adam's blog, but let me add it here as well.
I turned off Dashboard where I had a couple of unused widgets active running in the background (used Dashboardkiller app from MacUpdate) because I haven't used any of those widgets in months. Suddenly all of my mysterious memory/paging issues on Lion disappeared. Swap and page-outs decreased significantly. Machine is running like the first fresh install. Give it a try.
Edit: I'm running Lion 10.7.4
I've never really tried to understand Dashboard from the O/S side, but it seems like it's almost installing a separate WebKit process for each widget.
Edit: I'm on Mountain Lion, and Dashboard is still a memory hog. I just disable it now.
I believe it actually is a separate WebKit process per widget.
Could you quantify the Dashboard memory usage? I'm using the Weather and Delivery Status widgets, and they're only using 16.7 MB and 28.9 MB. This is on Mountain Lion.
edit: most of that memory is shared, so the real memory usage is even lower.
Note: I did not shut down dashboard because of reported memory usage, nothing was obvious from activity-monitor either, ie not listed separately as a memory-hog.
However, once I did shut it down (not just remove all the widgets, I had like 10 running, but actually prevent it from starting) my machine was finally back to normal.
I'd be curious to see if anyone here who does experience the memory problems can replicate this.
Addition: since shutting it down, the reported memory usage for the kernel task has dropped a lot, does that make sense?
My dashboard has 10 widgets, two of those are web clips. I'm seeing 90MB real memory and 220MB virtual. Maybe it's not as bad as I thought. Or maybe it's just improved since 10.6.
Is that Virtual Memory? Or Private / Reserved / Shared?
On a new rMBP with 8GB RAM, running eclipse, iTunes, weka (ML software), kindle reader, open office, safari, preview with a half dozen pdfs open, terminal. 5.5 GB used, 0 pages out:)
open office -> try libreoffice, it is evolving much better.
I'm running programs of similar functionality but coming in at 1.95GB.
Chrome (only 8 tabs right now), Rdio, Sparrow, Coda, Terminal, Notational Velocity.
Quick thing on Terminal. I noticed that I had to limit the scroll back history in Terminal or else it eats up all your everything. For example if you have a number of term windows open and they are tailing log files or have verbose running processes open. I put it at 10k or so and things are fine now.