Re: RAM and CPU hogging
Re: RAM and CPU hogging
- Subject: Re: RAM and CPU hogging
- From: Timothy Hellum <email@hidden>
- Date: Thu, 19 Jul 2007 18:31:11 -0400
- Thread-topic: RAM and CPU hogging
Title: Re: RAM and CPU hogging
OK.
I have three scripts running on a single test machine:
FIREFOX script
set j to 2
set k to false
tell application "Firefox"
activate
Get URL ("http://www.theglobeandmail.com")
end tell
on idle
global j
global k
set lista to {"http://www.theglobeandmail.com", ¬
"http://www.reportonbusiness.com/", "http://www.globesports.com/"}
set n to count lista
if k then tell application "System Events"
set the frontmost of process "Firefox" to true
tell process "Firefox" to keystroke "w" using command down
end tell
set k to true
tell application "Firefox"
activate
Get URL (contents of item j of lista)
end tell
set j to (j mod n) + 1
return 60
end idle
----------------------------------------------------------------------------------------------
ICAB script
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
----------------------------------------------------------------------------------------------
SAFARI script
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 "Safari"
activate
set URL of front document to item j of lista
end tell
if j ≤ 2 then
set j to j + 1
else
set j to 1
end if
return 60
end idle
----------------------------------------------------------------------------------------------
I am running Top -c a -o cpu in terminal and have been monitoring for 30 minutes now. Here is what I see in Terminal:
Processes: 82 total, 2 running, 80 sleeping... 303 threads
Load Avg: 2.03, 1.24, 1.00 CPU usage: 10.0% user, 4.8% sys, 85.2% idle
Networks: 16673 ipkts/10931K 13743 opkts /1925K
Disks: 1283 reads/10288K 9133 writes/174607K
VM: 318 pageins 0 pageouts
PID COMMAND %CPU TIME FAULTS PAGEINS COW_FAULTS MSGS_SENT MSGS_R
780 iCab 21.4% 2:48.85 83163 0 847 145282 99815
784 firefox-bi 16.7% 2:11.98 37933 3 33 219305 35161
802 Safari 7.9% 1:02.13 48321 5 92 90086 58060
64 WindowServ 4.3% 0:34.14 588985 5 986 832360 615109
233 Microsoft 2.3% 0:18.74 67437 0 849 235885 143829
0 kernel_tas 2.1% 0:17.02 132 0 0 2008563 183922
1043 Top 1.2% 0:09.98 522714 0 0 1007402 100429
238 Nikon View 0.4% 0:03.44 8662 0 847 39299 24074
1037 Terminal 0.3% 0:02.41 3133 1 7 8108 6165
223 SystemUISe 0.2% 0:02.03 5464 0 93 10327 7835
151 mds 0.2% 0:01.95 17708 0 0 11067 7729
1046 TextEdit 0.1% 0:01.37 3219 1 216 4482 3413
227 UniversalA 0.1% 0:01.13 5253 0 0 21348 19153
243 Microsoft 0.1% 0:00.98 1723 0 547 21111 18275
1019 AppleVNCSe 0.1% 0:00.89 4589 0 0 18426 16998
49 update 0.1% 0:00.81 2436 0 0 4424 4020
1018 ARDAgent 0.1% 0:00.78 760 0 6 1683 649
----------------------------------------------------------------------------------------------
The foregoing suggests to me that Safari is actually taking up the least amount of CPU, with Firefox taking the lead here.
No matter what, I will put one of the three installs in Editorial on the Firefox script (it loads the images much, much faster than iCab) and see how it goes.
Thanks again for all the input.
/timothy
On 18/7/07 14:58, entity "Emmanuel" <email@hidden> expostulated:
At 4:49 PM -0400 7/17/07, Timothy Hellum wrote:
>Good afternoon,
>
>Through the generous assistance of folks on this list I am using an
>Applescript to get Safari to run and then sequentially load three
>websites at 1 minute intervals.
>
>This is working well, with an exception.[...]
In addition to the replies you already got. You have two problems,
not one. 98% RAM is one problem, and that's Safari's problem, it's a
RAM eater and there is little you can do to prevent the problem
except relaunching it from time to time. And, as has been said, there
are other browsers which are just as bad. 98% CPU is another problem,
which depends strongly on the site the browser is logged into. In my
experience 98% CPU may come from an ambitious Flash animation or
program. I have visited sites which look normal but which require 40%
of the CPU for them only. Open three pages and your G4 is down. Here,
too, there is little you can do except (maybe) checking you've
installed the latest version of the plugin.
Good luck,
Emmanuel
-------------------------------
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