Memory recovery methods and equipment

By predicting future memory usage conditions and selectively performing memory return operations, the problems of process termination and high costs caused by fixed thresholds in existing technologies are solved, thereby improving the application availability and performance of electronic devices.

CN117730307BActive Publication Date: 2026-11-10SAMSUNG ELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202280049903.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-11-30
Filing Date
2022-09-01
Publication Date
2026-11-10
Estimated Expiration
2042-09-01

AI Technical Summary

Technical Problem

Existing technologies, based on fixed threshold operations without predicting future memory usage, lead to unnecessary process terminations and high execution costs, reducing the availability of electronic devices.

Method used

By predicting the amount of available memory at a predetermined time point, memory return operations can be selectively performed to avoid unnecessary process termination and memory reallocation, thereby improving the availability of user applications.

Benefits of technology

It improves the usability of applications in multi-tasking environments, reduces the use of CPU and switching media, prevents unnecessary memory operations, and enhances the overall performance of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117730307B_ABST
    Figure CN117730307B_ABST
Patent Text Reader

Abstract

An electronic device includes: a display; a memory configured to store at least one instruction corresponding to at least one program; and a processor configured to execute at least one instruction as a process, wherein the processor is configured to: in response to foreground execution of a first process, predict an amount of available memory at a point in time after a predetermined time has elapsed since the foreground execution of the first process, based on memory usage information stored in the memory; abort a memory return operation for a predetermined time based on the predicted amount of available memory exceeding a predetermined threshold; and perform a memory return operation without aborting the memory return operation based on the predicted amount of available memory being less than the predetermined threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Various embodiments of this disclosure relate to a memory return method and apparatus for selectively returning memory in response to foreground execution of an application process, based on memory usage information and by predicting the amount of available memory at a predetermined point in time. Background Technology

[0002] Because an electronic device could fall into an unrecoverable state in the worst case if the minimum memory required for its operation is not safe, it can be operated to periodically monitor available memory and, if necessary, perform a memory return operation on the memory in use. This memory return operation can be performed on memory used by applications / services, the kernel residing in its memory as part of the operating system (OS), and so on.

[0003] Memory return operations can be performed using memory reallocation (reclaiming) or process termination (ending). When the available memory in the system is insufficient (i.e., when it falls below a predetermined threshold), a memory return operation with process termination can force the process with relatively low priority among several executing processes to terminate, thereby returning the memory used by the execution of the corresponding process. A memory return operation with memory reallocation allows memory to be returned by selecting the memory to be reclaimed, while keeping the process executing and swapping the contents of the selected memory to a swap medium (or device).

[0004] When an electronic device operates based on a specific threshold preset to a fixed value to determine if there is insufficient available memory without predicting future memory usage, and terminates an ongoing process, any available memory can be immediately obtained. However, the execution cost (e.g., the initialization process of re-executing the terminated process) may be high, and the user's application availability may decrease. Therefore, even if the execution of the corresponding process is maintained and available memory is obtained through memory reallocation, the use of CPU and swapping media will increase to handle the selection of memory to be reclaimed and swapped out of memory, which may lead to a decrease in the availability of the electronic device. Summary of the Invention

[0005] Technical solutions

[0006] Various embodiments of this disclosure provide a memory return method and apparatus for selectively returning memory in response to foreground execution of an application process, based on memory usage information and by predicting the amount of available memory at a predetermined point in time.

[0007] According to one aspect of an exemplary embodiment of the present disclosure, an electronic device is provided, comprising: a display; a memory configured to store at least one instruction corresponding to at least one program; and a processor configured to execute at least one instruction as a process, wherein the processor is configured to: in response to foreground execution of a first process, predict an amount of available memory at a point in time after a predetermined time has elapsed from foreground execution of the first process, based on memory usage information stored in the memory; abort a memory return operation for a predetermined time based on the predicted amount of available memory exceeding a predetermined threshold; and perform a memory return operation without aborting the memory return operation based on the predicted amount of available memory being less than the predetermined threshold.

[0008] According to another aspect of an exemplary embodiment of the present disclosure, a memory return method is provided, comprising: in response to foreground execution of a first process, predicting, based on memory usage information, the amount of available memory at a point in time after a predetermined time has elapsed since the foreground execution of the first process; suspending the memory return operation for a predetermined time based on the predicted amount of available memory exceeding a predetermined threshold; and performing the memory return operation without suspending the memory return operation based on the predicted amount of available memory being less than the predetermined threshold.

[0009] According to various embodiments of this disclosure, an electronic device can, in response to foreground execution of the processor, predict the amount of available memory at a predetermined point in time based on memory usage information stored in memory, and selectively return to memory, thereby preventing unnecessary process termination and re-execution. This improves application usability for users in multitasking environments.

[0010] Furthermore, according to various embodiments of this disclosure, electronic devices can prevent unnecessary memory reallocation by predicting the amount of available memory, thereby preventing the use of the CPU and switching media for selected memory to be reclaimed and its swapping out operations, thus leading to an improvement in the usability of the electronic device for the user.

[0011] The effects achievable through exemplary embodiments of this disclosure are not limited to those described above, and other effects not mentioned herein can be clearly derived and understood by one of ordinary skill in the art to which the exemplary embodiments pertain. In other words, any unintended effects of implementing exemplary embodiments of this disclosure can also be derived by one of skill in the art from the disclosure of the exemplary embodiments. Attached Figure Description

[0012] Figure 1 This is a schematic block diagram of an electronic device performing a memory return operation according to an embodiment of the present disclosure.

[0013] Figure 2 An example of a situation where an abort is performed to perform a memory return operation according to an embodiment of this disclosure is shown.

[0014] Figure 3 An example of a user interface for selecting an application to execute in the foreground, according to an embodiment of the present disclosure, is shown.

[0015] Figure 4 An example of a memory return operation performed according to an embodiment of the present disclosure is shown.

[0016] Figure 5 An example of a standard for selecting a process to return to memory, according to an embodiment of this disclosure, is shown.

[0017] Figure 6 An example of a memory return operation according to an embodiment of the present disclosure is shown.

[0018] Figure 7 This is a schematic flowchart of a memory return method according to an embodiment of the present disclosure. Detailed Implementation

[0019] In view of the various functions of this disclosure, the terminology used in the various embodiments of this disclosure has been selected as currently widely used general terms, but they may vary depending on the intent of those skilled in the art, relevant precedents, the emergence of new technologies, etc. Furthermore, in some cases, terms arbitrarily chosen by the applicant may be used; in such cases, their meaning will be described in more detail in the description of the corresponding embodiment. Therefore, the terminology used in this disclosure should be defined based on its substantive meaning and the entirety of this disclosure, rather than simply as term names.

[0020] Throughout the specification, when an element is described as "including / containing" a component, it means that it may further include any other components, rather than excluding other components, unless otherwise explicitly stated. Furthermore, terms described throughout the specification, such as "...unit," "...module," etc., will mean a unit that performs at least one function or operation, which can be implemented in hardware or software, or a combination of hardware and software.

[0021] In the following, various embodiments of the present disclosure will be described in detail with reference to the accompanying drawings, enabling those skilled in the art to readily implement these embodiments. However, the present disclosure may be implemented in several different forms and is not limited to the embodiments described herein. In the drawings, similar reference numerals refer to similar elements or components, and for better clarity, the dimensions of each element or component in the drawings may be partially enlarged or scaled down / enlarged.

[0022] Figure 1 This is a schematic block diagram of an electronic device performing a memory return operation according to an embodiment of the present disclosure.

[0023] refer to Figure 1 The electronic device 100 may include a processor 110, a memory 120, and a display 130. The electronic device 100 may be further configured to include any additional components in addition to the components shown, or to omit at least one of the components shown.

[0024] According to various embodiments, electronic device 100 may include terminals capable of performing computing and communication functions. Electronic device 100 may include, for example, display devices, including televisions, desktop computers, smartphones, laptops, tablets, mobile phones, personal digital assistants (PDAs), laptop computers, media players, microservers, global positioning system (GPS) devices, e-book terminals, digital broadcasting terminals, navigation systems, kiosks, MP3 players, digital cameras, home appliances, and other mobile or non-mobile computing devices, but is not limited thereto. Furthermore, electronic device 100 may be a wearable terminal capable of performing computing and communication functions, such as a watch, glasses, hairband, and ring. Electronic device 100 may be various types of terminals, not limited to those described above.

[0025] According to an embodiment, memory 120 may be a storage medium used by electronic device 100 to store data, such as at least one instruction 121 corresponding to at least one program or setting information. The program may include an operating system (OS) program and various application programs. Memory 120 may be configured as volatile memory, non-volatile storage, or a combination of volatile and non-volatile memory. Memory 120 may provide stored data upon request from processor 110.

[0026] According to an embodiment, memory 120 may store memory usage information 122. For example, for each program, memory usage information 122 may include the amount of memory usage corresponding to each execution state of the process executing the program. The execution state of a process may include a foreground execution state that is executing while outputting the process to the foreground display 130 and a background execution state that is executing without outputting the process to the foreground display 130. In the foreground execution state, the process can interact with a user through a user interface (not shown). When a program is executed as a process, processor 110 may learn memory usage in response to each execution state of the process and store memory usage information 122, including the learned memory usage, in memory 120. Processor 110 may learn memory usage until the variability of memory usage in each execution state of the process becomes stable.

[0027] As another example, for each program, memory usage information 122 may include memory usage corresponding to the execution state and execution context of the process executing the program. The execution state of the process may include a foreground execution state and a background execution state, the foreground execution state being executed with the process output to display 130, and the background execution state being executed without the process output to display 130. In the foreground execution state, the process can interact with the user through a user interface (not shown). The execution context may include at least one of the amount of memory available at execution time and the number of background processes at execution time. When a program is executed as a process, processor 110 may learn memory usage corresponding to the process's execution state and execution context, and store memory usage information 122 including the learned memory usage in memory 120. Processor 110 may learn memory usage until the variability of memory usage becomes stable in each of the process's execution state and execution context. Therefore, according to an embodiment, processor 110 may learn memory usage that can vary depending on the execution context and the process's execution state at execution time, and store it in memory 120.

[0028] According to an embodiment, the display 130 can perform functions for outputting information in the form of numbers, characters, images, and / or graphics. The display 130 may include at least one hardware module for outputting information. The at least one hardware module may include, for example, at least one of a liquid crystal display (LCD), a light-emitting diode (LED), a light-emitting polymer display (LPD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode, a flexible LED, etc. The display 130 can display a screen corresponding to data received from the processor 110. The display 130 may be referred to as an output module, a display module, or other terms with equivalent technical meanings.

[0029] According to an embodiment, processor 110 can execute at least one instruction 121 stored in memory 120 as a process of performing arithmetic operations or data processing associated with controlling and / or communicating with at least one other component of electronic device 100. Processor 110 may include at least one of, for example, a central processing unit (CPU), a graphics processing unit (GPU), a microcontroller unit (MCU), a sensor hub, an auxiliary processor, a communication processor, an application processor, an application-specific integrated circuit (ASIC), or a field-programmable gate array (FPGA), and may have multiple cores.

[0030] According to an embodiment, in response to the foreground execution of the first process, processor 110 can predict the amount of available memory when a predetermined time has elapsed (e.g., from the current time or the time of foreground execution) based on memory usage information 122 stored in memory 120. Processor 110 may set the predetermined time as the duration until the variability of memory usage becomes stable, or the predetermined time may be obtained based on external input; however, it will be apparent to those skilled in the art that the predetermined time can be obtained in various ways. Processor 110 can further predict the amount of available memory by considering the execution context during foreground execution in response to the foreground execution of the first process. The execution context may include at least one of the amount of available memory at execution time and the number of background processes at execution time.

[0031] According to an embodiment, when a first process switches from background execution to foreground execution, or when the first process newly executes in the foreground, the processor 110 can predict the amount of memory required for the execution switch or new execution of the process based on memory usage information 122. The processor 110 can also predict the required amount of memory by further considering the execution context during foreground execution. In this case, the processor 110 can predict the required amount of memory based on memory usage information 122, including learned memory usage, in response to the execution state and execution context of the process.

[0032] According to an embodiment, processor 110 can switch a second process from foreground execution to background execution in response to foreground execution of a first process. Processor 110 can predict the amount of memory to be acquired, indicating that memory can be obtained through background execution of the second process, based on memory usage information 122. Processor 110 can further predict the amount of memory to be acquired by considering the execution context at the time of switching to background execution. In this context, processor 110 can predict the amount of memory to be acquired based on memory usage information 122, including learned memory usage, in response to the execution state and execution context of the process.

[0033] According to an embodiment, processor 110 can predict the amount of available memory by adding the amount of acquired memory to the amount of currently available memory and subtracting the amount of required memory from the amount of currently available memory. For example, processor 110 can predict the amount of available memory by adding the amount of acquired memory to the amount of currently available memory and then subtracting the amount of required memory from it.

[0034] According to an embodiment, when the predicted amount of available memory exceeds a predetermined threshold, the processor 110 may abort the execution of the memory return operation for a predetermined time. When the predicted amount of available memory is less than the predetermined threshold, the processor 110 may perform the memory return operation without aborting. The predetermined threshold may be the amount of reference memory required for the system to maintain normal operating operation without falling into an unrecoverable state, and may be preset based on external input (e.g., user input), although the predetermined threshold may be set in various ways that are obvious to those skilled in the art. Reference will be made below. Figure 2 and Figure 3 This describes the scenario where a memory return operation is aborted, and the following will refer to... Figures 4 to 6 This describes another scenario for performing a memory return operation.

[0035] The memory return operation may include selecting a process to return the memory in use based on a predetermined priority and terminating (or ending) the selected process. Alternatively, the processor 110 may predict the amount of a second available memory when swapping the memory in use to the swap medium without terminating the selected process, and terminate the selected process if the second predicted amount of available memory is less than a predetermined threshold. The swap medium may include various types of storage media, such as hard disks, solid-state drives (SSDs), etc., and it will be apparent to those skilled in the art that the swap medium is not limited to a specific type of storage media. Furthermore, the swap medium may utilize a portion of the memory 120 as the swap medium.

[0036] According to an embodiment, processor 110 can determine whether the current amount of available memory is less than a predetermined threshold at some time, and perform a memory return operation when the current amount of available memory is less than the predetermined threshold. The memory return operation can be performed through memory reclamation or process termination. When there is insufficient available memory in the system (e.g., when available memory is less than the predetermined threshold), a memory return operation with process termination can terminate processes determined to be of lower importance based on a predetermined priority among executing processes, thereby returning memory used to execute the corresponding process. A memory return operation with memory reclamation can select memory to be reclaimed and swap the contents of the selected memory to a swapping medium (or device) to reclaim the memory.

[0037] Figure 2 An example of a situation where the execution of a memory return operation is aborted according to an embodiment of the present disclosure is shown.

[0038] refer to Figure 2 The processor 110 can switch the execution process of application B from background execution (210) to foreground execution based on external input. The processor 110 can switch the execution process of application A from foreground execution (220) to background execution in response to the foreground execution of the execution process of application B.

[0039] Processor 110 can predict the amount of memory required for the foreground execution of application B's execution process based on memory usage information 122. Processor 110 can also predict the amount of memory to be acquired based on memory usage information 122, indicating the memory that can be acquired by switching from foreground execution to background execution of application A's execution process. Processor 110 can predict the amount of available memory after a predetermined time elapsed from the time of the switch (210) by adding the amount of acquired memory to the amount of currently available memory and subtracting the amount of required memory from the amount of currently available memory. Processor 110 can set the predetermined time as the duration until the variability of memory usage becomes stable, or the predetermined time can be obtained based on external input; however, it will be apparent to those skilled in the art that the predetermined time can be obtained in various ways.

[0040] exist Figure 2 In the example shown, in response to the predicted amount of available memory for the foreground execution of the application B process exceeding a predetermined threshold after a predetermined time since the switch (210), the processor 110 may abort (230) the execution of the memory return operation for a predetermined time. The predetermined threshold may be the amount of reference memory required for the system to maintain a normal operating system without falling into an unrecoverable state, and may be preset based on external input; however, it will be apparent to those skilled in the art that the predetermined threshold can be set in various ways. The memory return operation may include selecting a process to return the memory in use based on a predetermined priority and terminating the selected process.

[0041] Although not shown here, as another example, when a new process is executed in the foreground, the processor 110 can refer to the memory usage information 122 to predict the amount of memory required in response to the foreground execution of a process.

[0042] In the following text, see references Figure 3 This will describe the user interface when the processor 110 switches processes or executes a new process.

[0043] Figure 3 An example of a user interface for selecting an application to run in the foreground, according to an embodiment of this disclosure, is shown.

[0044] Now for reference Figure 3 The processor 110 can receive input from the user via a user interface for executing application B among multiple applications A to E.

[0045] As per the above reference Figure 2When the input application B is being executed as a background process (210), the processor 110 can switch the execution state of the process corresponding to application B from the background to the foreground based on user input, and output the execution screen of application B to the display 130.

[0046] As another example, when input application B is not being executed, processor 110 may execute application B as a foreground process based on user input and output the execution screen of application B to display 130.

[0047] Figure 4 An example scenario of performing a memory return operation according to embodiments of the present disclosure is shown.

[0048] refer to Figure 4 The processor 110 can switch the execution process of application B from background execution (410) to foreground execution based on external input. In response to the foreground execution of the execution process of application B, the processor 110 can switch the process currently executing in the foreground from foreground execution to background execution.

[0049] Processor 110 can predict the amount of memory required for the foreground execution of the process executing application B based on memory usage information 122. Processor 110 can predict the amount of memory to be acquired based on memory usage information 122, indicating the memory that can be acquired by switching to the background execution of the currently executing process. Processor 110 can predict the amount of available memory after a predetermined time has elapsed after the switch (410) by adding the amount of acquired memory to the amount of currently available memory and subtracting the amount of required memory from the amount of currently available memory. Processor 110 can set the predetermined time as the duration until the variability of memory usage becomes stable, or the predetermined time can be obtained based on external input, but it will be apparent to those skilled in the art that the predetermined time can be obtained in various ways.

[0050] exist Figure 4 In the example shown, processor 110 can perform a memory return operation because the predicted amount of available memory after a predetermined time following the switch (410) in response to the foreground execution of application B is less than a predetermined threshold. Processor 110 can select a process to return memory used as the execution process of application A based on a predetermined priority and terminate (420) the execution process of application A. In the illustrated example, the execution process of application A can be the same as or different from the process switched from foreground execution to background execution as described above, depending on the predetermined priority. See below for further details. Figure 5 The criteria used to select the process to return to memory.

[0051] Figure 5 An example of a standard for selecting a process to return to memory, according to an embodiment of this disclosure, is shown.

[0052] The processor 110 can select processes that return to the memory in use based on a predetermined priority and terminate the selected processes. Figure 5 An example is shown comprising multiple processes A through E, ordered in a predetermined priority order.

[0053] While predetermined priorities can be set based on external input, it will be apparent to those skilled in the art that predetermined priorities can be set in various ways. For example, predetermined priorities can be set in the order of background applications, previous applications, home screen applications, services, aware applications, foreground applications, system processes, and local processes. Background applications can include applications that were previously running but are currently inactive. Previous applications can include recently used background applications. Home screen applications can include launcher applications, etc., that provide functionality that makes up the background screen. Services can include processes that provide services such as cloud synchronization or uploading. Aware applications can include applications that the user can recognize but are not actually running in the foreground. For example, aware applications can include search windows, music listening applications, etc., displayed as relatively small user interfaces. Foreground applications can include applications that are currently output to the display and are running. Local processes can include low-level processes that perform basic operations of the electronic device.

[0054] Figure 6 An example of a memory return operation according to an embodiment of the present disclosure is shown.

[0055] Now for reference Figure 6 Processor 110 can select processes to return used memory based on a predetermined priority, and then predict the amount of second available memory when the used memory is swapped out to exchange medium 610 without immediately terminating the selected processes. In the example shown, processor 110 can select the process corresponding to application 1 with the lowest priority, and then predict the amount of second available memory to be returned when the memory 620 corresponding to application 1 is swapped out to exchange medium 610. Processor 110 can determine whether the amount of second predicted available memory is less than a predetermined threshold after subtracting a predicted amount of memory required to indicate the memory needed for a switch or new execution of the process from the amount of second predicted available memory, and then terminate the process corresponding to application 1 when the amount of second available memory is less than the predetermined threshold.

[0056] Through this operation, when it is predicted that even if the memory 620 used by the selected process is swapped out to the swap medium 610, it will not be able to obtain sufficient available memory, the processor 110 can preemptively terminate the selected process, thereby preventing unnecessary memory reallocation operations, and thus preventing unnecessary memory usage of the CPU and swap medium for selecting reclaimed memory and swapping out operations.

[0057] Figure 7 This is a schematic flowchart of a memory return method according to an embodiment of the present disclosure.

[0058] In operation S710, according to an embodiment, in response to the foreground execution of the first process, the electronic device 100 can predict the amount of available memory when a predetermined time has elapsed based on memory usage information. The electronic device 100 can set the predetermined time as the duration until the variability of memory usage becomes stable, or obtain the predetermined time from external input; however, it will be apparent to those skilled in the art that the predetermined time can be obtained in various ways.

[0059] For each program, memory usage information 122 may include the amount of memory used corresponding to each execution state of the process executing the program. The execution state of a process may include a foreground execution state that is being executed while being output to display 130 and a background execution state that is being executed when not being output to display 130. When executing a process, electronic device 100 may learn the amount of memory used corresponding to each execution state of the process and store the memory usage information 122, including the learned amount of memory usage, in memory 120. Processor 110 may learn the memory usage until, for example, the variability of memory usage in each execution state of the process becomes stable.

[0060] As another example, for each program, memory usage information 122 may include memory usage corresponding to the execution state and execution context of the process executing the program. The execution state of the process may include a foreground execution state that is being executed when output to display 130 and a background execution state that is being executed when not output to display 130. The execution context may include at least one of the amount of memory available during execution and the number of background processes during execution. When executing a process, electronic device 100 may learn the memory usage corresponding to the process's execution state and execution context, and store the memory usage information 122, including the learned memory usage, in memory 120. Electronic device 100 may learn memory usage until the variability of memory usage in each of the process's execution state and execution context becomes stable.

[0061] Electronic device 100 can switch a second process from foreground execution to background execution in response to the foreground execution of a first process. Electronic device 100 can predict the amount of memory that the background execution of the second process can acquire based on memory usage information, predict the amount of memory required by the foreground execution of the first process based on memory usage information, and predict the amount of available memory by adding the acquired memory to the currently available memory and subtracting the required memory from the currently available memory. Electronic device 100 can further predict the amount of available memory by considering the execution context of the foreground execution in response to the foreground execution of the first process.

[0062] In operation S720, according to the embodiment, the electronic device 100 can determine whether the predicted amount of available memory exceeds a predetermined threshold. When it is determined that the amount of available memory exceeds the predetermined threshold, operation S730 can be executed, and when it is determined that the amount of available memory is less than the predetermined threshold, operation S740 can be executed.

[0063] In operation S730 according to the embodiment, the electronic device 100 can return the memory to the predetermined time for the execution abort of the operation.

[0064] In operation S740 according to the embodiment, the electronic device 100 can perform a memory return operation. The memory return operation can select a process to return used memory based on a predetermined priority and terminate the selected process. Alternatively, the memory return operation can be operated to select a process to return used memory based on a predetermined priority, and without terminating the selected process, predict the amount of second available memory when the memory used by the selected process is swapped out to a memory swapping medium, determine whether the amount of second available memory exceeds a predetermined threshold, and, as a result of the determination, terminate the selected process when the amount of second available memory is less than the predetermined threshold.

[0065] The electronic device 100 described in this disclosure and the program executed by the electronic device 100 can be implemented as hardware components, software components, and / or combinations of hardware and software components. The program can be executed by any system capable of executing computer-readable instructions.

[0066] Software can include computer programs, code, instructions, or combinations thereof, and processing units can be configured to operate as needed and to be commanded independently or collectively. Software can be implemented as a computer program including instructions stored in a computer-readable storage medium. Computer-readable recording media can include, for example, magnetic storage media (e.g., read-only memory (ROM), random access memory (RAM), floppy disk, hard disk, etc.) and optically readable media (e.g., CD-ROM, digital versatile optical disc (DVD), etc.). The computer-readable code in the recording medium can be distributed among network-connected computer systems, allowing for distributed storage and execution of the computer-readable code. The recording medium can be computer-readable, stored in memory, and executed on a processor.

[0067] Machine-readable storage media may be provided in the form of non-transitory storage media, wherein the term “non-transitory” may simply mean that the storage medium is a tangible device and includes not only signals (e.g., electromagnetic waves), but the term does not distinguish between the location where data is semi-permanently stored in the storage medium and the location where data is temporarily stored in the storage medium.

[0068] Programs according to various embodiments of this disclosure may be included and provided in a computer program product. The computer program product may be traded as a product between a seller and a buyer. The computer program product may include software programs and machine-readable storage media storing the software programs. The computer program product may be included via a device manufacturer or an electronic marketplace (e.g., Google Play Store). TM App Store TM Products in the form of software programs (e.g., downloadable applications) distributed electronically or directly between two user devices (e.g., smartphones). For electronic distribution, at least a portion of the software program may be stored in a storage medium or may be temporarily generated, wherein the storage medium may be, for example, the storage medium of a manufacturer's server, an electronic marketplace server, or a relay server temporarily storing the software program.

[0069] In a system including a server and a device, the computer program product may include the storage medium of the server or the storage medium of the device. Alternatively, when a third device (e.g., a smartphone) is communicatively connected to the server or device, the computer program product may include the storage medium of the third device. Alternatively, the computer program product may include the software program itself sent from the server to the device or the third device, or sent from the third device to the device. In this case, one of the server, device, and third device may execute the computer program product to perform the method according to the exemplary embodiment. Alternatively, two or more of the server, device, and third device may execute the computer program product to implement the method according to the exemplary embodiment in a distributed manner. For example, the server may execute the computer program product stored in the server to control the device communicatively connected to the server to perform the method according to the exemplary embodiment. As another example, the third device may execute the computer program product to control the device communicatively connected to the third device to perform the method according to the exemplary embodiment. When the third device executes the computer program product, the third device may download the computer program product from the server and execute the downloaded computer program product. Alternatively, the third device may execute the computer program product provided in a preloaded state to perform the method according to the exemplary embodiment.

[0070] As described above, although embodiments have been described with reference to exemplary models and accompanying drawings, those skilled in the art can make various modifications and variations based on the above description. For example, the described techniques may be performed in a different order than the described methods, and / or the described components (e.g., computer systems or modules) may be coupled or combined in a form different from the described methods, or replaced or substituted with other components or equivalents to achieve appropriate results.

Claims

1. An electronic device, comprising: monitor; The memory is configured to store at least one instruction corresponding to at least one application program; as well as A processor is configured to execute the at least one instruction as a process, wherein the processor is configured to: Execute the foreground execution of the first process corresponding to the first application, and simultaneously execute the background execution of the second process corresponding to the second application different from the first application; When the first process is executed in the foreground, based on the memory usage information stored in the memory, the amount of available memory at a point in time after a predetermined time period has elapsed since the first process was executed in the foreground; If the predicted amount of available memory exceeds a predetermined threshold, the memory return operation will be suspended for the predetermined time period; and If the predicted amount of available memory is less than or equal to the predetermined threshold, the memory return operation is performed without aborting the memory return operation. The processor is further configured as follows: In response to the foreground execution of the first process, the second process, which was previously running in the foreground, is switched to run in the background; Based on the memory usage information, predict the first amount of memory that can be obtained by switching the second process from foreground execution to background execution; Based on the memory usage information, predict the second amount of memory required for the foreground execution of the first process; and The amount of available memory is predicted based on the current amount of available memory, the first amount of memory, and the second amount of memory.

2. The electronic device according to claim 1, in, For each of the at least one application, the memory usage information includes memory usage corresponding to the execution state of the process; and The execution state of the process includes a foreground execution state in which the process is being executed while being output to the display, and a background execution state in which the process is being executed without being output to the display.

3. The electronic device according to claim 1, in, For each of the at least one application, the memory usage information includes memory usage corresponding to the execution state of the process and the execution context of the process; The execution state of the process includes a foreground execution state where the process is being output to the display, and a background execution state where the process is being executed without being output to the display; and The execution context of the process includes at least one of the amount of available memory at the time of execution of the process and the number of background processes at the time of execution of the process.

4. The electronic device according to claim 3, wherein, The processor is also configured to: When the at least one application is executed as the process, memory usage corresponding to the execution state and execution context of the process is learned; and The memory usage information, including the memory usage learned, is stored in the memory.

5. The electronic device according to claim 3, wherein, The processor is also configured to, in response to foreground execution of the first process, further predict the amount of available memory based on the execution context of the first process at the time of foreground execution of the first process.

6. The electronic device according to claim 1, wherein, The processor is also configured to: The time required for the variability of memory usage to become stable is set as the predetermined time period; or The predetermined time period is obtained from external input.

7. The electronic device according to claim 1, wherein, The memory return operation includes: Processes that return memory in use are selected based on predetermined priorities; and Terminate the selected process.

8. The electronic device according to claim 1, in, The memory usage information includes the memory usage until the variability of memory usage becomes stable in each execution state of the first process.

9. The electronic device according to claim 1, wherein, The processor is also configured to: Learn memory usage until the variability of said memory usage becomes stable in every execution state of the first process; and The memory usage information, including the memory usage learned, is stored in the memory.

10. A memory return method, comprising: Execute the foreground execution of the first process corresponding to the first application, and simultaneously execute the background execution of the second process corresponding to the second application different from the first application; When the first process is executed in the foreground, the amount of available memory at a point in time after a predetermined time period has elapsed since the first process was executed in the foreground is predicted based on memory usage information. If the predicted amount of available memory exceeds a predetermined threshold, the memory return operation will be suspended for the predetermined time period. as well as Based on the prediction that the amount of available memory is less than the predetermined threshold, the memory return operation is performed without aborting the memory return operation; The memory return method further includes: In response to the foreground execution of the first process, the second process, which was previously running in the foreground, is switched to background execution; and, The predicted amount of available memory includes: Based on the memory usage information, predict the first amount of memory that can be obtained by switching the second process from foreground execution to background execution; Based on the memory usage information, predict the second amount of memory required for the foreground execution of the first process; and The amount of available memory is predicted based on the current amount of available memory, the first amount of memory, and the second amount of memory.

11. The memory return method according to claim 10, in, For each of at least one application stored in memory and executable as a process, the memory usage information includes memory usage corresponding to the execution state of the process; and The execution state of the process includes a foreground execution state where the process is being output to the display and a background execution state where the process is being executed without being output to the display.

12. The memory return method according to claim 10, in, For each of at least one application that is stored in memory and executable as a process, the memory usage information includes memory usage corresponding to the execution state and execution context of the process; The execution state of the process includes a foreground execution state where the process is being output to the display and a background execution state where the process is being executed without being output to the display; and The execution context of the process includes at least one of the amount of available memory at the time of execution of the process and the number of background processes at the time of execution of the process.

13. The memory return method according to claim 12, further comprising: When the at least one application is executed as the process, memory usage corresponding to the execution state and execution context of the process is learned; as well as The memory usage information, including the memory usage learned, is stored in the memory.

14. The memory return method according to claim 12, wherein, Predicting the amount of available memory includes, in response to the foreground execution of the first process, further predicting the amount of available memory based on the execution context of the first process when it is executed in the foreground.

15. The memory return method according to claim 10, further comprising: The time required for the variability of memory usage to become stable is set as the predetermined time period; or The predetermined time period is obtained from external input.

16. The memory return method according to claim 10, in, The memory usage information includes the memory usage until the variability of memory usage becomes stable in each execution state of the first process.

17. The memory return method according to claim 10, further comprising: Learn memory usage until the variability of memory usage becomes stable in every execution state of the first process; as well as The memory usage information, including the memory usage learned, is stored in the memory.

Citation Information

Patent Citations

  • Memory manager with enhanced application metadata

    CN103620548A