CN112286692A - Memory recovery method, memory recovery device and storage medium - Google Patents

Memory recovery method, memory recovery device and storage medium Download PDF

Info

Publication number
CN112286692A
CN112286692A CN202011314747.6A CN202011314747A CN112286692A CN 112286692 A CN112286692 A CN 112286692A CN 202011314747 A CN202011314747 A CN 202011314747A CN 112286692 A CN112286692 A CN 112286692A
Authority
CN
China
Prior art keywords
memory
terminal
application
value
occupied
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011314747.6A
Other languages
Chinese (zh)
Inventor
武迟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202011314747.6A priority Critical patent/CN112286692A/en
Publication of CN112286692A publication Critical patent/CN112286692A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Studio Devices (AREA)

Abstract

The disclosure relates to a memory recovery method, a memory recovery device and a storage medium. The memory recovery method is applied to the terminal and comprises the following steps: when responding to the starting of a first application, determining a memory predicted value which needs to be consumed when the first application executes specified operation; and if the first application meets a memory recovery condition when executing the specified operation according to the memory predicted value, triggering the terminal to recover the memory occupied by other applications different from the first application. Through the method and the device, the timeliness of terminal memory recovery is guaranteed, when the preset application executes the specified operation, the preset application can smoothly execute the specified operation, and the speed of executing the specified operation is improved.

Description

