News Archive for: 9/21/2005 Wednesday's News
  Goto Current News Page
Reader notes on World Clock Widget CPU and RAM Usage Creep
(Updated twice with more comments/details)

" I've run across one you've probably seen before, but perhaps not "over analyzed" like this one...
I recently began seriously tinkering with OS X 10.4. I brought up the Dashboard on a system, with 5 active widgets. I then was out of the office a lot for a couple of weeks. When I came back, I started doing some work on the machine (which hadn't been rebooted in the meantime).
The work I was doing seemed to be going a fair amount slower than I expected it to, so I looked in Activity Monitor to see if I could understand why. Sure enough, I found the answer.

The "World Clock" widget was consuming 46.8% of the CPU and over 150MB of real RAM. Ouch!
Figuring it was a fluke, I terminated the process and let it come back up. That seemed to release the RAM and lower the CPU usage to around 8%.
An hour or so later, I checked again. Resource usage had increased. Thinking maybe the machine was out of whack, I rebooted and started the Dashboard again.
As a double-check, I brought Activity Monitor and Dashboard (with the same collection of Widgets) up on another machine that was built entirely differently and was dual-CPU instead of single-CPU. Its resource consumption started out in the 7-8% range. I left it going for a couple of hours and, sure enough, it was using more CPU and RAM also.

I wondered if resource usage would continue unabated if World Clock was left on-screen 24 hours (or as much as possible, at least). I wrote a quick shell script to take an hourly snapshot of the Dashboard Widgets' resource usage and write it to a text file. That told quite a tale, even being just a couple of hours into the test.

Right now it's about 30 hours later in this experiment. World Clock is up to 66.5% of the system's CPU, 99.42 MB of real RAM, and 241.11 MB of Virtual Memory. I am anticipating that by the time I return to the office tomorrow it will have reached near 100% of the CPU and perhaps considerably more RAM. What I want to know is if this monster can bring down the entire system.

Since you're interested in Mac performance, you might want to have a look at the article I've written, which I update as new information becomes available to me:
OS X World Clock Widget Resource Problem
In any case, keep up the good work!
-Mike S.

(I replied to Mike that I'm not a fan of widgets, OS addons, etc. (never was even in the old days before OS X) - I prefer running lean so to speak (saves resources, cpu cycles and often less problems with os updates) I've seen some Tiger installs where users went "widget crazy" and turned even fast macs into snails.-Mike)
Same here. In OS 7/8/9 days I never went in for those little cutesy utilities that changed the way your windows looked, animated your cursors, etc. All that stuff is amusing for about 10 minutes and afterward it just eats up resources.

I've been tinkering with the WorldClock.js script trying to see if I can find where that memory leak is. I'm pretty sure it has to do with the way the second-hand is drawn (and animated). If you disable the second-hand animation, initial CPU usage drops from 7-9% down to about 1.2% and stays near that for a much longer time. Unfortunately, there is still a "slow leak" memory wise, with every few ticks of the second-hand adding a few K to the RAM in use. I suspect they aren't destroying some JavaScript object when they're done with it. I just haven't found which one it is for sure yet...

(he later wrote)
I have reported it to Apple through their web site. (in reply to the reader suggestion below)
I've also combed through the code enough to think this is a garbage collection problem due to the way they wrote the code.
JavaScript apparently has a garbage collection methodology that says, in essence, "if any object that references THIS object is still in memory, I can't delete THIS object."

Based on what I can see in the source code, it looks something like this:

Function A
Call function B
Call function C

Function B
Do something

Function C
Do something
Call Function A

So what we see is that when Function B is called, the JavaScript garbage collector sees that A still has something to do, so it doesn't collect the garbage for A yet. When B is done, it goes on to C. C does its thing, then calls A to get the ball rolling again. Problem is, since C never actually terminated, that keeps the original A and B "open" in memory.

If you envision that the above functions are (in essence): Update the current time (A), Draw the Hour/minute/second hands (B), and Make the second hand wiggle (C)... You see the problem. Each second, the script is effectively forcing the JavaScript interpreter to store the last-second's state of function A, B, and C... along with the second before that, and so on. Thus, the longer this thing is up and running, the more "states" of A, B, and C it's storing. This requires more memory, which requires more CPU to manage, which (combined together) bogs down the system.

And since it's a "bogging down" that gets worse each time the second-hand moves, the effects are dramatic if you keep the application opened. If you just check it occasionally, only a few second-hand ticks are displayed and thus only a few "states" are stored.

Thus, the only people who will ever notice this will be those who leave their systems up over long periods of time (periodically checking the World Clock) or those who don't leave their systems up for long periods of time but who do leave the World Clock up a long time... "

This reminded me of a problem Matthew reported with the "blued" task/process (hogging CPU cycles per activity monitor, which also reported some hangs IIRC). It's bluetooth related and didn't appear here on the only 10.4.2 install I have, but that machine has no bluetooth adapter installed. Matt said booting from the Tiger CD and running Disk Utility (repair the disk/RP) helped but not sure if the problem will re-appear over time.
A reader suggested he send a bug report to Apple (which he later said he's done)

" This is regarding the "OS X World Clock Widget Resource Problem".
Have him run on WorldClock for a long time. Then, submit a bug report via and attach a compressed archive of the sampler output.
The sampler capture will help Apple specifically identify the issue.
--Mike "

FYI - a reader later sent a note that Apple's webkit blog noted they're recently fixed over 4000 javascript memory leaks.

Return to Accelerate Your Mac!Top
Reader feedback on iTunes 5.0.1 (radio/sharing bug fixed)
First feedback on the iTunes 5.0.1 update:

" I can confirm that the bug I reported to you (copied below) on September 8th with iTunes 5.0.0 has been fixed in 5.0.1.
- Jeff
(a copy of his past report on the bug follows)
... I have discovered a bug in both the Windows and Macintosh version of iTunes 5 (5.0.0).
If you uncheck the "Radio" check box in the General preferences pane of iTunes 5, then no shared music will show up in the Shared music section of the sidebar navigation. If you have "look for shared music" enabled only an empty folder for shared music will show up in the sidebar even if shared music is available. Toggling the check box for "Radio" in the General preferences on again will allow shared music to be seen in the sidebar and browsed again.... "

Another reader mentioned improved scrolling performance on his system:

" Just a quick impression on the new update to iTunes that was released on Tuesday. I have a G5 iMac 20" 1.8 ghz and I noticed that iTunes 5.0 made scrolling through the songs in my library using the Page Up/ Down keys more sluggish than previous iTunes releases. The 5.0.1 update seems to have fixed this little glitch. I'm not sure what else has been fixed since I only applied the update a few minutes ago. I'll pass more along if I notice anything.
Thanks, Chris "

I had 2 readers report (in Sept. 8th news and Sept 14th news) a problem with iTunes 5.0.0 not working with iPhoto to copy photos to their iPods but was not able to reproduce that problem here in a test with an iPod Nano using 10.3.9 on a PB G4 (I wasn't able to test it in on a 10.4.2 system though, if that matters). If anyone that had that problem before finds 5.0.1 fixed it let me know.

Return to Accelerate Your Mac!Top
More iMac G5 owner reports on Temperatures
I've updated the reports section of the page on iMac G5 Cooling fan mod and temperatures with another reader report on overheating from an owner of a 1.8GHz model that noted a logic board swap solved it. (May have been related to the capacitor problem mentioned earlier this year.)
Return to Accelerate Your Mac!Top
More Radeon 9600 Mac/PC Edition failure reports
(Updated) Monday's news had a reader report on an infant (early) failure of one of the new Mac/PC 9600 graphics cards. I assumed it was just a random failure (as a certain percentage of any device will fail early) but posted it to see if anyone else had seen problems with the new model. Although a MDD owner replied to that post saying he's seen no problems with it so far, I've gotten 2 reader mails that said the card didn't work out of the box:

" I have had an entirely different experience with the 9600Pro. Mine was DOA. No video from either DVI port . It also came with the 9800 documentation describing power connectors and fan. I agree the documentation is poor. (a previous owner commented on this also. AJ mentioned that some ATI cards have a manual that covers installing several card models.) Despite being an AGP card the card doesn't have the retention tab described in the documentation....BR> I attempted to contact ATI tech support and initially received a standard auto response asking me to check the card, reset the PRAM, etc, all of which I had done. Finally got an email stating to send it back to the retailer. Awaiting an RMA from OWC.
Quicksilver 2001 867, 10.4.2, 1Gig RAM, Apple DVI-ADC connector (works well with my PB ), 17" studio display.
-Jeff W.
(I asked him to double-check that the card was fully/evenly seated in the AGP slot (even a slight bit unseated can cause problems).-Mike)
I installed the card three times and attempted to obtain video. I pressed/rocked the card as hard as I thought I could safely. Pressed CUDA, zapped PRAM, reinstalled the latest ATI drivers, etc. No Joy...I'll try one more time today while I wait for an RMA. "

Another 9600 Mac/PC edition owner wrote his also didn't work out of the box:

" I also had a DOA 9600 Mac/PC edition. We tried it in both a processor-upgraded Digital Audio and a stock Quicksilver; it was dead as a doorstop.
I'm hoping the replacement works.
-Marc D."

Another MDD wrote today he's run the card since Sept. 12th without any problems, but it's unusual to get this many failure reports so soon.
I welcome other 9600 Mac/PC edition owner feedback.

Return to Accelerate Your Mac!Top
Other Net News/Software Updates
Return to Accelerate Your Mac!Top
CDRW/CD/DVD/Hard Drive/Storage Compatibility Database Update Listing
The Drive Compatibility Database had 2 new reports added. (Entries today are added the next newsday morning.) The database includes reports on CDRWs, Combo DVD-CDRW, DVD-ROM, DVD Burners, Hard Drives and Removables (tape drive, ORB, ZIP, MO drives, NAS, CF/Smartmedia readers, etc.) in all interface types (IDE, IDE RAID cards, SATA, Firewire, SCSI, USB, adapters). Current total - 15,109 reports. (searching by drive type/brand, mac model etc. listed below will show the full reports, most recent first - does not include updates to previous reports) iApps burn support mentioned in reports unless otherwise noted.

    Hard Drives:
  • IDE Hitachi Travelstar 5k100 40GB in G4 Cube (OS 9.2)
    (using notebook drive to std IDE connector adapter, with notes in the report on mods to mtg bracket)
  • IDE Seagate 160GB in iMac (OS X 10.3)
    (no native big drive support so limited to appx 128GB)

You can find full owner reports (latest shown first) by searching the database by drive/brand/interface/mac models (the latest reports are shown first in searches). For guides to installing CD/CDRW/DVD drives or Hard drives in many mac models, see the IDE Articles page. The Firewire articles page also has guides on case kits, installing drives, etc.
If you've added a IDE, SCSI, Firewire or USB hard drive, CDRW, tape drive, etc. make sure you add a report to the database. (If you post an updated entry - make sure you use the same name, etc. as you did before so I can find your past entry. Thanks.)
(Incomplete entries are deleted. Do not post questions in the database, it's for drive reports not questions on what drive to buy - for that try searching the database for reports from owners of your mac model on the drive type/brand/interface, etc. you're interested in.)

Return to Accelerate Your Mac!Top
Rate Your CPU Upgrade Reports Database Updated
The Rate Your CPU Upgrade database has been updated with 1 new report (entries later today are added the next newsday morning). Total to date: 10,069. Here's a summary of the report added (search by brand/mac model for full reports - latest reports always shown first):

  • Other Brand (FastMac) G4/466 in iMac (rated 5)

    (Full reviews of G4 and G3 upgrades compared to stock CPUs, including real world apps/game tests, install info, etc. are linked at the CPU upgrades page. OC/CPU module articles are on the Systems page.)

(Warning - Overclocking may not be reliable and could lead to hardware failure or corrupted data.) You can find the full reports by searching the database selecting the indicated Mac model and upgrade card brand/type. If you've upgraded the CPU on your Mac, please post an entry in the database. Search the database for entries from most every upgradable Mac model *before* you buy. (Searchable by mac model/upgrade brand).

Return to Accelerate Your Mac!Top
Recent Reviews and Articles:
Listing/links to recent articles and reviews you may have missed.
Return to Accelerate Your Mac!Top

(Ad/Sale Items)

= UPGRADES by Model =
Upgrades for YOUR Mac!

= Refurb Mac Pros =
(Click for Current List)

= SSDs up to 4TB =
SSDs for Most Macs!

= ThunderBolt =
Drives, Docks & More

Up to 12 TB HDD
HGST, WD, Seagate, Toshiba

= 2.5" HDs & DIY Kits =
Notebook Hard Drives and DIY drive/case kit bundles

Lifetime warranty RAM Upgrades!

Internal and External Superdrives/Blu-Ray drives

Graphics cards, Displays, Adapters, Cables & more

Interfaces, Cables, Software, Speakers, Headphones & more

Apps, Utilities, OS, VM, Games and more

WiFi and Bluetooth Devices/Adapters/More

= Repair Service =
for iPhone, iPad, Macs

= iPad/iPhone/iPod =
Accessories, Cases, Docks & More

NuGuard KX Cases
*Extreme* Drop Tested!

XLR8YourMac T-Shirts

= back to =
Copyright © 1997-2018. All Rights Reserved
All brand or product names mentioned here are properties of their respective companies.
Legal: Site Privacy and terms of use.