Live data from Hacker News

Something is deeply broken in OS X memory management

workstuff.tumblr.com

211–220 of 269 posts

Re: Something is deeply broken in OS X memory management

#211
post #16

the OS X kernel is open source. so why aren't people reading it to figure out where this bug is?

What are you gonna do about it when you find and fix the bug? You can't run a custom kernel on OS X.

Yes you can: http://shantonu.blogspot.com http://objc.id.au/post/10101528120/compiling-the-os-x-10-7-k...

Re: Something is deeply broken in OS X memory management

#212
post #4

Not this again, we already went through this a few weeks ago. Back then, I thought the conclusion was that there is nothing broken about OS X memory management, and that with every 'fix' you come up with, you will just introduce another degenerate corner case. The same holds for any OS, trade-offs are made that may have some negative effect in some cases, to the benefit of the general cases. I don't recognize any of…

MacBook Pro, 8GB, leave it running for weeks: No performance problems at all. People say "Get and SSD", well, I've had 2 SSDs and 4 SSD failures (one drive failed three times, the other once and its replacement is still going.) So, I'm all spinning rust here. 1.5 Terabytes of rust in my Macbook Pro and the only time I have a beach ball is trying to launch Team Fortress (but I blame valve for that). I have massive, MA…

3 year old (non 'pro') macbook here, 5GB & 7200rpm drive, avg uptime is 30+days or whatever the time between service packs is. No issues at all.

Came with Leopard, upgraded to Snow Leopard (not a fresh install) and them app store upgrade to Lion

machine is snappy as, unlike my coworker who has a brand new quad core i7 w/ 256GB SSD that runs Lion like a dog. no idea why, but my humble old macbook is faster in every way than his shiny new mac mini

Re: Something is deeply broken in OS X memory management

#213
post #88

Earlier quoted context omitted.

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.

"Vacuuming" your Firefox profile's .sqlite files also helps.

Re: Something is deeply broken in OS X memory management

#214
post #25
post #11

Earlier quoted context omitted.

Cmd line syntax, for the lazy, please?

I made a bash script for it and I'll share it, hacker 2 hacker. Goes a little something like this: #!/bin/bash purge

What license are you releasing your software under?

Re: Something is deeply broken in OS X memory management

#215

Earlier quoted context omitted.

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.

Are you implying that Mountain Lion is slow?

Re: Something is deeply broken in OS X memory management

#216
post #154

Earlier quoted context omitted.

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.

> That delay is /usr/bin/login searching the system logs > so that it can display the date and time of your last login. Normally Unixes (Linux included) use a pretty efficient binary file called wtmp for that, I'm surprised if OS X doesn't. Reading the last disk block of that file would contain the last login with overwhelming probability. There has to be a lot of seeks even on a slow laptop rotating hd to get a 5 se…

OS X does: /var/run/utmpx.

Re: Something is deeply broken in OS X memory management

#217
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…

I was under the impression(from my FreeBSD years) that pages that are not used for a while is swapped out and marked as inactive. The pages are then fast to throw away for other use, or fast to brink back to active state.

In Lion I get the impression they are just swapped out and thrown away / reused for something else despite there are no real pressure on the VM.

Re: Something is deeply broken in OS X memory management

#218

Earlier quoted context omitted.

Wow, I'm really surprised this isn't default behavior. Knowing when you last logged in isn't nearly useful enough to justify the delay it so routinely causes.

It's worth it when you realize someone else has been logging on as you over the weekend.

But then you can't trust the logs.

Re: Something is deeply broken in OS X memory management

#219

The core reason that this happens is that OS X uses a memory management mechanism called Unified Buffer Cache ( http://kerneltrap.org/node/315 is the only reference I can find on this). This seems like a good idea to unify paging and disk cache memory, but it actually isn't. This means, that if you do a lot of I/O, resident pages (i.e. your programs) can actually get pushed out of memory to free up RAM for the disk c…

> This doesn't happen on NT or Linux,

No, NT and Linux also have unified VM. What BSD had pre-UVM was pretty antiquated.

Re: Something is deeply broken in OS X memory management

#220

Earlier quoted context omitted.

My issue with Lion was that it broke WiFi on my 2009 iMac. Yet the 2011 iMac is just fine with it. There has been a near constant running thread on the Apple support since the day Lion dropped. All sorts of WiFi just going out, sometimes even with the icon being nice enough to gray out. Currently at 145 pages and growing https://discussions.apple.com/thread/3191630?start=2160&... Yeah, the 2009 iMac started working t…

My late 2006 MBP had all sorts of wifi issues with 10.5 the first year or so it was out. Like routine kernel panic-bad level stuff.

AFAIK every odd-numbered version release of OS X breaks the networking on a significant number of machines.
Post reply on HN