Memory recovery method, memory recovery device and storage medium
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a memory recovery method, a memory recovery device, and a storage medium.
Background
With the rapid development of terminal technology, the terminal hardware configuration is better and better, the functions that can be realized are more and more, and the applications that are supported are more and more. When the number of applications running in the background of the terminal is large, the applications running in the background occupy a large amount of memory resources. However, the memory of the terminal is limited, and when the remaining memory is small, the situation that the foreground running application cannot run normally or runs stuck easily occurs.
In order to avoid the situation that the foreground running application cannot run normally or runs in a stuck state due to insufficient memory, the terminal operating system introduces a memory recovery mechanism. For example, when the memory is insufficient, the terminal operating system may close some processes of the background application to recycle the memory occupied by the background application.
However, the above recovery strategies are based on the memory recovery triggered only when the terminal finds that the available free memory is not enough to run the foreground application, so that the situation that the application running in the foreground is stuck due to the fact that the required memory cannot be applied in time or the speed of executing the operation is slowed down is easily caused.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a memory recycling method, a memory recycling device, and a storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a memory recovery method, which is applied to a terminal, and the memory recovery method includes: when responding to the starting of a first application, determining a memory predicted value which needs to be consumed when the first application executes specified operation; and if the first application meets a memory recovery condition when executing the specified operation according to the memory predicted value, triggering the terminal to recover the memory occupied by other applications different from the first application.
In an example, the determining that the first application satisfies the memory reclamation condition when executing the specified operation includes: determining a memory value required to be reserved by the terminal and a residual memory value of the terminal; determining the memory value actually occupied by the terminal according to the memory predicted value and the memory value required to be reserved by the terminal; and determining that the first application meets the memory recovery condition when executing the specified operation according to the memory value actually required to be occupied by the terminal and the residual memory value of the terminal.
In an example, the determining that the first application satisfies a memory recycling condition when executing the specified operation according to the memory value actually required to be occupied by the terminal and the remaining memory value of the terminal includes: and comparing the memory value actually required to be occupied by the terminal with the residual memory value of the terminal, and determining that the first application meets the memory recovery condition when executing the specified operation if the memory value actually required to be occupied by the terminal is larger than the residual memory value of the terminal.
In an example, the triggering the terminal to reclaim the occupied memory includes: and acquiring the applications running in the terminal background, and sequentially recycling the memory of the applications running in the terminal background according to the priority of the applications running in the terminal background and the sequence of the priority from low to high.
In one example, the terminal is provided with a camera device, the first application is a camera application, and the specified operation comprises a shooting operation performed by the camera device.
According to a second aspect of the embodiments of the present disclosure, there is provided a memory recovery device, where the memory recovery device is applied to a terminal, the memory recovery device including: the determining unit is configured to determine a memory predicted value which needs to be consumed when the first application executes the specified operation in response to the starting of the first application; the processing unit is configured to trigger the terminal to recycle the memory occupied by other applications different from the first application if the determining unit determines that the first application meets a memory recycling condition when executing the specified operation according to the memory predicted value.
In an example, the determining unit determines that the first application satisfies the memory recycling condition when executing the specified operation as follows: determining a memory value required to be reserved by the terminal and a residual memory value of the terminal; determining the memory value actually occupied by the terminal according to the memory predicted value and the memory value required to be reserved by the terminal; and determining that the first application meets the memory recovery condition when executing the specified operation according to the memory value actually required to be occupied by the terminal and the residual memory value of the terminal.
In an example, the determining unit determines that the first application satisfies a memory recycling condition when executing the specified operation according to a memory value actually required to be occupied by the terminal and a remaining memory value of the terminal in the following manner: and comparing the memory value actually required to be occupied by the terminal with the residual memory value of the terminal, and determining that the first application meets the memory recovery condition when executing the specified operation if the memory value actually required to be occupied by the terminal is larger than the residual memory value of the terminal.
In an example, the processing unit triggers the terminal to reclaim the occupied memory by the following method: and acquiring the applications running in the terminal background, and sequentially recycling the memory of the applications running in the terminal background according to the priority of the applications running in the terminal background and the sequence of the priority from low to high.
In one example, the terminal is provided with a camera device, the first application is a camera application, and the specified operation comprises a shooting operation performed by the camera device.
According to a third aspect of the present disclosure, there is provided a memory recovery method apparatus, where the memory recovery method apparatus includes: a memory configured to store instructions. And a processor configured to invoke an instruction to execute the memory reclamation method in the foregoing first aspect or any example of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by a processor, perform the memory reclamation method of the first aspect or any one of the examples of the first aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: when the preset application is started, a memory predicted value which needs to be consumed when the preset application executes the designated operation is obtained, if the memory recovery condition is met when the preset application executes the designated operation according to the memory predicted value which needs to be consumed when the preset application executes the designated operation, the terminal is triggered to recover the memory occupied by other applications different from the first application, the timeliness of terminal memory recovery is ensured, when the preset application executes the designated operation, the preset application can be ensured to smoothly execute the designated operation, and the speed of executing the designated operation is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flow chart illustrating a memory reclamation method according to an example embodiment.
Fig. 2 is a flow chart illustrating a method for memory reclamation in accordance with an exemplary embodiment.
Fig. 3 is a schematic diagram illustrating processing of captured image data when a camera application performs a capturing operation by an image capturing apparatus installed in a terminal according to an exemplary embodiment.
Fig. 4 is a flow chart illustrating a method for memory reclamation in accordance with an exemplary embodiment.
Fig. 5 is a block diagram illustrating a memory reclamation apparatus in accordance with an exemplary embodiment.
FIG. 6 is a block diagram illustrating an apparatus for memory reclamation in accordance with an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
At present, when more applications run in the background of the terminal, the applications run in the background occupy a large amount of memory resources. In order to avoid the situation that the foreground running application cannot run normally or runs in a stuck state due to insufficient memory, the terminal operating system introduces a memory recovery mechanism. However, the existing recovery mechanism is based on the condition that the terminal is not available and the idle memory is not enough to run foreground application, and then triggered memory recovery is performed, so that the situation that the application running in the foreground is blocked or the speed of executing operation is slowed down due to the fact that the required memory cannot be applied in time is easily caused.
The embodiment of the disclosure provides a memory recovery method. In the memory recovery method, when the preset application is started, a memory prediction value which needs to be consumed when the preset application executes the designated operation is obtained, if the memory prediction value which needs to be consumed when the preset application executes the designated operation is determined, when the preset application executes the designated operation, the memory recovery condition is met, the terminal is triggered to recover the memory occupied by other applications different from the first application, the timeliness of memory recovery is ensured, and the situation that when the preset application executes the designated operation, the memory recovery triggered due to insufficient free memory available for the terminal causes the preset application to be blocked when executing the designated operation or the speed is slowed down when executing the designated operation is avoided.
Fig. 1 is a flowchart illustrating a memory reclamation method according to an exemplary embodiment, where as shown in fig. 1, the memory reclamation method is used in a terminal and includes the following steps.
In step S11, in response to the first application starting, a predicted value of the memory that needs to be consumed when the first application performs the specified operation is determined.
In this disclosure, the first application may be a preset application installed in the terminal. The designating operation may be preset, and the first application may be executed by an operation that consumes more memory.
For example, the first application may be a camera application, the designation operation may be a shooting operation, the first application may also be a timely communication application, and the designation operation may be a video call based on a timely communication software. For convenience of description, the preset application is collectively referred to as a first application.
In order to prevent the situation that when the preset application executes the designated operation, the speed of the preset application is slowed down or the preset application is blocked when the preset application executes the designated operation due to the fact that the memory recovery triggered only when the terminal is not enough in free memory available for use, in one embodiment, the method and the device for executing the designated operation can trigger and determine the memory prediction value required to be consumed when the first application executes the designated operation in advance when the first application is started. And if the fact that the first application meets a memory recovery condition when the first application executes the specified operation is determined according to a memory predicted value which needs to be consumed when the first application executes the specified operation, the terminal is triggered to recover the memory occupied by other applications different from the first application so as to ensure the timeliness of memory recovery and meet the memory consumption when the first application executes the specified operation.
The predicted value of the memory to be consumed when the first application executes the designated operation may be preset, and an empirical value of the memory to be consumed when the first application executes the designated operation.
In step S12, if it is determined that the first application satisfies the memory recycling condition when executing the specified operation according to the memory prediction value, the terminal is triggered to recycle the memory occupied by the other applications different from the first application.
In one embodiment, for example, it may be determined that the first application satisfies the memory reclamation condition when executing the specified operation as follows:
and acquiring a memory value required to be reserved by the terminal and a residual memory value of the terminal, and determining a memory value actually required to be occupied by the terminal according to the memory predicted value and the memory value required to be reserved by the terminal. And determining that the first application satisfies the memory recovery condition when executing the specified operation according to the memory value actually occupied by the terminal and the residual memory value of the terminal.
In order to ensure the reasonable allocation of the memory usage, the terminal needs to reserve some idle memory values for subsequent other applications or terminal systems after allocating the idle part of the memory to the first application. The remaining memory value of the terminal can be understood as the memory value of the terminal except the memory value actually occupied.
And comparing the memory value actually occupied by the terminal with the residual memory value of the terminal, and determining that the first application satisfies the memory recovery condition when executing the specified operation if the memory value actually occupied by the terminal is larger than the residual memory value of the terminal. And when the first application executes the designated operation, enough free memory is available in the terminal, so that the designated operation can be smoothly executed by the preset application.
When the terminal is triggered to recycle the occupied memory, for example, the following modes can be used for realizing:
acquiring other applications running in the terminal background, and sequentially recycling the memories of the other applications running in the terminal background according to the priority of the applications running in the terminal background and the sequence of the priority from low to high.
In the exemplary embodiment of the disclosure, when the preset application is started, a memory predicted value which needs to be consumed when the preset application executes the designated operation is obtained, if it is determined that the preset application executes the designated operation according to the memory predicted value which needs to be consumed when the preset application executes the designated operation and a memory recovery condition is met, the terminal is triggered to recover the memory occupied by other applications different from the first application, the timeliness of terminal memory recovery is ensured, when the preset application executes the designated operation, the preset application is ensured to be capable of smoothly executing the designated operation, and the speed of executing the designated operation is increased.
Fig. 2 is a flowchart illustrating a memory reclamation method according to an exemplary embodiment, where as shown in fig. 2, the memory reclamation method is used in a terminal and includes the following steps.
In step S21, in response to the first application starting, a predicted value of the memory that needs to be consumed when the first application performs the specified operation is determined.
In step S22, if it is determined that the first application satisfies the memory recycling condition when executing the specified operation according to the memory prediction value, the terminal is triggered to recycle the memory occupied by the other applications different from the first application.
In step S23, the first application is controlled to perform a specified operation.
In the disclosure, when a first application is started, by determining a memory predicted value that needs to be consumed when the first application executes a specified operation, and if the memory predicted value that needs to be consumed when the first application executes the specified operation is determined, it is determined that the first application satisfies a memory recovery condition when executing the specified operation, and the terminal is triggered to recover a memory occupied by another application different from the first application, so as to ensure timeliness of memory recovery and satisfy memory consumption when the first application executes the specified operation.
Furthermore, because the free memory available for the terminal is enough to meet the memory consumption of the first application when the first application executes the designated operation, when the preset application executes the designated operation, the first application can be controlled to execute the designated operation without triggering the terminal again to recover the memory, so that the speed of executing the designated operation by the first application is increased, and the first application can be ensured to smoothly execute the designated operation.
In the exemplary embodiment of the disclosure, when the first application is started, a memory predicted value which needs to be consumed when the first application executes the designated operation is obtained, if it is determined that the first application executes the designated operation according to the memory predicted value which needs to be consumed when the first application executes the designated operation, and a memory recovery condition is met, the terminal is triggered to recover a memory occupied by other applications different from the first application, so that timeliness of memory recovery of the terminal is ensured, when the preset application executes the designated operation, the preset application can be ensured to smoothly execute the designated operation, and speed of executing the designated operation is increased.
The present disclosure will be described below with reference to an example in which the first application is a camera application and a designated operation is a shooting operation performed by an imaging device mounted in a terminal.
At present, camera devices have become a must of terminal manufacturers. In order to pursue high-quality imaging, various excellent software and hardware technologies are developed, and a high-pixel camera is configured in a terminal, and an image quality record of a shot image is continuously refreshed by assisting excellent image algorithms such as noise reduction, anti-shake and super-resolution. Meanwhile, various applications compete more and more seriously for important system resources such as a CPU and a memory, and when a camera device shoots, because a terminal has insufficient free memory available for use, memory recovery is triggered, so that when the camera application executes shooting operation through the camera device, imaging speed is slow and imaging delay is caused.
Fig. 3 is a schematic diagram illustrating processing of captured image data when a camera application performs a capturing operation by an image capturing apparatus installed in a terminal according to an exemplary embodiment.
In fig. 3, after the camera application performs a photographing operation by the image pickup device installed in the terminal, the image data is subjected to various kinds of arithmetic processes shown in fig. 3, such as Demosaic, MFNR, BOKEH, SR, and the like. When various algorithms process image data, hardware resources such as BPS, IPE, GPU, CDSP and the like are repeatedly utilized to process the image data.
Therefore, when the camera application executes the shooting operation, the consumed memory resource of the terminal is more, and when the camera application executes the shooting operation, the terminal is triggered to carry out memory recovery due to insufficient free memory available for the terminal, and after the memory recovery of the terminal is finished, the terminal carries out various processing on the shot image, so that the imaging speed is low, and the imaging delay is caused.
Fig. 4 is a flowchart illustrating a memory recycling method according to an exemplary embodiment, where as shown in fig. 4, the memory recycling method is used in a terminal, and the terminal is equipped with an image capturing device, and the memory recycling method includes the following steps.
In step S31, in response to the camera application starting, a predicted value of memory that needs to be consumed when the camera application performs a photographing operation by an image pickup device installed in the terminal is determined.
Because the camera application occupies less terminal memory resources in the starting process, when the camera application is received to be started, for example, when the camera application is located in a terminal desktop starter and a Launcher is started, a memory prediction value required to be consumed when the camera application executes shooting operation through a camera device installed in the terminal is determined according to the size of memory required to be consumed when the camera application executes shooting operation. And determining that the camera application satisfies a memory recovery condition when executing the shooting operation through the camera device installed in the terminal according to a memory predicted value required to be consumed when the camera application executes the shooting operation through the camera device installed in the terminal, and triggering the terminal to recover a memory occupied by other applications different from the camera application when the camera application is located in a terminal desktop starter and the camera Launcher is started so as to satisfy the memory consumption when the camera application subsequently needs to execute the shooting operation through the camera device installed in the terminal.
In step S32, if it is determined that the memory recovery condition is satisfied when the camera application performs a shooting operation by an image pickup device installed in the terminal according to the memory prediction value, the terminal is triggered to recover the memory occupied by another application different from the camera application.
In one embodiment, for example, it may be determined that the memory recovery condition is satisfied when the camera application performs a shooting operation by an imaging device installed in the terminal as follows:
obtaining the memory value which is determined based on the terminal operating system and needs to be reserved by the terminal, for example, recording as MreservedAnd the remaining memory value of the terminal is noted as MleftAccording to a memory prediction value, for example, denoted as McaptureAnd the memory value M required to be reserved by the terminalreservedDetermining the memory value actually occupied by the terminal, e.g. as Mtarget. According to the memory value M occupied by the terminal actual needtargetAnd the remaining memory value M of the terminalleftAnd determining that the camera application meets the memory recovery condition when executing shooting operation through a camera device installed in the terminal.
According to the memory value M occupied by the terminal actual needtargetAnd the remaining memory value M of the terminalleftFor example, it may be determined that the memory recovery condition is satisfied when the camera application performs a photographing operation by an image pickup device installed in the terminal, as follows:
comparison MtargetAnd MleftIf M is large or smalltarget>MleftAnd determining that the camera application meets the memory recovery condition when executing shooting operation through a camera device installed in the terminal.
Furthermore, when the camera application meets the memory recovery condition when the camera application executes the shooting operation through the camera device installed in the terminal, the terminal is triggered to recover the memory occupied by other applications different from the camera application, so that enough free memory is provided for the camera application before the camera application executes the shooting operation through the camera device installed in the terminal, the camera application can smoothly execute the shooting operation, the imaging speed of the shot image is increased, and imaging delay is avoided.
In the exemplary embodiment of the disclosure, when the camera application is started, a memory predicted value that needs to be consumed when the camera application executes a shooting operation is obtained, if it is determined that the preset application executes the specified operation according to the memory predicted value that needs to be consumed when the preset application executes the specified operation and a memory recovery condition is met, the time for recovering the memory is advanced to the time when the camera application is started, the timeliness of memory recovery is ensured, the processing speed of image data after shooting is further ensured, the imaging speed of the shot image is increased, and imaging delay is avoided.
Based on the same conception, the embodiment of the disclosure also provides a memory recovery device.
It is understood that, in order to implement the above functions, the memory recovery apparatus provided in the embodiments of the present disclosure includes a hardware structure and/or a software module corresponding to each function. The disclosed embodiments can be implemented in hardware or a combination of hardware and computer software, in combination with the exemplary elements and algorithm steps disclosed in the disclosed embodiments. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
Fig. 5 is a block diagram illustrating a memory reclamation apparatus according to an example embodiment. Referring to fig. 5, the memory reclamation apparatus 500 includes a determination unit 501 and a processing unit 502.
The determining unit 501 is configured to determine, when a first application is started, a memory prediction value that needs to be consumed when the first application executes a specified operation; a processing unit 502, configured to trigger the terminal to recycle the memory occupied by another application different from the first application if the determining unit determines, according to the memory prediction value, that the first application satisfies a memory recycling condition when executing a specified operation.
In an embodiment, the determining unit 501 determines that the first application satisfies the memory recycling condition when executing the specified operation in the following manner: determining a memory value required to be reserved by the terminal and a residual memory value of the terminal; determining the memory value actually occupied by the terminal according to the memory predicted value and the memory value required to be reserved by the terminal; and determining that the first application meets the memory recovery condition when executing the specified operation according to the memory value actually required to be occupied by the terminal and the residual memory value of the terminal.
In an embodiment, the determining unit 501 determines that the first application satisfies the memory recycling condition when executing the specified operation according to the memory value actually required to be occupied by the terminal and the remaining memory value of the terminal in the following manner: and comparing the memory value actually required to be occupied by the terminal with the residual memory value of the terminal, and determining that the first application meets the memory recovery condition when executing the specified operation if the memory value actually required to be occupied by the terminal is larger than the residual memory value of the terminal.
In an embodiment, the processing unit 502 triggers the terminal to reclaim the occupied memory by the following method: and acquiring the applications running in the terminal background, and sequentially recycling the memory of the applications running in the terminal background according to the priority of the applications running in the terminal background and the sequence of the priority from low to high.
In an embodiment, the terminal is provided with an image pickup device, the first application is a camera application, and the specifying operation includes performing a shooting operation by the image pickup device.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 6 is a block diagram illustrating an apparatus 600 for memory reclamation in accordance with an exemplary embodiment. For example, the apparatus 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 6, apparatus 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an input/output (I/O) interface 612, a sensor component 614, and a communication component 616.
The processing component 602 generally controls overall operation of the device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the apparatus 600. Examples of such data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power component 606 provides power to the various components of device 600. Power components 606 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for device 600.
The multimedia component 608 includes a screen that provides an output interface between the device 600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 600 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, audio component 610 includes a Microphone (MIC) configured to receive external audio signals when apparatus 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the apparatus 600. For example, the sensor component 614 may detect an open/closed state of the device 600, the relative positioning of components, such as a display and keypad of the device 600, the sensor component 614 may also detect a change in position of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, orientation or acceleration/deceleration of the device 600, and a change in temperature of the device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communications between the apparatus 600 and other devices in a wired or wireless manner. The apparatus 600 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 604 comprising instructions, executable by the processor 620 of the apparatus 600 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It is understood that "a plurality" in this disclosure means two or more, and other words are analogous. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. The singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It will be further understood that the terms "first," "second," and the like are used to describe various information and that such information should not be limited by these terms. These terms are only used to distinguish one type of information from another and do not denote a particular order or importance. Indeed, the terms "first," "second," and the like are fully interchangeable. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure.
It will be further understood that, unless otherwise specified, "connected" includes direct connections between the two without the presence of other elements, as well as indirect connections between the two with the presence of other elements.
It is further to be understood that while operations are depicted in the drawings in a particular order, this is not to be understood as requiring that such operations be performed in the particular order shown or in serial order, or that all illustrated operations be performed, to achieve desirable results. In certain environments, multitasking and parallel processing may be advantageous.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (12)

