• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: RAM and CPU hogging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RAM and CPU hogging


  • Subject: Re: RAM and CPU hogging
  • From: Timothy Hellum <email@hidden>
  • Date: Wed, 18 Jul 2007 11:23:30 -0400
  • Thread-topic: RAM and CPU hogging

Title: Re: RAM and CPU hogging
Ahem.  Point(s) taken.

Fortunately, I am not in the web group and could do the Matrix bend as your missile came in.  However, I will pass on your observations.  Thanks for the time taken to look into the site.

And thank you also for the iCab suggestion.  I will give it a try.

/timothy


On 18/7/07 11:08, entity "Bill Briggs" <email@hidden> expostulated:

At 8:56 AM +0100 7/18/07, Simon Forster wrote:
>On 17 Jul 2007, at 21:49, Timothy Hellum wrote:
>
>>The issue I am finding is that ARD tells me the machines are routinely running at 98% CPU and 98% RAM usage.  The problem is, the only apps running on them are the script (saved as an application), and Safari.  After a few days of running like this, they sort of seize up (wouldn't you?) and either present the beachball, time out on the Applescript, or freeze altogether.
>
>Like others, I'd bet on Safari. Try shutting down and restarting Safari after a period of time. This should free up any memory that Safari isn't releasing. Possibly the easiest way to achieve this would be to have a global counter and when it hits 720, quit Safari (delay a few seconds, then carry on with "activate, set URL...").

 You might also try a different browser. Here's your code adapted to iCab, which has a considerably smaller memory footprint than Safari.


set j to 1

on idle
global j
set lista to {"http://www.theglobeandmail.com", "http://www.reportonbusiness.com/", "http://www.globesports.com/"}
tell application "iCab"
Activate
OpenURL (item j of lista) toWindow -1
end tell
if j ≤ 2 then
set j to j + 1
else
set j to 1
end if
return 60
end idle



 It also has built-in HTML validation, so you can tell which of those sites of yours has HTML errors, supposing you want to do something about it. I just checked and there are over 100 HTML encoding errors on theglobeandmail.com. Ouch. The page source says it's HTML 4.01 Transitional, so I set that standard in iCab to check against. Since you work there, you might want to look at that.

 I just had a look at the source code for your newspaper's front page. I don't know what you do to generate that page, but it looks like a drunken monkey put it together. I saved the source in a file and numbered the lines. There are 2226 BLANK LINES in the source file *before* the code starts. Here's the chunk just before the beginning of the actual source code.


2224:  
2225:  
2226:  
2227:   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
2228:   Transitional//EN"
2229:      "http://www.w3.org/TR/html4/loose.dtd">
2230:  
2231:   <html lang="en-ca">
2232:   <head>
2233:           <title>globeandmail.com: Canada's National
2234:   Newspaper</title>
2235:  

 I was so intrigued by this that I wrote a script to count the blank lines (including ones with non-printing characters). And there's more. There are 12770 paragraphs total in the source file, and while I know processor power is cheap, the page load is slowed by the parser having to deal with all of these empty lines (mostly a bunch of useless tabs and a few blank spaces). There are ** 11,317 ** of those blank lines! Someone in your IT or Web services group needs a kick in the pants. Every globe reader's HTML parser is having to deal with tens of thousands of blank or (mostly) tab-filled lines.

 So I wrote another script to strip out the lines that were blank or had just tabs and/or spaces. Guess what. The stripped page loads in less than half the time. The original source takes 12 seconds to *finish* loading in Safari on my PowerBook and the stripped source file finishes loading in 5 seconds.

 I think you guys at the globe have some cleanup work to do. I wouldn't accept a system that turned out source files that looked like that. It's degrading your readers' experience on the site.

- web





-------------------------------
Timothy Hellum
Editorial IT Support
The Globe and Mail
http://www.theglobeandmail.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: RAM and CPU hogging (From: Bill Briggs <email@hidden>)

  • Prev by Date: Re: RAM and CPU hogging
  • Next by Date: Mail and FileMaker
  • Previous by thread: Re: RAM and CPU hogging
  • Next by thread: Re: RAM and CPU hogging
  • Index(es):
    • Date
    • Thread