Three MacOS Tips and One Vista Whimper

More

by Edward Goldstick

When Jim asked me to do this gig, he made it clear that I could touch on controversial issues but that he was principally looking for some techie/geeky/nerdy gossip or rocket science. So while I may get to the former outside of technological settings, here's a meager whiff of both at once in four parts. (Wnd with all the usual formalities that I have no financial interest in any of the companies to which I refer other than an online acquaintance with the creator of #1 as a longstanding user and customer.)

  1. Does your Mac sometimes seem to run out of memory?
  2. Help, my Vista-based Compaq laptops and/or our Belkin wireless routers is/are crazy!
  3. The best* VNC client for MacOS X when connected locally is...
  4. The best* VNC solution for MacOS X when connected remotely is...
    * With a few caveats (and bones thrown to both Apple and Microsoft...

1. Does your Mac sometimes seem to run out of memory?

I've owned a Mac since 2005, but I've been using UNIX full-time since about the thirteenth year in the Unix Epoch (about 1983). I bought myself an iBook/G4 for my 50th birthday on a whim but also because I was fed up with XP and Linux even if each got the job done in its own way.

And while my iBook/G4 is still running strong (though only with MacOS 10.5.x), I also acquired (OK, I won an online contest at MacWorld.) an Intel-based iMac around 2008 and have kept it updated with the latest OS (now Snow Leopard, 10.6.x).  I've been very happy with my Macs (other than a hardware problem in the iMac last year that is a long story in its own right), and I and have largely stopped using Windows (other than on other family computers) and only use Ubuntu-flavored Linux on my late dad's machine when at my mother's house.

But here's the thing: All of these machines had shown a strange propensity to gobble up system memory over time. I don't have any exotic apps running -- mainly just browsers, mail, word processing, videos, music, etc. -- so why does memory disappear as reflected in the Activity Monitor even if I close all these apps?

I'm not going to get into the esoterica of virtual memory, MMUs (Memory Management Units), swap space, etc. Nor am I going to sing the praises of vanilla UNIX over Linux over MacOS X over Microsoft products. Nor am I going to tell one of the many headaches that we experienced over fifteen years of running a business helping people build distributed applications that ran 24/7 for 365 days a year (and no, they don't get Feb 29 off). I hope to write about this later in a more conceptual post about software robustness.

Simply put, your machine works in a "virtual" memory space that is bigger (much bigger) than the physical memory made of silicon chips. The electronic data in the CPU has to access data in the physical memory, so when that gets filled (or even gets close to that), your system automatically moves stuff onto pieces of the hard disk called "swap" ... and stuff is moving in and out of swap all the time.

Get it?  And for now, here's a trick that readers with Macs might try if they have seen this phenomena and wonder what's up:

Open a terminal and type: echo admin_password | sudo -b -S sh -c "du -sx /"

... and it will all happen happily in background... or,

Open a terminal and type: sudo -b -S sh "du -sx /"

... and you'll just have to type in the password manually... or,

Just open a terminal as the administrator and type: du -sx /

... and wait for the result.

So, what's going on here?  Well, the "du" command is for "disk utilization"; when you run it "normally", you get back the number of bytes being used on the device (so in this case, your main disk). The options "-sx" don't really do anything except that the "x" ignores file systems that are mounted to your principal one that is at "/" (you don't need to traverse them) and the "s" is simply to give you a total only for "/", the root of your machine's main system disk.

And so all that's happening is that the "du" process is traversing all your files on your system disk to see how many bytes are actually being used by real files; however, to do this reasonably accurately, it attempts to "clean up" the file space of extraneous "inactive" blocks, though it can only do that if it is run as the administrator.

Now, system mavens might tell you that there is no difference between an "inactive" block of system memory and a "free" block ... but OK, I'm neither going to start a debate nor will I explain the way that fixed sized block of system memory are managed on the disks via a tree of inodes ... well, I'm not going to start.

Don't believe me? Here's what I just did on my iMac (on which I'm writing this...):

A) "Normal" state after about 9 hours w/Apple Mail, Safari, Chrome, Firefox and Textedit:

Thumbnail image for Picture 6.png



    

B) After quitting all these applications:

Picture 7.png



   


C) After running "du -sx /":

Picture 8.png



Yes, I only have 2 GB in this iMac ... and as we say in French, "et alors?"  (or "so what?" with a sneer). This problem is classic, it will creep up on you even if you have 8 GB in your machine, it is not specific to MacOS X, though that's what I'm familiar with here and I have not found a better solution yet.

As an aside, I do not remember when or where I discovered this trick because I certainly did not invent it all by my lonesome; on the contrary, I found it in an afternoon when I discovered that a nightly reboot no longer did the job. So thanks to the forgotten forum with its phantom freebies that get the job done!

It's perfectly true that the improvement in performance is often marginal; put another way, your machine will continue to run just fine when you have more or less exhausted the "free" memory because it will "swap" memory in-and-out of the hard disk as your applications progress -- but the reality is that over time this will become increasingly cumbersome.

It is also true that you can simply reboot your machine to get the same effect; on the other hand, you do not actually need to quit all processes to recover some of the inactive memory, but it works better that way (for me, at least).

Have at it. And while I'm 99.999% confident you cannot hurt anything by following this procedure at any moment, especially if you quit all non-system programs, I guarantee nothing (because someone, somewhere, will find a way ... or think they have).

P.S.: This procedure is particularly "useful" on older machines like my iBook/G4 that take forever to restart. I was not sure it was worthwhile to post until Mr. Fallows indicated to me that he has seen similar issues on his high-falutin' new MacBooks, but I don't know if he ever tried it and so look forward to his feedback someday.

Presented by

James Fallows is a national correspondent for The Atlantic and has written for the magazine since the late 1970s. He has reported extensively from outside the United States and once worked as President Carter's chief speechwriter. His latest book is China Airborne. More

James Fallows is based in Washington as a national correspondent for The Atlantic. He has worked for the magazine for nearly 30 years and in that time has also lived in Seattle, Berkeley, Austin, Tokyo, Kuala Lumpur, Shanghai, and Beijing. He was raised in Redlands, California, received his undergraduate degree in American history and literature from Harvard, and received a graduate degree in economics from Oxford as a Rhodes scholar. In addition to working for The Atlantic, he has spent two years as chief White House speechwriter for Jimmy Carter, two years as the editor of US News & World Report, and six months as a program designer at Microsoft. He is an instrument-rated private pilot. He is also now the chair in U.S. media at the U.S. Studies Centre at the University of Sydney, in Australia.

Fallows has been a finalist for the National Magazine Award five times and has won once; he has also won the American Book Award for nonfiction and a N.Y. Emmy award for the documentary series Doing Business in China. He was the founding chairman of the New America Foundation. His recent books Blind Into Baghdad (2006) and Postcards From Tomorrow Square (2009) are based on his writings for The Atlantic. His latest book is China Airborne. He is married to Deborah Fallows, author of the recent book Dreaming in Chinese. They have two married sons.

Fallows welcomes and frequently quotes from reader mail sent via the "Email" button below. Unless you specify otherwise, we consider any incoming mail available for possible quotation -- but not with the sender's real name unless you explicitly state that it may be used. If you are wondering why Fallows does not use a "Comments" field below his posts, please see previous explanations here and here.
Get Today's Top Stories in Your Inbox (preview)

An Eerie Tour of Chernobyl's Wasteland

"Do not touch the water. There is nothing more irradiated than the water itself."


Video

Is Technology Making Us Better Storytellers?

The minds behind House of Cards and The Moth weigh in.

Video

A Short Film That Skewers Hollywood

A studio executive concocts an animated blockbuster. Who cares about the story?

Video

In Online Dating, Everyone's a Little Bit Racist

The co-founder of OKCupid shares findings from his analysis of millions of users' data.

Video

What Is a Sandwich?

We're overthinking sandwiches, so you don't have to.

Video

Let's Talk About Not Smoking

Why does smoking maintain its allure? James Hamblin seeks the wisdom of a cool person.

Writers

Up
Down

More in Technology

From This Author

Just In