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:
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
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.
If looks like @stuffe's answer does exactly what you ask, but if you don't want to get into scripting I have an alternative for you.
iStat Menus allows you to monitor many different system activities such as CPU Usage, hard drive space, network speed, temperature and memory usage. While it does not notify you, it stays up in your menu bar so you can tell when it's getting full just by a glance. You can also click on it and see what all is taking up the most memory: