Live data from Hacker News

Something is deeply broken in OS X memory management

workstuff.tumblr.com

181–190 of 269 posts

Re: Something is deeply broken in OS X memory management

#181
post #46

Earlier quoted context omitted.

I have 12GB of RAM and Lion runs like crap on my iMac 2.93GHz i7. It's like the system discards pages of programs just because the app has been inactive for an hour or so. So when I come back and start the same app the f*cking rotating HD I have sounds like a birds nest for too long periods. Edit: Disabled the pager and the system now seems much more quiet regarding to disk seek noise when I start apps. Feels like a…

> It's like the system discards pages of programs just because the app has been inactive for an hour or so. From what I've read, Windows memory manager does the same thing - after a while, it swaps out unused pages, even if plenty of free memory is available. I wonder what's the logic behind this - did the engineers assume that the speedup coming from more free memory being available for disk cache is worth the hassl…

The logic is for things like daemons or infrequently used processes that wake up maybe once a day. They don't need to be in ram all the time needlessly. So swapping out their memory that hasn't been used for N hours isn't a bad thing.

And yes, the logic is sound, its better to use a bit of swap for an infrequent daemon and let 4-5 megs of memory be at the ready if needed than leave it in place all the time. The "speedup" is not a speedup for your use, its to allow for better memory management. Which is what the VM subsystem is there for. Second guessing it all the time just makes its job harder.

Swap use when there is free memory isn't a bad thing. This fetish people have with their OS using swap at times seems to border on the ridiculous side. My iMac at home has 16g of memory and 400g of swap used right now (8g active, lots of file cache that'll get purged). Most of the swapped files belong to things like my ruby+pry repl, a clojure repl I haven't touched for 2 days, and other random things I don't use often enough to warrant they stay in active ram. Why SHOULDN'T that memory be reclaimed and at the ready for a new program or some other request? Its just going to page it out then and likely take longer to do. The only time its "wrong" is when I start using those processes again, which takes all of 1-2 seconds.

Its a hard problem, and both OSX/Windows choose the best possible solution you can heuristically.

Re: Something is deeply broken in OS X memory management

#182
Anyone have any nice articles with tips on how to generally optimize OS X? Esp to better handle this paging/memory management problem that the OP is talking about.

I have a MBP with 4GB RAM and leave programs open all the time. After a few days, it feels very sluggish.

Aside from double my memory and changing my habits (i.e. shutting down every night), how do I fix this?

Re: Something is deeply broken in OS X memory management

#183

> OS X is wonderful ROFL

I guess the point of the short comment was lost: How can anyone say that any of the current crop of OS's is "wonderful"? Wonderful? Really?

Whether you use Windows or OSX (or both, as is my case) you can probably rattle off a sizable list of how these OS's have gotten screwed-up by their respective publishers. Someone saying " is wonderful" and then going on about the reason it actually isn't is very funny.

Again, the comment was OS agnostic even though the thread is about OSX.

Re: Something is deeply broken in OS X memory management

#184
post #33

I also have major memory problems. 8GB RAM total in the system and I have 4GB sitting in inactive and it's paging out? http://imgur.com/VE4GB At this point the system pretty much thrashes until I start closing apps or perform a manual `purge`

I have the same issue. This is unacceptable.

Re: Something is deeply broken in OS X memory management

#185
post #88

Earlier quoted context omitted.

Firefox 12 does this too, on both my MB Pro and iMac. I think it has to flush so many caches that disk I/O just takes forever. This is purely conjecture, though.

Not sure if it will help, but have you tried running Firefox's hidden profile manager and created a new profile? Firefox was horrible to run on OS X for me, it would drag the whole system down, but since changing to a new profile it has run like a dream and not reverted back.

Creating a new FF profile made a significant difference for me, too, when I did it recently (for the first time in a couple years). I suspect that will be true on any OS, if you do a fair amount of installing and removing extensions, user scripts, etc.

Re: Something is deeply broken in OS X memory management

#186

Earlier quoted context omitted.

The thing is, Lion runs like crap without an SSD or insane amounts of RAM for many people. It doesn't help if it works for some, or even the majority. If anything, we need more people digging in OS X internals. I am sorry to use a tired analogy here, but Vista did work great for many too. I have two Macs, one brand new, one migrated from SL, and 10.7 Safari was almost unusable on both until I installed SSDs. If that…

I upgraded to an SSD while on Leopard, and was amazed at the speed. Snow Leopard continued to impress. Lion slowed things down terribly (even with the SSD!), but I have good news: ever since Mountain Lion DP2, it's been fast again.

I've been trying to get people I know at Apple to start referring to it internally as Mountain Goat.

It's working.

Re: Something is deeply broken in OS X memory management

#187

I have an 8-way Xeon Mac Pro w/ 20GB of RAM, almost half of which is 'free' at any point during the day unless I'm doing something really out of the ordinary. Yet it still swaps to disk ALL THE TIME and a new Terminal.app window can take up to 5 seconds to open. I really don't give a shit how it's not "technically" broken - that's broken from an experience point of view. And I haven't re-installed the OS (this was an…

Yet it still swaps to disk ALL THE TIME and a new Terminal.app window can take up to 5 seconds to open. That's not swapping. That delay is /usr/bin/login searching the system logs so that it can display the date and time of your last login. Create a .hushlogin file in your home directory to prevent that.

Does this apply to iTerm as well?

Re: Something is deeply broken in OS X memory management

#189

I have an 8-way Xeon Mac Pro w/ 20GB of RAM, almost half of which is 'free' at any point during the day unless I'm doing something really out of the ordinary. Yet it still swaps to disk ALL THE TIME and a new Terminal.app window can take up to 5 seconds to open. I really don't give a shit how it's not "technically" broken - that's broken from an experience point of view. And I haven't re-installed the OS (this was an…

I disable swap on all my machines over 4gb... Windows, Linux, or OSX. There are people who will advise against this, but in 5 years I've not had any problems. I think once or twice firefox leaked uncontrollably and therefore killed.

Not sure what my settings are now, but I used to keep swap off on my Windows machine (especially while playing games, since swapping kills gaming performance).
Post reply on HN