Application lifetime management

In a computing device running multiple applications, a check is made as to whether a threshold value of multiple threshold values has been met. Each of the multiple threshold values is associated with a characteristic of one of the multiple applications or a characteristic of a resource of the computing device. If the threshold value has not been met, then the multiple applications are allowed to continue running on the computing device. However, if the threshold value has been met, then one or more of the multiple applications to shut down is selected based at least in part on the characteristic associated with the threshold value that has been met, and the selected application is shut down.

BACKGROUND

Computing devices can run multiple applications concurrently. As the number of applications running concurrently increases, the usage of various computing device resources (such as processors, memory, etc.) can also increase. These applications can continue to use the computing device resources even if the applications are not being actively used by a user of the computing device. This can be problematic because the usage of the computing device resources by the multiple concurrently running applications can degrade the performance of the computing device, which can lead to frustrating and unpleasant user experiences.

SUMMARY

In accordance with one or more aspects, in a computing device running multiple applications, a check is made as to whether a threshold value of multiple threshold values has been met. Each of the multiple threshold values is associated with a characteristic of one of the multiple applications or a characteristic of a resource of the computing device. If the threshold value has not been met, then the multiple applications are allowed to continue running on the computing device. However, if the threshold value has been met, then one or more of the multiple applications to shut down is selected based at least in part on the characteristic associated with the threshold value that has been met, and the selected application is shut down.

In accordance with one or more aspects, a list of background applications running on the computing device is generated. The list of background applications is prioritized based at least in part on usage of a resource of the computing device by the background applications on the list. An application on the list of background applications is selected, and the selected application is shut down.

DETAILED DESCRIPTION

Application lifetime management is discussed herein. Various characteristics of applications and/or computing device resources are monitored, such as application age, processor usage, memory usage, and so forth. Each of these monitored characteristics has an associated threshold value, and if at least one of the threshold values is met then one or more applications are selected to be automatically shut down. The one or more applications that are selected to be automatically shut down are based at least in part on the threshold value that was met and the characteristic associated with that threshold value.

FIG. 1illustrates an example computing device100implementing the application lifetime management in accordance with one or more embodiments. Computing device100can be a variety of different types of devices. For example, computing device100can be a desktop computer, a netbook or laptop computer, a notepad or tablet computer, a mobile station, an entertainment appliance, a set-top box communicatively coupled to a display device, a television, a cellular or other wireless phone, a game console, an automotive computer, and so forth. Thus, computing device100may range from a full resource device with substantial memory and processor resources (e.g., personal computers, game consoles) to a low-resource device with limited memory and/or processing resources (e.g., traditional set-top boxes, hand-held game consoles).

Computing device100is powered by one or more power sources. These power sources can be an external power source or plug-in power supply, and when operating under power from such a power source computing device100is referred to as operating as a plugged-in system or device. These power sources can also be an internal power source such as a battery, and when operating under power from such a power source computing device100is referred to as operating as an on-battery system or device. Many types of devices can be plugged-in systems or on-battery systems at different times, depending on the power source that the device is operating under at any particular time. Other types of devices, however, can be only plugged-in systems (having no internal power source) or only on-battery systems (using no external power source).

Computing device100includes an operating system102and one or more applications104. During operation, operating system102and applications104run on computing device100, with operating system102managing applications104. The management of applications104includes automatically shutting down one or more applications104, as discussed in more detail below. The lifetime or life of an application104refers to the time period when the application is running, beginning when the application begins running and ending when the application is shut down.

Operating system102includes a system information collection module106and an application lifetime management module108. Although system information collection module106and application lifetime management module108are illustrated as being part of operating system102, alternatively one or both of module106and module108can be implemented separately from operating system102.

System information collection module106collects various information regarding characteristics of applications104and/or the resources of computing device100. The information regarding characteristics of applications104includes, for example, the age of each application104. The age of an application104refers to how long ago (e.g., in terms of minutes, hours, days, etc.) the application104was last in the foreground. An application is in the foreground when it is being displayed or otherwise presented via a user interface of the computing device. Applications that have been minimized (and optionally applications having their display windows covered by the display windows of other applications) are not in the foreground, and are referred to as background applications. The information regarding characteristics of applications104can also include other properties of applications104, such as a count of how many applications104are running on computing device100.

