Is there a way to receive a warning if memory is running low? Sometimes I get tab happy with Google Chrome which chews up a lot of memory and slows down the system. Is there a way to get a warning when free memory falls below a certain threshold? That way I can close some things before serious performance degradation.
You can acheive this with a combination of Growl and some shell scripting.

Growlnotify is a command line tool that can send a message to growl:

grownnotify -t "Title" -m "Message"


Wrapping some logic around this to check for CPU use or Memory use should be straightforward enough.  I'm not at a Mac right now so can't test with commands but something like the following should be possible

while true
do
sleep 60
memuse=`vmstat -some -options -to -show -current -memory -use | awk '{ print $column_that you_are_interested_in_eg_5 }'`
if [[ $memuse -gt 80 ]]
then
growlnotify -t "Memory Low" -m "Memory use is at $memuse %"
fi
done


Thew above isn't going to work, please don't copy and paste it, but it's something to go on.  You can expand the logic further easily by checking every 2 minutes, and if it's over 80% then check every 30 seconds to see if it's persistantly high and not just a spike, and if its still high after 3 checks then alert, otherwise don't etc.