Build health monitors into your source code


How many connections are being open over time
How many key objects are being created over time
Write frequent validators and assert when out of line

Look for a framework if one is available

Build these features into your code directly 

Of course you can also do this with aspects
or other less intrusive technologies

Coding explicitly makes you conscious

in addition to a frequent scan that alerts exceptional health conditions.

This should be especially important for web systems

Essentially look into something like SMP and see what webservers like tomcat or apache has to offer....

Or desktop systems...