Resources of computing device100include hardware and/or software resources of computing device100, such as processors and/or processor cores, memory, network connections, and so forth. The information regarding characteristics of resources of computing device100includes, for example, information regarding the usage of resources of computing device100, information describing properties of resources of computing device100, and so forth. For example, characteristics of resources of computing device100can include how much of the processor (or a processor core) of computing device100is being used by all applications104combined, how much of each processor (or each processor core) of computing device100is being used by each individual application104, an average lifetime of memory pages on a standby list, a type of network connection (e.g., whether a particular network connection is a cellular wireless connection, a wireless local area network (e.g., Wi-Fi) connection, etc.), and so forth.

Application lifetime management module108includes an application information tracking module112, a trigger module114, an application selection module116, and a shutdown module118. Application information tracking module112receives information regarding characteristics of applications104and/or the resources of computing device100from system information collection module106. Trigger module114monitors the information received by application information tracking module112and determines when a threshold value associated with a particular characteristic of an application104and/or a resource of computing device100has been met. When a threshold value associated with a particular characteristic of application104and/or a resource of computing device100has been met, application selection module116selects one or more of applications104to shut down. Shutdown module118manages shutting down of the one or more applications selected by application selection module116. Shutdown module108automatically shuts down the one or more applications selected by application selection module116—user input or confirmation of the application to shut down need not be received for shutdown module108to shut down the selected one or more applications.

Application information tracking module112maintains information regarding various characteristics of applications104and/or the resources of computing device100from system information collection module106. Application information tracking module112can request this information at regular or irregular intervals (e.g., every five seconds) from system information collection module106, or alternatively can receive this information from module106in other manners (e.g., module112can register with module106to receive messages or other updates with the information).

In one or more embodiments, the information maintained by application information tracking module112includes the age of each application104, processor (Central Processing Unit or CPU) core usage for each processor core in computing device100, memory usage, storage device (e.g., hard disk) usage for each storage device in computing device100, and network connection usage for each network connection used by computing device100. The processor core usage is, for example, a combined usage of the processor core capacity (e.g., as a percentage of the full processor core capacity) by all applications104, and/or the individual usage of the processor capacity (e.g., as a percentage of the full processor core capacity) by each application104. Such processor core usage (whether combined applications or individual applications) can be determined, for example, by averaging the usage at particular intervals (e.g., every five seconds) over a particular number of intervals (e.g., 12 intervals).

The memory usage is, for example, a combined usage of the memory by all applications104, and/or the individual usage of the memory by each application104. Such memory usage (whether combined applications or individual applications) can be determined, for example, by determining the average lifetime of memory pages (e.g., over a particular time period, such as the previous minute, the life of the application, and so forth) on a standby list maintained by a memory manager of operating system102. Such memory usage can also be determined in different manners, such as by determining an average number of memory pages (e.g., over a particular time period, such as the previous minute, the life of the application, and so forth) in a working set of memory pages for the application.

The storage device usage is, for example, a combined usage of the storage device by all applications104, and/or the individual usage of the storage device by each application104. The storage device usage (whether combined applications or individual applications) can be determined, for example, by averaging the frequency of accesses to the storage device (e.g. over a particular time period, such as the previous minute, the life of the application, and so forth). Such storage device usage can also be determined in different manners, such as by determining an amount of data transferred to and/or from the storage device (e.g. over a particular time period, such as the previous minute, the life of the application, and so forth).

The network connection usage is, for example, a combined usage of the network connection by all applications104, and/or the individual usage of the network connection by each application104. The network connection usage (whether combined applications or individual applications) can be determined, for example, by determining an average frequency of data being communicated (sent or received) over the network connection (e.g. over a particular time period, such as the previous minute, the life of the application, and so forth). Such network connection usage can also be determined in different manners, such as by determining an average amount of data being communicated (sent or received) over the network connection (e.g. over a particular time period, such as the previous minute, the life of the application, and so forth).

Trigger module114uses the information maintained by application information tracking module112to determine when a threshold value associated with a particular characteristic of an application104and/or a resource of computing device100has been met. In one or more embodiments, each characteristic for which information is maintained by application information tracking module112has its own associated threshold value (although it should be noted that multiple such threshold values can be the same value). The threshold values used by trigger module114can be pre-configured in trigger module114, or alternatively can be provided to or otherwise obtained by trigger module114from another component or module (of computing device100or another device).

In one or more embodiments, a threshold value is met if the associated characteristic has a value that equals or exceeds the threshold value. In other embodiments, a threshold value can be met in other manners, such as if the associated characteristic has a value that exceeds the threshold value.