1. A memory recovery method is applied to a terminal, and the method comprises the following steps:
when responding to the starting of a first application, determining a memory predicted value which needs to be consumed when the first application executes specified operation;
and if the first application meets a memory recovery condition when executing the specified operation according to the memory predicted value, triggering the terminal to recover the memory occupied by other applications different from the first application.
2. The method according to claim 1, wherein the determining that the first application satisfies a memory reclamation condition when performing the specified operation comprises:
determining a memory value required to be reserved by the terminal and a residual memory value of the terminal;
determining the memory value actually occupied by the terminal according to the memory predicted value and the memory value required to be reserved by the terminal;
and determining that the first application meets the memory recovery condition when executing the specified operation according to the memory value actually required to be occupied by the terminal and the residual memory value of the terminal.
3. The method according to claim 2, wherein the determining that the first application satisfies the memory recovery condition when executing the specified operation according to the memory value actually required to be occupied by the terminal and the remaining memory value of the terminal includes:
and comparing the memory value actually required to be occupied by the terminal with the residual memory value of the terminal, and determining that the first application meets the memory recovery condition when executing the specified operation if the memory value actually required to be occupied by the terminal is larger than the residual memory value of the terminal.
4. The method according to claim 1, wherein the triggering the terminal to reclaim the occupied memory comprises:
and acquiring the applications running in the terminal background, and sequentially recycling the memory of the applications running in the terminal background according to the priority of the applications running in the terminal background and the sequence of the priority from low to high.
5. The memory recovery method according to any one of claims 1 to 4, wherein the terminal is equipped with a camera device, the first application is a camera application, and the specifying operation includes a shooting operation by the camera device.
6. A memory recovery device, applied to a terminal, the device comprising:
the determining unit is configured to determine a memory predicted value which needs to be consumed when the first application executes the specified operation in response to the starting of the first application;
the processing unit is configured to trigger the terminal to recycle the memory occupied by other applications different from the first application if the determining unit determines that the first application meets a memory recycling condition when executing the specified operation according to the memory predicted value.
7. The memory recovery device according to claim 6, wherein the determining unit determines that the memory recovery condition is satisfied when the first application performs the specified operation, as follows:
determining a memory value required to be reserved by the terminal and a residual memory value of the terminal;
determining the memory value actually occupied by the terminal according to the memory predicted value and the memory value required to be reserved by the terminal;
and determining that the first application meets the memory recovery condition when executing the specified operation according to the memory value actually required to be occupied by the terminal and the residual memory value of the terminal.
8. The memory recovery device according to claim 7, wherein the determining unit determines that the first application satisfies the memory recovery condition when executing the specified operation, according to the memory value actually required to be occupied by the terminal and the remaining memory value of the terminal, as follows:
and comparing the memory value actually required to be occupied by the terminal with the residual memory value of the terminal, and determining that the first application meets the memory recovery condition when executing the specified operation if the memory value actually required to be occupied by the terminal is larger than the residual memory value of the terminal.
9. The memory recovery device according to claim 6, wherein the processing unit triggers the terminal to recover the occupied memory by:
and acquiring the applications running in the terminal background, and sequentially recycling the memory of the applications running in the terminal background according to the priority of the applications running in the terminal background and the sequence of the priority from low to high.
10. The memory recovery device according to any one of claims 6 to 9, wherein the terminal is equipped with a camera device, the first application is a camera application, and the specifying operation includes a shooting operation by the camera device.
11. A memory recycling device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the memory reclamation method of any of claims 1-5.
12. A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a mobile terminal, enable the mobile terminal to perform the memory reclamation method of any of claims 1-5.
CN202011314747.6A 2020-11-20 2020-11-20 Memory recovery method, memory recovery device and storage medium Pending CN112286692A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011314747.6A CN112286692A (en) 2020-11-20 2020-11-20 Memory recovery method, memory recovery device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011314747.6A CN112286692A (en) 2020-11-20 2020-11-20 Memory recovery method, memory recovery device and storage medium

