Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Mozilla

Journal Saint Aardvark's Journal: Why is the system load 200? 1

Here's a fun game: create a large (>1GB) file in your home directory called core and start Firefox. Have a look at this part of run-mozilla.sh:

if [ -x "$crc_prog" ]
then
DEBUG_CORE_FILES=1
fi
if [ "$DEBUG_CORE_FILES" ]
then
crc_old=
if [ -f core ]
then
crc_old=`$crc_prog core | awk '{print $1;}' `
fi
fi
##
## Run the program
##
"$prog" ${1+"$@"}
exitcode=$?
if [ "$DEBUG_CORE_FILES" ]
then
if [ -f core ]
then
crc_new=`$crc_prog core | awk '{print $1;}' `
fi
fi
if [ "$crc_old" != "$crc_new" ]
then
printf "\n\nOh no! %s just dumped a core file.\n\n" $prog
printf "Do you want to debug this ? "
printf "You need a lot of memory for this, so watch out ? [y/n] "

Care to guess what'll happen? That's right: Firefox will take 10 seconds to start up because it's busy md5summing a big-ass core file. The user will think that it hasn't launched at all and will click again. Rinse and repeat, with more and more clicking every time. By the time I figured out what was going wrong, the system load was about 200. Fortunately, it's a simple thing to add DEBUG_CORE_FILES= judiciously (not DEBUG_CORE_FILES=0; I keep forgetting that a simple [ $FOO ] simply tests whether $FOO is empty, not whether it's non-zero).

Also: the advantage to being in a small shop is that if you're the only one running Linux on the desktop, you can just go ahead and add things like the latest version of Firefox (now without the amusing bug that makes a search work on some other random tab, instead of the one you're looking at) and the MySQL DBD connector for Perl. It's really incredible how much irritation those two things are gonna save me.

Finally: this is just plain cool. As he did during the Bash scripting BOF, Wout takes me to school. Didn't know about: ssh -t, COLUMNS/LINES environment variables, tput, or just how much Applescript can do.

This discussion has been archived. No new comments can be posted.

Why is the system load 200?

Comments Filter:
  • THANK YOU for mentioning that. I just looked at the man page to see what ssh -t does, and it'll fix a long standing bug in one of our processes :-)

"Gravitation cannot be held responsible for people falling in love." -- Albert Einstein

Working...