The threshold values can be set in a variety of different manners, and in one or more embodiments are set so as to maintain a high degree of system responsiveness as well as a long battery life. By shutting down certain applications when certain characteristics meet certain threshold values, application lifetime management module108attempts to maintain a high degree of system responsiveness as well as a long battery life. The particular threshold values can be set, for example, based on empirical analysis of the operation of different devices.

Table I includes examples of threshold values that can be used for particular characteristics of an application104and/or resource of computing device100. It is to be appreciated that the examples included in Table I are examples, and that other threshold values and/or other characteristics can alternatively be used. Table I illustrates examples of threshold values associated with particular characteristics for plugged-in systems.

TABLE ICharacteristicThreshold ValueApplication age3 hours (since the application was last in the foreground)Processor usage75% (combined usage of the processor core capacity byall applications) for over 20 seconds; and/or25% (usage of the processor core capacity by a singleapplication) for over 20 secondsMemory usageRapid churn/paging every 300 seconds (average lifetimeof memory pages on the standby list maintained by thememory manager)Disk usage75% (disk utilization by all processor cores on any singledisk in the system) for over 20 seconds

Table II includes additional examples of threshold values that can be used for particular characteristics of an application104and/or resource of computing device100. It is to be appreciated that the examples included in Table II are examples, and that other threshold values and/or other characteristics can alternatively be used. Table II illustrates examples of threshold values associated with particular characteristics for on-battery systems.

TABLE IICharacteristicThreshold ValueApplication age3 hours (since the application was last in theforeground)Processor usage75% (combined usage of the processor core capacityby all applications) for over 5 seconds; and/orgreater than 50% in intervals (record per-applicationprocessor core usage every 5 seconds in a rollinghistory of 12 intervals; trigger if utilization isnon-zero in more than 50% of the intervals)Memory usageRapid churn/paging every 300 seconds (averagelifetime of memory pages on the standby listmaintained by the memory manager)Periodic disk usageNon-zero activity in consecutive intervals (for eachapplication, disk utilization is recorded in 5 minuteintervals)Periodic NetworkNon-zero activity in consecutive intervals (for eachusageapplication, network utilization is recorded in5 minute intervals)

Application selection module116, in response to trigger module114determining that a threshold value has been met, selects one or more of applications104to shut down. This selection is based at least in part on the characteristic associated with the particular threshold value that was exceeded, and thus is also based at least in part on the particular threshold value that was exceeded. Application selection module116selects one or more of applications104to shut down when at least one threshold value is met. For example, application selection module116selects one or more of applications104to shut down if the threshold value for one resource (e.g., processor usage, memory usage, etc.) is met.

In one or more embodiments, application selection module116selects an application104to be shut down, and provides an indication of the selected application104to shutdown module118. Shutdown module118shuts down the selected application104in any of a variety of different manners, such as by communicating a request to the selected application104to shut itself down, by communicating with other components or modules of operating system102to terminate execution of the selected application104, and so forth. After the selected application104is shut down, trigger module114checks whether the threshold value that was previously met (and resulted in the selected application104being shut down) is still met. If the threshold value is still met then application selection module116selects another application104to be shut down. However, if the threshold value is not still met, then no additional applications need be shut down.

Alternatively, rather than selecting applications one by one, application selection module116can select multiple applications that are to be shut down. For example, application selection module116can determine a particular number of applications that are to be kept running based on a particular resource of computing device100(e.g., a particular amount of random access memory (RAM) in computing device100, a particular number of processor cores in computing device100, and so forth). One or more applications are selected so that only that particular number of applications are kept running.

Application selection module116can select which application104to shut down in a variety of different manners. In one or more embodiments, application selection module116selects an application to be shut down from a set of applications that includes applications running in the background. Applications running in the foreground (and thus possibly having displayed user interfaces that may be visible to the user) are not among the set from which an application to be shut down is selected. Whether an application is running in the foreground or background is a characteristic of the application that is maintained by, and can be retrieved by application lifetime management module108from, system information collection module106.

Additionally, in one or more embodiments, the characteristics of the applications104and resources of computing device100maintained by application information tracking module112are obtained by application selection module116. For the characteristic associated with the threshold value that was met, the set of applications running in the background is prioritized based on its value for that characteristic. Application selection module116selects, from the set of applications running in the background, the most offending application104. The most offending application104is the application having a largest or highest value for that characteristic. For example, the application104having the highest usage of a resource, the application104having the largest age value (e.g., the application104having the oldest age), and so forth. The least offending application104would then be the application104having the lowest usage of the resource, the application having the youngest age, and so forth. For example, if the processor usage threshold is met, then application selection module116selects the application having the largest processor usage as the most offending application, and selects that application as the application to be shut down. E.g., if there are five running applications104having processor usages of 20%, 5%, 4%, 4%, and 3%, respectively, then the application having the processor usage of 20% is the application having the highest usage of the processor and is the application that is selected to be shut down. Alternatively, multiple applications can be selected to be shut down (e.g., the application having the processor usage of 20% and the application having the processor usage of 5%).