Publications (1)

Publication Number Publication Date
CN112286692A true CN112286692A (en) 2021-01-29

Family

ID=74399677

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011314747.6A Pending CN112286692A (en) 2020-11-20 2020-11-20 Memory recovery method, memory recovery device and storage medium

Country Status (1)

Country Link
CN (1) CN112286692A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116302572A (en) * 2023-05-19 2023-06-23 长通智能(深圳)有限公司 Computing power resource scheduling and distributing system and method based on AI intelligent recommendation

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116302572A (en) * 2023-05-19 2023-06-23 长通智能(深圳)有限公司 Computing power resource scheduling and distributing system and method based on AI intelligent recommendation

Similar Documents

Publication Publication Date Title
US10674088B2 (en) Method and device for acquiring image, terminal and computer-readable storage medium
CN106572299B (en) Camera opening method and device
CN105955765B (en) Application preloading method and device
CN105991930B (en) Zoom processing method, device and the mobile terminal of dual camera
CN107193653B (en) Bandwidth resource allocation method, device and storage medium
CN109254849B (en) Application program running method and device
US20170055221A1 (en) Method and apparatus for starting energy saving mode
CN112104807A (en) Control method, system and device for front camera
CN111031177A (en) Screen recording method, device and readable storage medium
EP3015983A1 (en) Method and device for optimizing memory
CN112217990B (en) Task scheduling method, task scheduling device and storage medium
CN113032030A (en) Camera starting method and device, terminal equipment and storage medium
US9678868B2 (en) Method and device for optimizing memory
CN114595785B (en) Model training method and device, electronic equipment and storage medium
CN108958911B (en) Process control method and device
CN112312023B (en) Camera buffer queue allocation method and device, electronic equipment and storage medium
CN112286692A (en) Memory recovery method, memory recovery device and storage medium
CN111580980B (en) Memory management method and device
CN107371222B (en) Virtual card disabling method and device
CN112423092A (en) Video recording method and video recording device
CN112307229A (en) Data processing method and device, electronic equipment and computer readable storage medium
EP3809336A1 (en) Method, device and storage medium for processing overhead of memory access
CN114339019A (en) Focusing method, focusing device and storage medium
CN110968523A (en) Memory defragmentation method and device
CN111610899A (en) Interface display method, interface display device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination