Determining available memory on a mobile platform
AssigneeGoogle Inc.
InventorsScott James Carbon-Ogden, James Andrew Blackler
Life of this patent
Estimating the term…
Abstract
An application from a plurality of applications executing at one or more processors of a computing device may determine a plurality of memory metrics of the computing device. The application may determine information indicative of a predicted safe amount of memory available for allocation by an application from the plurality of applications based at least in part on the plurality of memory metrics. The application may adjust, based at least in part on the information indicative of the predicted safe amount of memory available for allocation by the application, one or more characteristics of the application executing at the one or more processors to adjust an amount of memory allocated by the application.
Claims18
A method comprising:
- determining, by an application from a plurality of applications executing at one or more processors of a computing device, current values of a plurality of memory metrics of the computing device, including calling one or more functions provided by an operating system of the computing device to receive the current values of the plurality of memory metrics, wherein the plurality of memory metrics include per-process memory usage metrics for the plurality of applications;
- determining, by a library executing at the one or more processors as a separate process from the application and using one or more machine-learned models to predict a safe amount of memory available for allocation based at least in part on the current values of the plurality of memory metrics, information indicative of a predicted safe amount of memory available for allocation by the application without causing the computing device to enter a low memory state in which the application is in danger of being terminated by the operating system;
- monitoring, by the computing device, a canary application executing at the one or more processors to determine whether the canary application has been terminated;
- responsive to determining the canary application has been terminated, making, by the computing device, a prediction that the application is in danger of being terminated;
- responsive to making the prediction that the application is in danger of being terminated, sending, by the computing device and to the application, a warning indicating that the application is in danger of being terminated;
- and
- adjusting, by the application executing at the one or more processors and based at least in part on the information indicative of the predicted safe amount of memory available for allocation by the application, one or more characteristics of the application executing at the one or more processors to adjust an amount of memory allocated by the application to be at or below the predicted safe amount of memory available for allocation by the application to prevent the computing device from entering the low memory state.
A computing device, comprising:
- memory;
- and
- at least one processor communicably coupled to the memory and configured to:
- execute a plurality of applications;
- determine current values of a plurality of memory metrics of the memory, including calling one or more functions provided by an operating system of the computing device to receive the current values of the plurality of memory metrics, wherein the plurality of memory metrics include per-process memory usage metrics for the plurality of applications;
- determine, by a library executing at the one or more processors as a separate process from the application and using one or more machine-learned models to predict a safe amount of memory available for allocation based at least in part on the current values of the plurality of memory metrics, information indicative of a predicted safe amount of memory available for allocation by an application from the plurality of applications without causing the computing device to enter a low memory state in which the application is in danger of being terminated by the operating system;
- monitor a canary application executing at the one or more processors to determine whether the canary application has been terminated;
- responsive to determining the canary application has been terminated, make a prediction that the application is in danger of being terminated;
- responsive to making the prediction that the application is in danger of being terminated, send, to the application, a warning indicating that the application is in danger of being terminated;
- and
- adjust, based at least in part on the information indicative of the predicted safe amount of memory available for allocation by the application, one or more characteristics of the application executing at the at least one processor to adjust an amount of memory allocated by the application to be at or below the predicted safe amount of memory available for allocation by the application to prevent the computing device from entering the low memory state.
A non-transitory computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors of a computing device to:
- determine, by an application from a plurality of applications executing at the one or more processors, current values of a plurality of memory metrics of memory of the computing device, including calling one or more functions provided by an operating system of the computing device to receive the current values of the plurality of memory metrics, wherein the plurality of memory metrics include per-process memory usage metrics for the plurality of applications;
- determine, by a library executing at the one or more processors as a separate process from the application and using one or more machine-learned models to predict a safe amount of memory available for allocation based at least in part on the current values of the plurality of memory metrics, information indicative of a predicted safe amount of memory available for allocation by an application without causing the computing device to enter a low memory state in which the application is in danger of being terminated by the operating system;
- monitor a canary application executing at the one or more processors to determine whether the canary application has been terminated;
- responsive to determining the canary application has been terminated, make a prediction that the application is in danger of being terminated;
- responsive to making the prediction that the application is in danger of being terminated, send, to the application, a warning indicating that the application is in danger of being terminated;
- and
- adjust, based at least in part on the information indicative of the predicted safe amount of memory available for allocation by the application, one or more characteristics of the application executing at the one or more processors to adjust an amount of memory allocated by the application to be at or below the predicted safe amount of memory available for allocation by the application to prevent the computing device from entering the low memory state.
Dependencies are inferred from the claim text.