Patent ID: 7530072

Claim:
A system having a processor (CPU) for preventing CPU resource exhaustion in a hosted computing environment comprising: an application server for identifying, according to a defined criteria, suspicious threads that execute program code that potentially causes said suspicious threads to hang or enter an infinite loop, said criteria being based on one of: a comparison of stack traces of previously hung threads to stack traces of other threads in said system or a determination of long running threads from a stack trace; and a thread quarantine manager for managing said identified suspicious threads, said suspicious threads being registered in said quarantine manager by said application server, and for performing: throttling said suspicious threads to lower CPU usage, assigning said suspicious threads a maximum CPU usage limit as a group, and forcing said suspicious threads to execute at lower priorities, said application server processing said suspicious threads in said thread quarantine manager according to defined parameters, said parameters comprising: an allowed maximum CPU usage limit for said suspicious threads in said thread quarantine manager and an exit criteria to allow a suspicious thread to exit said thread quarantine manager, said exit criteria determining whether said suspicious thread is hung, if said suspicious thread is not hung, said application server restoring an original priority of said suspicious thread and resuming an execution of the suspicious thread without a restriction, and otherwise, said suspicious thread resuming an execution in said thread quarantine manager in a controlled manner, wherein said application server and said thread quarantine manager are executed by said processor.