A method and apparatus for managing software processes to improve their
stability. Each instance of a software process periodically reports its
operating status to a recycler. The status information identifies how
long the instance has been continuously executing and how many
transactions the instance has executed during that time. If either value
exceeds a threshold associated with the process or that specific instance
of the process, the instance is instructed to recycle. If instructed to
recycle, the instance may stop accepting new transactions, finish
handling its current transactions, then restart and resume normal
operation. The recycler may postpone or cancel a recycle instruction if
the combined capacity of all active instances of the process is below, or
may fall below, a minimum desired capacity for the process. The recycler
may also recycle itself.