Alternatively, other techniques can be used to select, from the set of applications running in the background, the application to shut down. For example, the set of applications running in the background can be prioritized based on how frequently each application is used (e.g., what percentage of the time, while the application is running, the application is running in the foreground), based on how recently each application was last in the foreground, and so forth. The application selected as the application to shut down can be the application that is least frequently used, the application that was least recently in the foreground, and so forth.

Furthermore, in one or more embodiments one or more different types of applications are exempted from being selected by application selection module116as an application to be shut down. Application selection module116can be configured with, or alternatively obtain from another module or device, an indication of these one or more types of applications that are exempted from being selected by application selection module116as an application to be shut down. The particular types of applications that are exempted from being selected by application selection module116as an application to be shut down can be determined in different manners based on the desires of the designer of application selection module116, or an administrator or user of computing device100.

It should be noted that although various examples of characteristics of applications104and/or the resources of computing device100and associated threshold values are discussed herein, these are only examples and other characteristics can alternatively be used with the techniques discussed herein. For example, characteristics such as the number of applications104running on computing device100can be used, and trigger module114can determine that a threshold value has been met if at least a threshold number of applications104are running on computing device100. By way of another example, different threshold values can be associated with different types of network connections, such as one threshold value for cellular wireless network connection usage and another threshold value for Wi-Fi network connection usage.

FIG. 2illustrates an example system200implementing the application lifetime management in accordance with one or more embodiments. System200can be implemented by, for example, computing device100ofFIG. 1. System200includes an application lifetime management module202that can be, for example, application lifetime management module108ofFIG. 1.

Application lifetime management module202receives application and/or resource characteristics204from a system information collection module206. These application and/or resource characteristics can be, for example, the information regarding various characteristics of applications104and/or the resources of computing device100received by application information tracking module112ofFIG. 1. These application and/or resource characteristics204can be received via another component or module, such as system information collection module106ofFIG. 1.

Application lifetime management module202also receives application identifiers208from a user interface management module210. Application identifiers208identify applications that are, for example, currently running in the foreground. User interface management module210maintains a record of the applications that are currently running in the foreground, and provides the applications in that record as application identifiers208. These application identifiers can be received via another component or module, such as system information collection module106ofFIG. 1.

Application lifetime management module202uses one or more of the application/resource characteristics204and the application identifiers208to select one or more applications212to be shut down. These one or more applications can be selected in different manners as discussed above. These applications212can be, for example, one or more of applications104ofFIG. 1. Application lifetime management module202communicates a shut down request or command214to the one or more applications212.

FIG. 3is a flowchart illustrating an example process300for a device implementing application lifetime management in accordance with one or more embodiments. Process300is carried out by a computing device, such as computing device100ofFIG. 1, and can be implemented in software, firmware, hardware, or combinations thereof. Process300is shown as a set of acts and is not limited to the order shown for performing the operations of the various acts. Process300is an example process for a device implementing application lifetime management; additional discussions of implementing application lifetime management are included herein with reference to different figures.

In process300, a check is made as to whether a threshold value is exceeded (act302). As discussed above, this threshold value is a threshold value associated with a characteristic of an application running on a computing device and/or a resource of computing device.

If no threshold value is exceeded, then the applications running on the computing device are allowed to continue running on the computing device (act304). Act302is then repeated (e.g., at regular or irregular intervals).

However, if a threshold value is exceed, then one or more applications to shut down are selected (act306). These one or more applications can be selected in different manners, as discussed above.

The one or more applications selected in act306are shut down (act308). Act302is then repeated (e.g., at regular or irregular intervals).

FIG. 4is a flowchart illustrating an example process400for selecting one or more applications to be shut down in accordance with one or more embodiments. Process400is carried out by a computing device, such as computing device100ofFIG. 1, and can be implemented in software, firmware, hardware, or combinations thereof. Process400is shown as a set of acts and is not limited to the order shown for performing the operations of the various acts. Process400is an example process for selecting one or more applications to be shut down; additional discussions of selecting one or more applications to be shut down are included herein with reference to different figures.

Process400is typically initiated in response to a threshold value associated with a characteristic of an application running on a computing device and/or a resource of computing device being met. In process400, a list of background applications is generated (act402). The background applications are applications that are running on the computing device in the background.

Optionally, one or more applications that are exempted from being shut down are removed from the generated list (act404). Different types of applications can be exempted from being shut down, as discussed above.

The applications remaining on the generated list are prioritized (act406). The applications can be prioritized in different manners, such as according to usage of a particular resource (e.g., the resource associated with the threshold value that was met), age, frequency of use, and so forth.

An application on the generated list is selected (act408). The application selected in act408is the application that is prioritized the highest (e.g., has the highest usage of a resource, has the oldest age, has the lowest frequency of use, and so forth).

The selected application is shut down (act410). The selected application can be shut down in different manners, as discussed above.

A check is then made as to whether the threshold value is still being met (act412). If the threshold value is still being met, then process400returns to act408to select another application. Alternatively, process400can return to act402to re-generate the list of background applications.

If the threshold value is not still being met then process400is done (act414). Additionally, if all applications that can be shut down (e.g., all background applications, all applications that are not exempted from being shut down, etc.) have been shut down, process400is done (act414) even if the threshold value is still met.

Process400is discussed with reference to generating a list and removing from the list applications that are exempted from being shut down. Alternatively, a list of background applications can be generated and prioritized, an application on the generated list selected, and then the application shut down only if the selected application is not exempted from being shut down.

The techniques discussed herein support various usage scenarios. For example, if a particular background application is using a large amount of the capacity of the processor (or memory), that particular background application can be selected as the application to be shut down. Thus, a background application, which was not in the foreground and not being currently used by the user of device100, is automatically shut down and the resources being used by that background application are freed up for other applications to use. Rather than simply shutting down the least recently used application, the application having a high probability of freeing up resources for other applications to use is the application that is shut down.

It should also be noted that the application lifetime management techniques discussed herein alleviate the user of some of the burden of managing multiple applications on his or her computing device. The user can run applications as he or she desires without concern for shutting down those applications when he or she is no longer using those applications. Rather, the application lifetime management techniques discussed herein automatically shut down the application for the user, taking care to shut down background applications rather than applications currently being used by the user.

FIG. 5illustrates an example computing device500that can be configured to implement the application lifetime management in accordance with one or more embodiments. Computing device500can be, for example, computing device100ofFIG. 1.

Computing device500includes one or more processors or processing units502(each of which can include one or more processor cores), one or more computer readable media504which can include one or more memory and/or storage components506, one or more input/output (I/O) devices508, and a bus510that allows the various components and devices to communicate with one another. Computer readable media504and/or one or more I/O devices508can be included as part of, or alternatively may be coupled to, computing device500. Bus510represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or local bus, and so forth using a variety of different bus architectures. Bus510can include wired and/or wireless buses.

Memory/storage component506represents one or more computer storage media. Component506can include volatile media (such as random access memory (RAM)) and/or nonvolatile media (such as read only memory (ROM), Flash memory, optical disks, magnetic disks, and so forth). Component506can include fixed media (e.g., RAM, ROM, a fixed hard drive, etc.) as well as removable media (e.g., a Flash memory drive, a removable hard drive, an optical disk, and so forth).

The techniques discussed herein can be implemented in software, with instructions being executed by one or more processing units502. It is to be appreciated that different instructions can be stored in different components of computing device500, such as in a processing unit502, in various cache memories of a processing unit502, in other cache memories of device500(not shown), on other computer readable media, and so forth. Additionally, it is to be appreciated that the location where instructions are stored in computing device500can change over time.

One or more input/output devices508allow a user to enter commands and information to computing device500, and also allows information to be presented to the user and/or other components or devices. Examples of input devices include a keyboard, a cursor control device (e.g., a mouse), a microphone, a scanner, and so forth. Examples of output devices include a display device (e.g., a monitor or projector), speakers, a printer, a network card, and so forth.

“Computer storage media” include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules, or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer.

Generally, any of the functions or techniques described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or a combination of these implementations. The terms “module” and “component” as used herein generally represent software, firmware, hardware, or combinations thereof. In the case of a software implementation, the module or component represents program code that performs specified tasks when executed on a processor (e.g., CPU or CPUs). The program code can be stored in one or more computer readable memory devices, further description of which may be found with reference toFIG. 5. The features of the application lifetime management techniques described herein are platform-independent, meaning that the techniques can be implemented on a variety of commercial computing platforms having a variety of processors.