Saturday, January 21, 2012

OS X Lion on an older, early 2008, black, 13 inch, MacBook, and Performance Issues Solved

I have recently been fighting with OS X Lion regarding performance on my older, early 2008, black, 13 inch MacBook (2.4GHz Intel Core 2 Duo, 4G RAM upgraded from the stock 2G, and a 500G WD Scorpio Black 7200 RPM drive upgraded from the stock 256G 5400 RPM drive.).  The only change was the upgrade to Lion.  Here is what I have observed:

  1. Using Menu Meters and the system's Activity Monitor, I have observed performance, and computer behaviour correlated with application usage.  Typically I run quite a few applications constantly: Mail, iCal, Address Book, Adium, Evernote, Synergy, Skype, Fastscripts, SizeUp, Time Machine, OmniFocus, Dreamweaver or Photoshop, iTunes and BBEdit.  I should also note that I typically run a 25" Asus monitor as well as the MacBook's internal monitor.
  2. After upgrading to Lion my computer started to have a number of performance issues.  Most annoying was a frequent, several second pause.  The entire computer would appear to freeze for a number of seconds.  Not an hesitation, but a full-blown pause.
  3. When I had the large monitor disconnected, and was just running the internal monitor, these pauses were almost non-existent.
  4. The fans would come on much more frequently than usual.  Prior to Lion, my fans would come come on only when Time Machine ran to sync with my constantly connected (by Firewire) 1TB WD Green in a NexStar single drive dock.
  5. I did a lot of research on the Web, and found a number of interesting, related, and useful links.  Some of the topics which were useful included Apple's 'Mingler' process, Safari's 'Safari Web Content' process, OS X swap file usage, older Macs unofficial RAM capacities, onboard vs dedicated video RAM, the 'purge' command, and OS X performance issues in general.
  6. Using menumeters I observed that my system pauses were related to physical RAM usage.  When the RAM meter hit the 'full' mark, my system paused.
  7. Using menumeteres I observed that my fans came on when my CPU usage climbed.  This CPU usage did not cause a pause or hesitation.  Just the fans came on.
Here is the answer:  Some of the changes in Lion are specifically suited to the new Mac hardware architecture.  If you look at the Activity Monitor's System Memory display, show All Processes, and sort by Real Memory, you will see that certain things always float to the top:  mds, WindowServer, and kernel_task are processes belonging to the system, and you probably don't want to screw with them.  Application-related processes you'll see near the top all the time are Mail, Safari, and Safari Web Service. That's it, and there you are!  It's an old Windows problem.  When the OS is swapping to the hard drive, that is, physical RAM is being exchanged with virtual RAM (data on the hard drive), the system comes to a halt until physical RAM is freed up.

This problem is also related to video usage, by the way.  Mac's in the Pro line - those with NVidea video chipsets, and dedicated video RAM, do not suffer from this problem to the same degree.  Those with the onboard Intel video sub-systems, which share RAM with the other processes on the system, don't have enough physical RAM to handle the massive RAM, and video RAM usage of Lion, so they swap to virtual RAM on the hard drive, which is really, really slow in computer time, so that's why there's a hesitation.

Here is the solution:  More RAM (or fewer processes, and smaller screens).  After a bucket of research, I found this 4G stick at OWC, which, according to their chart, and other information (some of it from Apple), is unofficially supported in my early 2008 model alongside a 2G stick.  In other words, I got my little black MacBook up to 6G of RAM, and that solves the problem most of the time.  If things get sloppy, I restart Mail, and Safari.  If they get really horrible, I shut down Mail, and Safari, and run 'purge'.

Caveat: If you want to go this route, check that your Mac will take the extra RAM (You need 6G for Lion to be happy on a busy box like mine.), and make sure you understand what the 'purge' command does before you use it.

Note: I also tried Geek Tools instead of menumeters, but it seems to have a larger footprint in memory.

Sunday, March 15, 2009

XCode ERB file highlighting

Ok...  I've been trying to use XCode 3.1.2 to edit Ruby on Rails projects, and choking every time I load up an ERB file.  XCode just doesn't recognize the syntax.  I have, in numerous sessions, searched for the correct solution, and then, this morning, while thinking, I had a brainwave!  Follow this:

  • OS X 10.5/Leopard comes with Ruby on Rails 1.8.5
  • RoR 1.8.5 uses the RHTML file extension
  • I made a RHTML file, and there you go!  It works in XCode
  • I searched through the OS X libraries for the reference, and found it
Here's the answer:
  1. Open this file in a text editor:/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/Resources/Standard file types.pbfilespec
  2. Search for rhtml, and you'll find this line:  Extensions = (shtml, jsp, rhtml);
  3. Change it to this: Extensions = (shtml, jsp, rhtml, erb);
In other words, add the ERB file extension to the list of files the developer tools recognize as Embedded Ruby Code.  XCode should now highlight ERB files correctly.

Why didn't one of the Apple developers post this months ago?

Monday, February 04, 2008

Moleskine Pen Holder

I've been pondering for a while how to add a pen holder to my Moleskine plain page Reporter notebook. I had a vague idea of the approach I wanted to use, so I was half-way there. Yesterday I got the urge to do a search, and found a lot of entries - to my surprise - but they all miss the mark. I want a simple design, non-destructive, with a minimal impact to the book itself, and with zero impact to the size of the book. After all, what's the point of getting a small book to put in your pocket, and then adding bulk to it. Let's face it, even the Reporters aren't that small. Anyway...

If you don't want to measure this out manually, I recommend laying it out using OpenOffice, and exporting as a PDF. Point of that is Acrobat Reader will let you print at 100% scale, and the excess is just trimmed. OO doesn't seem to scale that well.

Instructions:

  1. Cut the above shape out of some stiff paper, or thin card
  2. Tuck the big tab into the pocket on the inside of the back cover of the Moleskine
  3. Fold the horizontal strip round between the back of the card and the back cover
  4. Insert your favourite pen close to the Moleskine, and pull the tab until the pen is held snugly
  5. If desired, trim the excess from the opposite side of the Moleskine
The pressure of the closed book should keep the pen loop in place. If you like, you can glue the loop in place, but then you can't use a different size pen so easily.

QED - Non-destructive, simple, zero impact on size!
(If you put the book, and the pen in your pocket it's the same size with, or without the pen holder, less the thickness of the card you use. I call that zero size difference ;-)


Note: I find no way to attach a PDF image, or arbitrary file to a Blogger post.

Saturday, September 08, 2007

TabletBlog.com by ThoughtFix: DVD to Internet Tablet in Two Steps

TabletBlog.com by ThoughtFix: DVD to Internet Tablet in Two Steps

A step-by-step guide to ripping a DVD for use on your Nokia N800 Internet Tablet.

I assume this also works for the N770, and will work for the N810. In fact, this should be a good guide to getting video reduced for any small-screen device.

The comments about the audio are interesting. Most N800 users seem to prefer the MPlayer application to the default application, but the N800 setting on Handbrake uses an audio encoding supported by the built-in player. You an change it for MPlayer, but why bother.

Personally I've reduced a DVD to 300M with only minor visual artifacts. The big space hog is the audio, but reducing it too much makes the movie worse than a few visual deficiencies.

Monday, December 04, 2006

Productivity Principles - What is it, why do I care, and how do I get some?

This will be the first in a series of articles about productivity, incorporating what I've learned in thirty years of business experience.

Firstly I believe it's important we understand that what most people call Productivity with a capital 'P' is really time management, and time management has been written about and taught in a formal way for a long time.

I believe there are only two keys to productivity: Organization, and motivation... and you can almost compensate for one with the other: Motivation, for most people, consists of getting a raise, or promotion, or generally making more money, but it may be reducing stress, saving time, or, as David Allen of Getting Things Done fame puts it, 'clearing your psychic horizon.' So... What I'm saying is that most people already have some motivation to be better organized. What they lack is organization, and organization, or rather time management, and the associated tools and methods, is what this is all about.

Now that we're down to the nitty gritty talking about tools and methods of organization, here is the single key fact: You need a method of some kind! That's it. That's the only thing. The method you choose will usually dictate the tool(s), or at least narrow down the choice. You should try different methods until you find one that works for you, or until you learn enough to cobble together something that works for you.

I read recently that it takes three weeks to establish a new habit, so after you learn a new technique, you must then allow at least three weeks to see how it's working for you. I also read recently that keeping your brain active is the key to long life, and extended sanity, and the key to keeping your brain active is learning new things, so embrace it. Learn something new.

Next time I plan to talk about some specific methods, their attendant tools, and the various merits thereof.

Wednesday, November 29, 2006

Web Site Test Box

I spent the last few days organizing my home office. I have five computers in there, not counting this laptop, which goes back and forth. There's a Windows XP box, which is primarily for graphics-intensive stuff, an old IBM Netvista for my Linux workstation sandbox, a 700MHz Dell I'm preparing for use at the deaf computer club in my son's high school, a dinky old iMac DV slot loader (G3 450MHz), and my old Linux test server, which has been the trouble maker. Turns out the hard drive, and the floppy drive went South at the same time. That was a fiddle to figure out. Who expects the floppy drive to fail these days? Once I ascertained it wasn't the motherboard, but the floppy drive, I was able to get in and fix the hard drive problems - the boot sector was corrupt, and some strange intermittent problem is causing the arm to bang against the stop. It doesn't do it all the time, so it passes all the hard drive tests I can throw at it. Now I'm just replacing it, and that's what this is about.

Problem: Replace old hard drive with smaller hard drive I had on the shelf.
NOTE: While the drive was smaller, 13Gig vs 8Gig, the data was not too big for the new drive. Basically it's a multihomed Debian Web server answering several non-routable IP's, and host names that I use for testing, and demonstrating client's projects. I'm about to need this for a moderately involved Drupal project.

First Approach: Clone the old hard drive using Linux tools
NOTE: Here I was trying different things, and ran across an interesting project at Sourceforge called Ghost for Linux, or G4L, that attempts to duplicate Symantec's Ghost functionality with GPL tools. It's a very interesting project, which does what it says, but there's one feature left to implement - cloning from a larger drive to a smaller one. Symantec Ghost will clone to a smaller drive correctly, resizing as it goes.

Second Approach: Recreate an appropriate structure on the new hard drive, and just copy the files across from the old one. This is boring, very slow, and I have to manually reinstall Grub, but it will work, and it's a no-brainer.

Friday, November 24, 2006

Mostly Housekeeping

Hmmm... Didn't really add anything so far today, but rather just worked on the template (if you like it, just ask, and you can have it), added some links, and fiddled with some wording.