Patent ID: 6938254

Claim:
A method of controlling memory usage in a computer system having limited physical memory, wherein one or more application programs execute in conjunction with an operating system, the method comprising: at a first memory usage threshold, requesting at least one of the application programs to limit its use of memory; at a second memory usage threshold that is more critical than the first memory usage threshold, requesting at least one of the application programs to close itself; at a third memory usage threshold that is more critical than the first and second memory usage thresholds, terminating at least one of the application programs without allowing its further execution; and reclaiming unused stack memory and discarding read-only memory before requesting at least one of the application programs to close itself and before terminating at least one of the application programs, further comprising: before performing the requesting that at least one of the application programs close itself, prompting a user to select one of the application programs to be closed; and before performing the terminating, prompting the user to select one of the application programs to be terminated.