Did Yosemite fix it or break it?

Apple has released the latest release of OS X, Yosemite (10.10), to the public this week. This update to OS X is similar to last year’s iOS 7 update where a lot of visual changes have been made. Yosemite has a lot of visual changes, but there are even more changes that you can’t see. New functionality like Continuity & Handoff or Apple’s new iCloud Drive is great, but you need to be aware of subtler changes too.

One of my new favorite apps is Übersicht. I’ve talked about moving to Übersicht, but what worked on Mavericks may not work on Yosemite. One of the widgets I have running under Übersicht is a memory summary:

But after moving from Mavericks to Yosemite’s public beta, this is what I was getting:

I was perplexed on why the memory bar wasn’t working. I hadn’t physically changed my laptop by putting new/different memory. I wasn’t getting any errors or warnings about a memory problem. I ran the commands for the widget over and over again, but didn’t see any errors in the results. I did comparisons on the widgets from a back up to the one in Yosemite. I just couldn’t see where the widget had been broken from updating to Yosemite.

After some digging I found the issue wasn’t my laptop memory frying out, it was a change in the underlying command that Übersicht was using to pick up system information. The terminal command the memory bar uses to get the widget information was the same in both instances:

memory_pressure && sysctl -a | grep memsize

The problem wasn’t in the command, but the output. Yosemite had tweaked the output of the command from what was given in Mavericks.

Output on Mavericks:

jason-mbp:~ mygeekdaddy$ memory_pressure && sysctl -a | grep memsize
The system has 2147483648 (524288 pages with a page size of 4096).

Stats: 
Pages free: 2044707 
Pages purgeable: 19858 
Pages purged: 131099 

Swap I/O:
Swapins: 0 
Swapouts: 0 

Page Q counts:
Pages active: 1084310 
Pages inactive: 282182 
Pages speculative: 297787 
Pages throttled: 0 
Pages wired down: 483186 

Compressor Stats:
Pages used by compressor: 0 
Pages decompressed: 0 
Pages compressed: 0 

File I/O:
Pageins: 2719200 
Pageouts: 0 

System-wide memory free percentage: 87%
hw.memsize = 17179869184
hw.memsize: 17179869184

Output on Yosemite:

jason-mbp:~ mygeekdaddy$ memory_pressure && sysctl -a | grep memsize
The system has 2147483648 (524288 pages with a page size of 4096).

Stats: 
Pages free: 2044707 
Pages purgeable: 19858 
Pages purged: 131099 

Swap I/O:
Swapins: 0 
Swapouts: 0 

Page Q counts:
Pages active: 1084310 
Pages inactive: 282182 
Pages speculative: 297787 
Pages throttled: 0 
Pages wired down: 483186 

Compressor Stats:
Pages used by compressor: 0 
Pages decompressed: 0 
Pages compressed: 0 

File I/O:
Pageins: 2719200 
Pageouts: 0 

System-wide memory free percentage: 88%
hw.memsize: 17179869184

Look at the last two lines from each command. This is where the widget was getting the overall memory installed value.

On Mavericks: hw.memsize = 17179869184
On Yosemite: hw.memsize: 17179869184

Same number, different delimiter. Seeing the results had changed, from the same command on 10.9 verus 10.10, requried me to update the script used to generate the widget. After I updated the widget to use the correct expression to pull the memory value, the widget worked identical in Mavericks and Yosemite.

Lesson learned

Before you think Yosemite broke something, be sure it didn’t just change something.

Comments

Top