CN115543864A - Memory garbage recycling method and electronic equipment - Google Patents

Memory garbage recycling method and electronic equipment Download PDF

Info

Publication number
CN115543864A
CN115543864A CN202211214485.5A CN202211214485A CN115543864A CN 115543864 A CN115543864 A CN 115543864A CN 202211214485 A CN202211214485 A CN 202211214485A CN 115543864 A CN115543864 A CN 115543864A
Authority
CN
China
Prior art keywords
application
memory
value
memory space
preset threshold
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
CN202211214485.5A
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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310182903.5A priority Critical patent/CN116361200B/en
Priority to CN202211214485.5A priority patent/CN115543864A/en
Publication of CN115543864A publication Critical patent/CN115543864A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a memory garbage recycling method and electronic equipment, and relates to the technical field of terminals. The problems of high GC energy consumption and more resident memories in the electronic equipment are solved. The specific scheme is as follows: receiving a first operation of a user for a first application; in response to the first operation, a first application is launched. Under the scene that the occupied memory size after the first application GC is a first memory value, if the occupied memory size of the first application reaches a first preset threshold value from the first memory value, performing GC on the first application again; receiving a second operation of the user for a second application; and responding to the second operation, starting a second application, and performing GC on the second application again when the memory occupied by the second application after GC is the first memory value and the memory occupied by the second application reaches a second preset threshold value from the first memory value, wherein the second preset threshold value is smaller than the first preset threshold value, and the size of the application program installation package of the second application is smaller than that of the first application.

Description

Memory garbage recycling method and electronic equipment
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method for recovering memory garbage and an electronic device.
Background
When running, the application program needs to occupy the internal memory in the electronic device. The storage area occupied by the application in the internal memory may also be referred to as memory space. As application runtime increases, the memory space occupied by the application increases. Meanwhile, an idle memory space which is not accessed any more by the application program also appears in the occupied memory space.
Generally, an electronic device can adopt a Garbage Collection (GC) mode to collect an idle memory space, thereby improving the utilization efficiency of the memory space in the electronic device. But the current memory garbage recycling mode has the problem of poor recycling effect.
Disclosure of Invention
The embodiment of the application provides a memory garbage recycling method and electronic equipment, and is used for solving the problem of high energy consumption of a GC (gas chromatography) in the electronic equipment.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, a method for recovering memory garbage provided in an embodiment of the present application is applied to an electronic device, and the method includes: receiving a first operation of a user for a first application; responding to the first operation, starting a first application, wherein after the first application is subjected to the i-th garbage recycling treatment in the running process, the size of a memory space occupied by the first application is a first memory numerical value, and i is a positive integer. When the size of the memory occupied by the first application reaches a first preset threshold value from the first memory value, performing garbage recycling treatment for the (i + 1) th time aiming at the first application; receiving a second operation of the user for the second application; responding to the second operation, starting the second application, wherein the size of a memory space occupied by the second application after the j-th garbage recycling processing in the running process of the second application is the first memory numerical value, and j is also a positive integer; and when the memory size occupied by the second application reaches a second preset threshold value from the first memory value, performing (j + 1) th garbage recycling processing on the second application, wherein the second preset threshold value is smaller than the first preset threshold value, and the size of the application program installation package of the second application is smaller than that of the application program installation package of the first application.
For example, the first preset threshold and the second preset threshold may also be referred to as GC water line values, and are suitable for evaluating a memory size threshold for whether to perform GC on the application program.
In the method, the memory size occupied by the first application is recycled when the first memory value reaches a first preset threshold value, and the memory size occupied by the second application is recycled when the first memory value reaches a second preset threshold value, which is equivalent to setting different GC waterlines for the first application and the second application.
In the application, a larger GC water line value is distributed for a program of a larger application of an application program installation package, a smaller GC water line value is distributed for a program of a smaller application of the application program installation package, the GC water line value can be set in a more targeted manner according to the type of the application program, and compared with the mode that a unified GC water line value is set in the traditional scheme, different water line values are set for different applications flexibly in the application scheme, the occupation of resources due to frequent GC can be reduced, GC processing is performed in a more targeted manner, the occupation of the resources is reduced, and the power consumption is reduced.
In other embodiments, the different types of application programs may also be applications with different memory access frequencies, different application load sizes, and the like.
In some embodiments, the first application and the second application are applications located in a preset set of applications in the electronic device.
In the embodiment, the electronic device only performs GC processing on the applications in the preset application set by using different GC pipelines, and is more targeted, and different GC pipelines can be used for processing the applications with different user attention or different GC processing frequencies, so that the flexibility is higher.
In some embodiments, after launching the first application, the method further comprises: determining that the first application is located in a preset application set of the electronic equipment; after launching the second application, the method further comprises: and determining that the second application is located in a preset application set of the electronic device.
In some embodiments, the electronic device further includes a third application and a fourth application, and the third application and the fourth application are applications located outside the preset application set, and the method further includes:
receiving a third operation of the user for a third application; responding to the third operation, starting the third application, wherein the size of a memory space occupied by the third application after the m-th garbage recycling processing in the running process of the third application is a second memory numerical value, and m is a positive integer; when the size of the memory occupied by the third application reaches a third preset threshold value from the second memory value, performing m + 1-time garbage recycling treatment on the third application; receiving a fourth operation of the user for the fourth application; responding to the fourth operation, starting the fourth application, wherein the size of a memory space occupied by the fourth application after n-th garbage recycling processing in the running process of the fourth application is the second memory value, and n is a positive integer; and when the size of the memory occupied by the fourth application reaches the third preset threshold value from the second memory value, performing n + 1-time garbage recycling processing on the fourth application, wherein the size of the application program installation package of the third application is larger than that of the application program installation package of the fourth application.
In the above embodiment, for some common applications, a uniform GC waterline is adopted, the uniform GC waterline has universality, and the dedicated GC waterline needs to perform a large number of tests for a single application, and for common applications, the uniform GC waterline is also applicable, so that the test workload of the dedicated GC waterline is reduced, and the configuration efficiency of the GC waterline is improved.
In some embodiments, after the first application is subjected to i +1 th garbage recycling processing in the running process, the size of the memory space occupied by the first application is a third memory value, and the method further includes: when the size of the memory occupied by the first application reaches a fourth preset threshold value from the third memory value, performing garbage recycling treatment for the (i + 2) th time aiming at the first application; the first memory value is different from the third memory value, and the fourth preset threshold is different from the first preset threshold.
In the above embodiment, for the first application, the actually occupied memory is different, and the allocated GC pipelines are different, so that the GC pipelines can adapt to different operation stages of the application.
In some embodiments, a first mapping relationship is satisfied between the first memory value and the first preset threshold, the first mapping relationship is also satisfied between the third memory value and the fourth preset threshold, the first mapping relationship is used to indicate a correspondence relationship between different memory values and different preset thresholds, the first mapping relationship is determined based on a first parameter corresponding to the first application, and the first parameter includes a first maximum threshold, a first minimum threshold, and a first scale factor between a memory value and a preset threshold.
In some embodiments, after the second application is subjected to a (j + 1) th garbage collection processing in the running process, the size of the memory space occupied by the second application is a fourth memory value, and the method further includes: when the size of the memory occupied by the second application reaches a fifth preset threshold value from the fourth memory value, performing garbage recycling processing for the (j + 2) th time aiming at the second application; the first memory value is different from the fourth memory value, and the fifth preset threshold is different from the second preset threshold.
In some embodiments, a second mapping relationship is satisfied between the first memory value and the second preset threshold, the second mapping relationship is also satisfied between the fourth memory value and the fifth preset threshold, the second mapping relationship is used to indicate a corresponding relationship between different memory values and different preset thresholds, the second mapping relationship is determined based on a second parameter corresponding to the second application, and the second parameter includes a second maximum threshold, a second minimum threshold, and a second scaling factor between a memory value and a preset threshold.
In some embodiments, the first application is a social application and the second application is a clock application or a weather application.
In some embodiments, the set of applications includes applications preconfigured by a developer, or the set of applications includes applications having at least one of application usage frequency, application load size, and application installation package size meeting preset requirements. For example, the application use frequency meets the preset use frequency condition. For another example, the application load size is in accordance with the application of the preset load evaluation condition. For another example, the size of the application installation package is in accordance with the application of the preset installation package condition.
In a second aspect, an electronic device provided in an embodiment of the present application includes one or more processors and a memory; the memory coupled to the processor, the memory to store computer program code, the computer program code comprising computer instructions, which, when executed by the one or more processors, cause the one or more processors to: receiving a first operation of a user for a first application; responding to the first operation, starting the first application, wherein the size of a memory space occupied by the first application after the first application is subjected to the i-time garbage recycling treatment in the running process is a first memory value; when the size of the memory occupied by the first application reaches a first preset threshold value from the first memory value, performing garbage recycling treatment for the (i + 1) th time aiming at the first application; receiving a second operation of the user for the second application; responding to the second operation, starting the second application, wherein the size of a memory space occupied by the second application after the jth garbage collection processing in the running process of the second application is the first memory value; and when the memory size occupied by the second application reaches a second preset threshold value from the first memory value, performing (j + 1) th garbage recycling processing on the second application, wherein the second preset threshold value is smaller than the first preset threshold value, and the size of the application program installation package of the second application is smaller than that of the application program installation package of the first application.
In some embodiments, the first application and the second application are applications located in a preset set of applications in the electronic device.
In some embodiments, the electronic device further includes a third application and a fourth application, the third application and the fourth application being applications outside the preset set of applications, and the one or more processors are configured to: receiving a third operation of the user for a third application; responding to the third operation, starting the third application, wherein the size of a memory space occupied by the third application after the m-th garbage recycling processing in the running process of the third application is a second memory numerical value; when the size of the memory occupied by the third application reaches a third preset threshold value from the second memory value, performing m + 1-time garbage recycling treatment on the third application; receiving a fourth operation of the user for the fourth application; responding to the fourth operation, starting the fourth application, wherein the size of a memory space occupied by the fourth application after the nth garbage collection processing in the running process of the fourth application is the second memory value; and when the size of the memory occupied by the fourth application reaches the third preset threshold value from the second memory value, performing n + 1-time garbage recycling processing on the fourth application, wherein the size of the application program installation package of the third application is larger than that of the application program installation package of the fourth application.
In some embodiments, after the first application is subjected to i +1 th garbage collection processing in the running process, the size of the memory space occupied by the first application is a third memory value, and the one or more processors are configured to: when the size of the memory occupied by the first application reaches a fourth preset threshold value from the third memory value, performing garbage recycling treatment for the (i + 2) th time aiming at the first application; the first memory value is different from the third memory value, and the fourth preset threshold is different from the first preset threshold.
In some embodiments, a first mapping relationship is satisfied between the first memory value and the first preset threshold, the first mapping relationship is also satisfied between the third memory value and the fourth preset threshold, the first mapping relationship is used to indicate a correspondence relationship between different memory values and different preset thresholds, the first mapping relationship is determined based on a first parameter corresponding to the first application, and the first parameter includes a first maximum threshold, a first minimum threshold, and a first scale factor between a memory value and a preset threshold.
In some embodiments, after the second application is subjected to a (j + 1) th garbage collection processing in the running process, the size of the memory space occupied by the second application is a fourth memory value, and the one or more processors are configured to: when the size of the memory occupied by the second application reaches a fifth preset threshold value from the fourth memory value, performing garbage recycling processing for the (j + 2) th time aiming at the second application; the first memory value is different from the fourth memory value, and the fifth preset threshold is different from the second preset threshold.
In some embodiments, a second mapping relationship is satisfied between the first memory value and the second preset threshold, the second mapping relationship is also satisfied between the fourth memory value and the fifth preset threshold, the second mapping relationship is used to indicate a correspondence between different memory values and different preset thresholds, the second mapping relationship is determined based on a second parameter corresponding to the second application, and the second parameter includes a second maximum threshold, a second minimum threshold, and a second scaling factor between a memory value and a preset threshold.
In some embodiments, the first application is a social application and the second application is a clock application or a weather application.
In some embodiments, the set of applications includes application programs preconfigured by a developer, or the set of applications includes application programs of which at least one of application usage frequency, application load size, and application installation package size meets preset requirements.
In a third aspect, a computer storage medium provided in an embodiment of the present application includes computer instructions, which, when executed on an electronic device, cause the electronic device to perform the method in the first aspect and possible embodiments thereof.
In a fourth aspect, the present application provides a computer program product, which, when run on the above-mentioned electronic device, causes the electronic device to perform the method of the above-mentioned first aspect and its possible embodiments.
It is understood that the electronic device, the computer storage medium and the computer program product provided in the foregoing aspects are all applied to the corresponding method provided in the foregoing, and therefore, the beneficial effects achieved by the electronic device, the computer storage medium and the computer program product provided in the foregoing aspects can refer to the beneficial effects in the corresponding method provided in the foregoing, and are not described herein again.
Drawings
Fig. 1 is an exemplary diagram of an application occupying a memory space according to an embodiment of the present application;
FIG. 2 is a diagram of an exemplary GC provided in an embodiment of the present application;
fig. 3 is a diagram illustrating an example of a relationship between an occupied memory space and a reserved memory space according to an embodiment of the present application;
fig. 4 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating steps of a method for recovering memory garbage according to an embodiment of the present disclosure;
fig. 6 is a flowchart illustrating sub-steps of S102 according to an embodiment of the present disclosure;
fig. 7 is a flowchart illustrating sub-steps of S105 according to an embodiment of the present disclosure;
fig. 8 is an exemplary diagram of an implementation manner of a method for recovering memory garbage according to an embodiment of the present application;
fig. 9 is an exemplary diagram of an incubation application process provided in an embodiment of the present application;
fig. 10 is an exemplary diagram of a chip system provided in an embodiment of the present application.
Detailed Description
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present embodiment, "a plurality" means two or more unless otherwise specified.
The memory in the electronic device is the basis for the operation of all applications. The memory may be divided into an internal memory and an external memory. The external memory may be used to store program files of various installed application programs. The internal memory may be used to provide a storage space required by the application program during the operation.
In some embodiments, the electronic device may partition an exclusive storage area (which may also be referred to as a memory space) in the internal storage for the application program when the application program is running. Obviously, the more applications that are running, the greater the occupancy of internal memory. Of course, the available memory space in the electronic device is limited, and when the memory space is occupied, not only other applications that are not started can not be started normally, but also the running effect of the started applications is not good.
In some embodiments, the electronic device may employ a Garbage Collection (GC) algorithm to manage the storage space of the internal memory. The GC algorithm described above is an automatic memory management mechanism. When the memory space occupied by an application is no longer accessed by the application, that is, when a free part appears in the memory space allocated to the application, the GC algorithm can be used for recovering the free memory space, so that the recovered memory space can be used by other applications. In addition, the above recycling of the idle memory space by the GC algorithm may also be referred to as performing GC for short.
The following takes an application a as an example, and introduces a usage scenario of the GC algorithm:
first, when the application a starts running, the electronic device may allocate a memory space that is exclusive during the running for the application a.
For example, after the application a is started to run, the electronic device may determine a memory space actually occupied by the application a currently in the internal storage, which is referred to as an occupied memory space. It is understood that the real memory space is the memory space being used by the application a. Then, the electronic device may determine a reserved memory space to be allocated to the application a according to the real memory space of the application a. It is to be understood that the reserved memory space is a memory space that is available to the application a but is not used temporarily, and the size of the reserved memory space is related to the size of the real memory space. In addition, the real memory space and the reserved memory space both belong to the memory space exclusive to the application a. Certainly, the memory space actually allocated to the application a by the electronic device may be slightly larger than the sum of the real memory space and the reserved memory space, or may be exactly equal to the sum of the real memory space and the reserved memory space.
During the running of the application a, the memory space actually occupied by the application a increases. In this scenario, application a may occupy the reserved memory space. It can be understood that the occupied part of the reserved memory space is changed into the real occupied memory space corresponding to the application a, so that as the real occupied memory space corresponding to the application a is continuously increased, the corresponding reserved memory space becomes smaller. For example, as shown in fig. 1, when the application a starts running, the real memory space is 60M, and the reserved memory space is 6M. After the application a runs for a period of time, the real memory space may become 65M and the reserved memory space may become 1M.
Obviously, as the running time of the application a increases, the reserved memory space will be less and less, and the real memory space will be larger and larger. After the reserved memory space is occupied by the application a, the electronic device needs to allocate an exclusive memory space for the application a again.
In some embodiments, after allocating an exclusive memory space for application a each time, the electronic device may determine a GC water line value corresponding to application a, where the GC water line value is a threshold value that triggers reallocation of the exclusive memory space. In general, the GC watermark value may be equal to the size of the exclusive memory space allocated to application a, e.g., equal to the sum of the sizes of the real and reserved memory spaces. Or, the sum of the actual memory space and the reserved memory space is slightly larger than the sum of the actual memory space and the reserved memory space.
Secondly, during the running period of the application a, the corresponding real memory space will gradually increase, and when the real memory space reaches or exceeds the corresponding GC water line value, the electronic device may be triggered to reallocate the exclusive memory space for the application a.
In addition, a memory space that is no longer accessed (or used) by the application a may be present in the real memory space, which is called an idle memory space.
Before the electronic device reallocates the exclusive memory space for the application a, the electronic device may recycle the idle memory space corresponding to the application a through the GC algorithm. The process of recycling the idle space can refer to the related art, and is not described herein again. For example, as shown in fig. 2, the GC waterline value corresponding to the application a is 67M, and after the actual memory space of the application a reaches 67M, if there is 17M idle memory space in the actual memory space, the actual memory space corresponding to the application a will become 50M after the GC algorithm processing, that is, the 17M idle memory space is recycled.
Then, the electronic device may re-determine the reserved memory space corresponding to the application a according to the real occupied memory space processed by the GC. In the above example, after the GC, the real occupied memory space corresponding to the application a is 50M, and the electronic device may determine the reserved memory space of 5M according to the real occupied memory space of 50M. In this way, the exclusive memory space reallocated to application a is not less than 55M, for example, application a may be allocated 56M and exclusive memory space. The GC water line value corresponding to application a may be updated to 56M. The 56M memory space exclusive to application a includes 50M real memory space and 5M reserved memory space.
In this loop, the electronic device can effectively manage the occupation of the internal memory by each application program by using the GC algorithm.
In addition, in the process of allocating the memory space exclusive to the application a, the electronic device needs to utilize multiple GC related parameters. The GC related parameter includes one or a combination of an exclusive space upper limit value, a maximum reserved limit value, a minimum reserved limit value, and a space utilization rate.
The exclusive space upper limit value refers to a maximum value of the exclusive memory space that can be allocated to the application program, for example, if the exclusive space upper limit value is 512M, it means that the size of the exclusive memory space allocated to a single application program does not exceed 512M. For example, the exclusive space ceiling value may be different for a lightweight application and a bulky application. For example, the above exclusive space upper limit value includes an upper limit value 1 (e.g., 384M) and an upper limit value 2 (e.g., 512M). The upper limit value 1 is an exclusive space upper limit value for a lightweight application. The upper limit value 2 is an exclusive space upper limit value for a large-volume application program. Of course, the developer may mark whether the application program is a lightweight application or a large-volume application, so that after the application program is installed, the electronic device may determine its corresponding upper limit value of the exclusive space according to the type of the application program (lightweight or large-volume).
In some examples, if the actual memory space size corresponding to the application a exceeds the corresponding exclusive space upper limit value, the electronic device may display a prompt message to prompt the application a that the memory usage is abnormal.
In addition, the space utilization rate is used for calculating the proportion of the reserved memory space on the basis of actually occupying the memory space. In other words, the space utilization may characterize the relationship between the occupied memory space and the reserved memory space. When computing the reserved memory space according to the real memory space, the electronic device needs to ensure that a preset condition is satisfied between the real memory space and the computed reserved memory space, and the preset condition is associated with the space utilization rate. Illustratively, the sum of the real memory space and the calculated reserved memory space is referred to as memory space 1, and when the ratio of the real memory space to the memory space 1 is equal to the above space utilization ratio, it is determined that the preset condition is satisfied. For example, in a scene where the space utilization rate is 75%, if the real occupied memory space is 75M, the size of the reserved memory space may be calculated to be 25M, so that the real occupied memory space and the calculated reserved memory space satisfy the preset condition.
Of course, in some embodiments, the calculated reserved memory space may be different from the reserved memory space actually allocated to the application by the electronic device. In the above embodiment, the GC related parameters may further include a maximum reserved limit and a minimum reserved limit. The maximum reserved limit indicates the maximum reserved memory space that can be allocated to an application. The minimum reserved limit indicates the minimum reserved memory space that can be allocated to an application. For example, when the maximum reserved limit is 8M, if the calculated reserved memory space is greater than 8M according to the occupied memory space and the space utilization rate, it is determined that the size of the actually allocated reserved memory space is equal to 8M. For example, when the minimum reserved limit is 2M, if the calculated reserved memory space is less than 2M according to the actual memory space occupied and the space utilization rate, it is determined that the size of the actually allocated reserved memory space is equal to 2M.
In short, when the space utilization rate is 0.75, the maximum reserved limit is 8M, and the minimum reserved limit is 2M, the relationship between the reserved memory space and the real memory space can be as shown in fig. 3.
Obviously, when the electronic device allocates an exclusive memory space (including a reserved memory space) to the application program, the size of the exclusive memory space is affected by the GC related parameter. In addition, the GC-related parameters also affect the confirmation of the GC-water line value of the application. In some embodiments, all applications in the electronic device share a set of GC-related parameters.
Obviously, for a heavily loaded application (e.g., a system service, a foreground-running application, etc.), the GC waterline value determined by the GC-related parameter is low for the application, which may cause the application to frequently perform GC, that is, may cause the power consumption of the electronic device to increase. Illustratively, the installation package volume corresponding to the heavily loaded application is large, e.g., the corresponding installation package volume is larger than the set first volume threshold. Further illustratively, the newly added memory occupancy per unit time of the heavily loaded application is greater than the first memory threshold. Further illustratively, the system resources (computing resources and memory resources) occupied by the electronic device when running the heavily loaded application are greater than the first preset load threshold. Further illustratively, the memory access frequency exceeds the first frequency value during operation of the heavily loaded application.
For a lightly loaded application program (such as a clock application or an application program with an unusual background), the GC waterline value determined by the GC related parameter is higher for the application program, so that the application program cannot trigger the GC for a long time, and the memory space occupied by the application program cannot be effectively recycled, resulting in an increase of a resident memory. In addition, the GC performance of different third-party applications is greatly different, and the GC efficiency of part of the applications is low. It can be understood that the volume of the installation package corresponding to the application with light load is smaller, for example, the volume of the corresponding installation package is smaller than the set second volume threshold, and the first volume threshold is larger than the second volume threshold. Further illustratively, the newly added memory occupation amount of the heavily loaded application program per unit time is smaller than a second memory threshold, and the first memory threshold is larger than the second memory threshold. Further illustratively, the system resource occupied by the electronic device when running the heavily loaded application is smaller than a second preset load threshold, and the first preset load threshold is larger than the second preset load threshold. Further illustratively, the memory access frequency is lower than the second frequency value during the running of the lightly loaded application. The first frequency value is greater than the second frequency value.
Aiming at the problem of excessive resident memory, the electronic device can perform active GC. The active GC may be when an application has not been GC for a long time (e.g., when the time for which the GC is not executed exceeds a specified time), the electronic device actively performs GC for the application. In addition to active GC, the electronic device may provide various GC modes, such as split-band GC and full-scale GC.
In summary, with the same set of GC-related parameters, the number of banded GCs and full-scale GCs enabled by the heavy-duty application is greater, and the number of active GCs is less. The number of active GCs enabled by lightly loaded applications is greater. In addition, active GC also causes an increase in system power consumption of the electronic device.
In order to solve the foregoing problems, an embodiment of the present invention provides a method for recovering memory garbage, which is applied to an electronic device. According to the method, different GC related parameters are matched for different application programs, different GC waterlines can be configured for different types of application programs, the GC waterlines configured in the mode are more targeted, and compared with the mode that a unified GC waterline value is set in a traditional scheme, the method can reduce the occupation of resources by frequent GC, more targeted GC processing is carried out, the occupation of the resources is reduced, and the power consumption is reduced by flexibly setting different waterlines for different applications.
Illustratively, the electronic device may be a mobile phone, a tablet computer, a laptop, a handheld computer, a notebook, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), an Augmented Reality (AR) device, a Virtual Reality (VR) device, or other android devices, and the like, and the embodiment of the present application is not particularly limited to the specific form of the electronic device.
Please refer to fig. 4, which is a schematic structural diagram of an electronic device 100 according to an embodiment of the present disclosure.
As shown in fig. 4, the electronic device 100 may include: the mobile terminal includes a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like.
The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
It is to be understood that the illustrated structure of the present embodiment does not constitute a specific limitation to the electronic apparatus 100. In other embodiments, electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the time sequence signal to finish the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
It should be understood that the interface connection relationship between the modules illustrated in the present embodiment is only an exemplary illustration, and does not limit the structure of the electronic device 100. In other embodiments, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may be a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-o led, a quantum dot light-emitting diode (QLED), or the like.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, electronic device 100 may include N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The following describes implementation details of the memory garbage recycling method provided in the embodiment of the present application with reference to the accompanying drawings.
In an embodiment of the present application, as shown in fig. 5, the method for recovering memory garbage includes:
s101, when the application program 1 starts to run, the identifier 1 of the application program 1 is obtained.
Wherein, the identifier 1 can uniquely indicate the application program 1. For example, the identifier 1 may be an application name corresponding to the application program 1. Further, for example, the identifier 1 may also be a process name corresponding to the application program 1, that is, a name of an application process created when the application program 1 runs.
In some embodiments, the developer of application 1 may write identifier 1 in the application configuration file for application 1. The application configuration file is a program file belonging to the application program 1, and may include an executable file specific to the application program 1, for example. It can be understood that when the electronic device creates an application process corresponding to the application program 1, the application configuration file corresponding to the application program 1 needs to be parsed. When the corresponding application configuration file is analyzed, the electronic device may obtain the corresponding identifier 1.
S102, when the identifier 1 belongs to the pre-configuration list, inquiring the GC related parameter 1 corresponding to the identifier 1.
In some embodiments, the electronic device includes a set of applications that may indicate all applications that require configuration of the dedicated GC-related parameters. In some embodiments, the application set may be a preconfigured list, or may be an application list integrated in a program file, which is not limited in this application embodiment, and in the following embodiments, the preconfigured list is mainly used as an example for description.
In some embodiments, the application set may be configured by a system developer of the electronic device, and before the system developer does not add a newly published application to the application set, the newly published application does not belong to the application set, and the application set does not include a dedicated GC related parameter corresponding to the newly published application.
In addition, if the size of the installation package corresponding to the application program is between the first volume threshold and the second volume threshold, the application program may not be put into the application set.
If the newly added memory occupation amount of the application program in the unit time is between the first memory threshold value and the second memory threshold value, the application program can not be put into the application set.
The application may also be excluded from the set of applications if the frequency of access to the memory space by the application is based between the first frequency value and the second frequency value.
In addition, the application is not frequently used, the average time length of single running is short, or the application program with low downloading amount is not required to be put into the application set. It is understood that the manner of assessing whether the application usage frequency is high and the average usage duration is short can refer to the related art, for example, mining the user usage records of each application to obtain a frequency threshold for defining the usage frequency of the application and a duration threshold for assessing the usage duration. As for the threshold of the download amount used for determining whether the download amount is low, the corresponding download threshold can be obtained by clustering the download amount of each application.
In short, the application set includes the application program specified by the system developer, and may also include the application program satisfying the first condition. The first condition may include various types of conditions, or may be preset. Illustratively, the first condition (or called a preset requirement) may be at least one of a condition for a usage frequency of the application, a condition for a running load, a condition for a size of the installation package, and the like. For example, the above condition for application usage frequency may include that the application program applies usage frequency greater than a frequency threshold of 1 or less than a frequency threshold of 2 within a specified period (e.g., one day), with frequency threshold of 1 being greater than frequency threshold of 2. The condition for the operation load may include that the number of times of accessing the memory space per unit time during the operation of the application program exceeds a first frequency value or is lower than a second frequency value. The condition for the installation package size may include that the installation package size of the application is larger than a first volume threshold or smaller than a second volume threshold, and the like.
In addition, the system developer also has the right to add an application to the set of applications if it is not satisfied with the first condition.
In some embodiments, the preconfigured list is a presence form of an application set in the electronic device, and the preconfigured list may be a parameter list parsed from the system configuration file 1, and the preconfigured list includes a plurality of identifiers and GC-related parameters corresponding to each identifier. The identifiers may indicate a plurality of application programs, and the application programs indicated by the identifiers are all applications that need to configure dedicated GC related parameters.
Exemplarily, as shown in fig. 6, the S102 may include the following sub-steps:
s102-1, the electronic device can analyze the system configuration file 1 to obtain a pre-configuration list.
As shown in fig. 6, the parsed preconfigured list includes: system _ server, health, camera, etc., the "system _ server" indicating a system service application, the "health" indicating a sports health application, and the "camera" indicating a camera application. That is, the system service application, the sports health application, and the camera application in the electronic device are all selected as applications that need to be configured with the dedicated GC related parameters.
In the preconfigured list, the GC related parameter corresponding to the identifier "system _ server" is [8M 32M 0.5], that is, the minimum reserved limit value in the GC related parameter is 8M, the maximum reserved limit value is 32M, and the space utilization rate is 0.5. The GC related parameter corresponding to the above identifier "health" is [2M 8M 0.75], that is, the minimum reservation limit value in the GC related parameter is 2M, the maximum reservation limit value is 8M, and the space utilization rate is 0.75. The GC related parameter corresponding to the above-mentioned mark "camera" is [2M 8M 0.8], that is, the minimum reservation limit value in the GC related parameter is 2M, the maximum reservation limit value is 8M, and the space utilization rate is 0.8.
S102-2, when the identifier 1 is the same as the identifier in the pre-configuration list, determining the GC-related parameter 1 according to the GC-related parameter corresponding to the identifier 1 in the pre-configuration list.
As shown in fig. 6, when identifier 1 serves as a system, the GC related parameters corresponding to identifier 1 in the preconfigured list include [8M 32M 0.5]. Thus, it can be determined that the minimum reservation limit in the GC-related parameter 1 is 8M, the maximum reservation limit is 32M, and the space utilization is 0.5.
In addition, the GC related parameter 1 may further include an exclusive spatial upper limit value. The exclusive spatial upper limit value corresponding to the GC related parameter 1 may be the same as the exclusive spatial upper limit value in the system default GC related parameter (referred to as the GC related parameter 2). It is to be understood that the GC related parameter 2 is a general GC related parameter applicable to all applications, and the GC related parameter 2 includes multiple parameters such as a minimum reserved limit, a maximum reserved limit, a space utilization rate, and an upper limit of an exclusive space. The electronic device may analyze the GC related parameter 2 from the system configuration parameters during the boot stage. The above-mentioned GC-related parameter 2 does not belong to the pre-configured list.
The GC related parameter 1 is a dedicated GC parameter suitable for system service applications. In addition, there is a difference between the GC related parameter 1 and the GC related parameter 2, for example, at least one of the corresponding minimum reserved limit, maximum reserved limit, and space utilization is different.
S103, allocating exclusive memory space for the application program 1 according to the GC related parameter 1.
In some embodiments, the electronic device first determines a memory space actually occupied by the application process corresponding to the application program 1, that is, the memory space actually occupied by the application program 1. And then, determining a reserved memory space corresponding to the application program 1 according to the real occupied memory space, the space utilization rate in the GC related parameter 1 and the maximum reserved limit value. In this way, the memory space allocated to the application 1 exclusively can be determined from the real memory space and the reserved memory space.
For example, as shown in fig. 6, when the application process corresponding to the application program 1 occupies 50M, the calculated reserved memory space is 50M according to the space utilization rate. Under the limitation that the maximum reserved limit is 32M, the actual reserved memory space can be determined to be 32M. Thus, the exclusive memory space allocated to the application 1 includes 50M of real memory space and 32M of reserved memory space.
In some examples, the size of the exclusive memory space allocated to the application program 1 may be slightly larger than 82M, for example, 83M. In other examples, the amount of memory space allocated exclusively for application 1 may be equal to 82M.
For another example, when the application process corresponding to the application program 1 occupies 20M, the calculated reserved memory space is 20M according to the space utilization rate. It is understood that 20M is smaller than the maximum reserved limit (32M) in GC-related parameter 1 and larger than the minimum reserved limit (8M) in GC-related parameter 1. The electronic device may determine that the reserved memory space allocated to the application 1 is 20M. Thus, the memory space allocated exclusively by the electronic device to the application 1 includes 20M of real memory space and 20M of reserved memory space.
For another example, when the application process corresponding to the application program 1 occupies 6M, the reserved memory space calculated according to the space utilization rate is 6M. It is understood that 6M is smaller than the minimum reservation limit in the GC related parameter 1. The electronic device may determine that the reserved memory space allocated to application 1 is equal to the minimum reserved limit (i.e., 8M) described above. Thus, the memory space allocated exclusively by the electronic device to the application 1 includes 6M of real memory space and 8M of reserved memory space.
After the exclusive memory space allocated to the application program 1 is determined, the GC waterline value corresponding to the application program 1 is determined according to the size of the exclusive memory space. Illustratively, the GC waterline value is equal to the amount of memory space allocated exclusively for application 1. As an example, when the size of the memory space exclusively allocated to the application program 1 is 82M, it is determined that the GC watermark value corresponding to the application program 1 is equal to 82M.
In this way, when the memory space actually occupied by the application 1 during the running process exceeds 82M, the electronic device may be triggered to perform GC on the application 1.
In the above embodiments, for a specific application (e.g., application 1), the electronic device may enable GC-related parameters specific to the application. The dedicated GC-related parameter may be an empirical value for the specific application. By the dedicated GC related parameter, a GC waterline value adapted to the specific application can be determined. The GC waterline value can avoid frequent GC triggering and also avoid long-term failure to trigger GC. Therefore, the system energy consumption of the electronic equipment can be effectively reduced.
In some embodiments, a heavy-load application program and a light-load application program commonly found in the electronic device may be configured as a specific application program, and then, the GC related parameters corresponding to the specific application program may be determined through a test or the like. For example, the test mode may be: for each specific application, different GC related parameters are attempted to be enabled, and the energy consumption caused during the operation of the specific application is recorded. Thus, the GC related parameter causing the lowest energy consumption can be selected as the dedicated GC related parameter corresponding to the specific application.
After determining each specific application program and the corresponding dedicated GC related parameter, an identifier corresponding to each specific application program may be obtained, and a system configuration file 1 corresponding to the pre-configured list is generated according to each identifier and the dedicated GC related parameter, and the system configuration file 1 is stored in the electronic device. In this way, the preconfigured list may include the identifier and the dedicated GC related parameter corresponding to the heavily loaded application program, or may include the identifier and the dedicated GC related parameter corresponding to the lightly loaded application program.
In some possible embodiments, the same specific application may include multiple sets of dedicated GC related parameters. Different sets of dedicated GC related parameters are suitable for specific application programs in different operation stages.
Taking an application b belonging to a heavy-load application as an example, the dedicated GC related parameters of the application b include a GC related parameter a and a GC related parameter b. Wherein, the GC related parameter a is suitable for the starting stage of the application b or the stage with lighter load. The GC related parameter b is applicable to the phase where b is heavily loaded.
In this way, the electronic device may allocate an exclusive memory space for the application b and determine a corresponding GC waterline by using the GC related parameter a at the stage of starting the application b. After that, the electronic device can distinguish whether the application b is in the heavy load stage or the light load stage according to the running time length of the application b. For example, within a time period 1 (e.g., 10 minutes) during which the application b is started, it is determined that the application b is in the light load phase. And determining that the application b is in a heavy load stage beyond the time 1 (such as 10 minutes) for starting the operation of the application b.
For example, within a time period 1 after the application b is started, for example, within 10 minutes after the application b is started and run, the GC related parameter a is used to allocate an exclusive memory space for the application b, and a corresponding GC water line value is determined. After the duration 1 of the application b is started, for example, after the application b is started and runs for 10 minutes, if the GC is triggered, allocating an exclusive memory space for the application b by using the GC related parameter b, and determining a corresponding GC waterline value.
In other embodiments, the electronic device may further determine whether the application b operates in the heavy load stage or the light load stage according to a change condition of the memory space actually occupied by the application program.
Illustratively, when an application b is started, the electronic device determines an exclusive memory space and a corresponding GC water line value for the application b according to the GC related parameter a. And then, the electronic equipment periodically acquires the space size of the real occupied memory space corresponding to the application b. In this way, the electronic device can calculate the change rate of the real memory space occupied by the application b in unit time, that is, the ratio between the difference of the space size acquired in two adjacent times and the corresponding acquisition time interval. For example, the space size of the real occupied memory space corresponding to the application b acquired this time is 56M, the space size of the real occupied memory space corresponding to the application b acquired last time is 52M, and if the time interval between two acquisitions is 2s, the corresponding change rate is 2M/s. In this way, the electronics can obtain the latest derived rate of change before each application b triggers the GC. And if the change rate is greater than the threshold value 1, determining that the GC-related parameter corresponding to the application b is the GC-related parameter b. And if the change rate is not greater than the threshold value 1, determining that the GC related parameter corresponding to the application b is the GC related parameter a.
In some scenarios, a first application and a second application are installed in the electronic device. The first application and the second application are both located in a preset application set, but the first application and the second application are different. Illustratively, the difference between the first application and the second application may be at least one of:
(1) The first application may be a heavy-load application program, and the second application may be a light-load application program.
(2) The size of the first application installation package is larger than that of the second application installation package.
(3) During the operation period, the memory occupation amount newly increased in the first application unit time is larger than the memory occupation amount newly increased in the second application unit time.
(4) The running load (the occupancy of system resources) of the first application is greater than the running load of the second application.
(5) During the operation period, the memory access frequency of the first application unit time is higher than that of the second application unit time.
Illustratively, the first application may require a social application to be executed in foreground for a long time, and the second application may be a clock application or a weather application provided by the system.
In addition, the multiple identifiers included in the preconfigured list may also be referred to as multiple application identifiers. The application identifiers include a first identifier indicating a first application and a second identifier indicating a second application. In some embodiments, the electronic device receives a first operation of the user for the first application, where the first operation may indicate to run the first application, for example, an operation of clicking an application icon of the first application. Then, the electronic device starts the first application in response to the first operation. In this way, the first application also enters the run state.
During the running of the first application, the electronic device performs GC for the first application multiple times. After the first application is subjected to the i-th garbage recycling processing, if the size of the memory space occupied by the first application is a first memory value, the electronic device sets a first preset threshold (namely, a GC waterline) for the first application according to the first memory value. Therefore, after the size of the memory occupied by the first application reaches a first preset threshold value from the first memory value, the i +1 th time of garbage recycling processing for the first application is triggered.
In some embodiments, the electronic device receives a second operation of the user for the second application, where the second operation may indicate to run the second application, for example, an operation of clicking an application icon of the second application. Then, the electronic device starts the second application in response to the second operation. In this way, the second application also enters the run state.
Likewise, during the running of the second application, the electronic device may perform GC for the second application multiple times. After the second application is subjected to the jth garbage collection processing, if the size of the memory space occupied by the second application is also the first memory value, the electronic device sets a second preset threshold (that is, a GC waterline) for the second application according to the first memory value. In this way, after the size of the memory occupied by the second application reaches the second preset threshold value from the first memory value, the (j + 1) th garbage collection processing for the second application is triggered.
However, since the first application and the second application are both located in the application set and correspond to the respective dedicated GC related parameters, even though the memory space actually occupied by the GC of the first application and the GC of the second application is the same, the GC pipelines allocated to the first application and the second application are different. In addition, due to the aforementioned difference between the first application and the second application, the first preset threshold may be greater than the second preset threshold.
In the embodiment of the present application, when the first application is a heavy-load application and the second application is a light-load application, a higher GC waterline is configured for the first application, so that the first application can be prevented from frequently triggering the GC, compared to a case where the GC waterline is configured uniformly by using the same GC-related parameter. And a lower GC parameter can be configured for the second application, so that the situation that the second application cannot GC during the running period of the second application, the memory space occupied by the second application cannot be effectively recycled, and the resident memory in the system is too much.
In addition, after the first application performs GC each time, if the occupied memory space is different in size, the GC waterlines configured for the first application by the electronic device are also different. For example, after the first application is subjected to the i +1 th garbage collection processing in the running process, the size of the memory space occupied by the first application is a third memory value. And when the size of the memory occupied by the first application reaches a fourth preset threshold (GC waterline) from the third memory value, carrying out (i + 2) th garbage recycling treatment on the first application. The first memory value is different from the third memory value, and the fourth preset threshold value is different from the first preset threshold value.
After the second application performs GC each time, if the occupied memory space is different in size, the GC waterlines configured for the second application by the electronic equipment are also different. For example, after the second application is subjected to the (j + 1) th garbage collection processing in the running process, the size of the memory space occupied by the second application is a fourth memory value. And when the size of the memory occupied by the second application reaches a fifth preset threshold (GC waterline) from a fourth memory value, performing garbage recycling treatment for the (i + 2) th time aiming at the second application. The first memory value is different from the fourth memory value, and the fifth preset threshold value is different from the second preset threshold value.
In addition, i and j are positive integers greater than 0, which may be the same or different, and this is not limited in this application.
In some embodiments, a first mapping relationship is satisfied between the first memory value and the first preset threshold, a first mapping relationship is also satisfied between the third memory value and the fourth preset threshold, the first mapping relationship is used to indicate a correspondence relationship between different memory values and different preset thresholds, the first mapping relationship is determined based on a first parameter corresponding to the first application, and the first parameter includes a first maximum threshold, a first minimum threshold, and a first scale factor between the memory values and the preset thresholds. The first maximum threshold, the first minimum threshold, and the first scale factor may be determined according to the GC related parameter corresponding to the first application, for example, the first maximum threshold may be an upper limit value of an exclusive space corresponding to the first application, and the first minimum threshold may be a minimum reserved limit value corresponding to the first application. The first scale factor may be obtained by converting a space utilization rate corresponding to the first application. It will be appreciated that the space utilization may indicate a rate of change between real memory space and reserved memory space, and the first scale factor is a rate of change between exclusive memory space (sum of real memory space and reserved memory space) and real memory space. In addition, the first mapping relationship may be a piecewise linear function, and at different stages, the correspondence between the memory value and the preset threshold value is different.
In some embodiments, for an application that does not need to use dedicated GC related parameters, the corresponding exclusive memory space and GC waterline values may be determined by directly using the system default GC related parameters. In addition, the default GC related parameter of the system may be referred to as a fourth parameter. For example, as shown in fig. 5, the method further includes:
and S104, acquiring the identifier 2 of the application program 2 when the application program 2 starts running.
In some embodiments, the identifier 2 may uniquely indicate the application 2. For example, the identifier 2 may be an application name corresponding to the application program 2. For another example, the identifier 2 may also be a process name corresponding to the application program 2, that is, a name of an application process created when the application program 2 runs.
And S105, when the identifier 2 does not belong to the pre-configured list, determining the exclusive memory space allocated to the application program 2 according to the default GC related parameter 2. Exemplarily, as shown in fig. 7, the above S105 may include the following sub-steps:
s105-1, the electronic device may obtain a preconfigured list.
In some embodiments, the preconfigured list is obtained directly if system profile 1 has already been parsed. If the system profile 1 has not been parsed, the system profile 1 is parsed first, resulting in the preconfigured list.
S105-2, when the identification 2 is not the same as the identification in the pre-configuration list, acquiring a GC related parameter 2.
As shown in fig. 7, when the identifier 2 is "chat", the identifier "chat" is not included in the preconfigured list. In this way, the electronic device may query the GC related parameter 2 analyzed at the power-on stage. It is understood that when the identifier 2 is "chat", it may indicate that the application 2 belongs to a chat application, and further, since the identifier "chat" is not included in the preconfigured list, it indicates that the application 2 does not belong to an application that requires dedicated GC related parameters, i.e., for the application 2, the GC related parameter 2 that is default by the system is the most suitable GC related parameter.
And S105-3, determining the reserved memory space allocated to the application program 2 according to the GC related parameter 2 and the real memory space corresponding to the application program 2.
For example, as shown in fig. 7, GC related parameter 2 includes a minimum reserved limit of 2M, a maximum reserved limit of 12M, a space utilization rate of 0.8, and an exclusive space upper limit of 512M. And under the condition that the application process corresponding to the application program 2 occupies 50M, calculating the reserved memory space to be 12.5M according to the space utilization rate. Under the limit of a maximum reserved limit (e.g., 12M), the actual reserved memory space may be determined to be 12M.
For another example, when the application process corresponding to the application program 2 occupies 40M, the calculated reserved memory space is 10M according to the space utilization rate. It is understood that 10M is smaller than the maximum reserved limit (12M) in the GC related parameter 2 and larger than the minimum reserved limit (2M) in the GC related parameter 2. The electronic device may determine that the reserved memory space allocated to the application 2 is 10M.
For another example, when the application process corresponding to the application program 2 occupies 6M, the reserved memory space calculated according to the space utilization rate is 1.5M. It is understood that 1.5M is smaller than the minimum reservation limit (2M) in the GC related parameter 2. The electronic device may determine that the reserved memory space allocated to application 2 is equal to the minimum reserved limit (i.e., 2M) described above.
In this way, the electronic device determines the exclusive memory space allocated to the application program 2 according to the occupied memory space and the reserved memory space corresponding to the application program 2.
In some embodiments, the memory space allocated exclusively for application 2 includes real memory space and reserved memory space. Illustratively, the amount of memory space allocated exclusively for application 2 may be equal to the sum of real memory space and reserved memory space. Also illustratively, the size of the memory space allocated exclusively for the application 2 may be slightly larger than the sum of the real memory space and the reserved memory space.
In this way, the electronic device may determine the GC water line value corresponding to the application 2 according to the size of the exclusive memory space allocated to the application 2. The GC for application 2 may be triggered when the real memory space corresponding to application 2 is greater than or equal to the corresponding GC waterline value.
In other embodiments, the preconfigured list does not include application icons (e.g., referred to as third identifiers) for the third application and the fourth application, i.e., the third application and the fourth application do not belong to the preset set of applications.
In some embodiments, the electronic device receives a third operation of the user for the third application, where the third operation may indicate to run the third application, for example, an operation of clicking an application icon of the third application. Then, the electronic device starts the third application in response to a third operation. In this way, the third application also enters the run state.
During the running of the third application, the electronic device may perform GC for the third application multiple times. After the third application is subjected to the m-th garbage collection processing, if the size of the memory space occupied by the third application is a second memory value, the electronic device sets a third preset threshold (that is, a GC waterline) for the third application according to the second memory value. In this way, after the size of the memory occupied by the third application reaches a third preset threshold from the second memory value, the m +1 th garbage collection processing for the third application is triggered.
In some embodiments, the electronic device receives a fourth operation of the user for the fourth application, where the fourth operation may indicate to run the fourth application, for example, an operation of clicking an application icon of the fourth application. Then, the electronic device starts the fourth application in response to a fourth operation. In this way, the fourth application also enters the running state.
During the running of the fourth application, the electronic device may perform GC for the fourth application multiple times. After the fourth application is subjected to the n-th garbage collection processing, if the size of the memory space occupied by the fourth application is also the second memory value, the electronic device sets a third preset threshold (that is, a GC waterline) for the fourth application according to the second memory value. In this way, after the size of the memory occupied by the fourth application reaches a third preset threshold from the second memory value, the n +1 th garbage collection processing for the fourth application is triggered.
That is, for application programs that do not belong to the application set, even if there is a difference between the third application and the fourth application, for example, similar to the difference between the first application and the second application, the electronic device sets a GC watermark for the third application and the fourth application according to the same GC-related parameters.
In addition, m and n are positive integers greater than 0, which may be the same or different, and are not limited in the present embodiment.
In some embodiments, a second mapping relationship is satisfied between the first memory value and the second preset threshold, and a second mapping relationship is also satisfied between the fourth memory value and the fifth preset threshold, where the second mapping relationship is used to indicate a correspondence relationship between different memory values and different preset thresholds, and the second mapping relationship is determined based on a second parameter corresponding to the second application, where the second parameter includes a second maximum threshold, a second minimum threshold, and a second scaling factor between the memory values and the preset thresholds.
The second maximum threshold, the second minimum threshold, and the second scaling factor may be determined according to the GC related parameter corresponding to the second application, for example, the second maximum threshold may be an upper limit value of an exclusive space corresponding to the second application, and the second minimum threshold may be a minimum reserved limit value corresponding to the second application. The second scale factor may be obtained by converting a space utilization rate corresponding to the second application. In addition, the second mapping relationship may be a piecewise linear function, and at different stages, the correspondence between the memory value and the preset threshold value is different.
As an implementation, the above method may be coordinated by a plurality of software modules in the electronic device. Illustratively, the electronic device may include an incubator, a device initialization, a runtime (run time), a memory management module, and a parameter management module. The incubator is used for instructing the running to incubate the application process corresponding to each application program. The device is initialized for creating a virtual machine for running an incubation process. And the operation is used for hatching the application process corresponding to each application program. The memory management module is configured to configure GC related parameters corresponding to each application program, and execute GC and the like. The parameter management module is used for analyzing the system configuration file to obtain the pre-configuration list.
In some embodiments, after the electronic device is powered on, as shown in fig. 8, the process of allocating the memory space is as follows:
s1, equipment initialization indicates that a virtual machine is created in operation.
And S2, after the virtual machine is created in operation, creating an incubation process.
It is understood that the application program includes a common file in the program file. The common file may be an executable file required by all applications installed in the electronic device. For example, a system configuration file 2 may be included, and the system configuration file 2 includes a system default GC related parameter.
In some embodiments, the runtime may create the hatching process by parsing the common file. In addition, the space occupied by the hatching process in the internal storage may be referred to as a memory space 2, and the electronic device may store the data obtained by parsing the common file in the memory space 2, for example, may write the parsed system default GC related parameters into the memory space 2. Of course, the electronic device may also write data generated during the operation of the hatching process into the memory space 2.
And S3, initializing an incubation process during operation.
In some embodiments, the implementation process of S3 may refer to related technologies, which are not described herein.
And S4, sending the default GC related parameters and the system configuration file 1 to the memory management module during running.
In some embodiments, by sending the system default GC related parameter to the memory management module, it may be instructed to configure the GC related parameter corresponding to the hatching process as the system default GC related parameter. In this way, when GC is performed for hatching progress, GC related parameters of system default can be utilized. In addition, the memory management module is instructed to trigger the parameter management module to analyze the system configuration file 1 by sending the system configuration file 1 to the memory management module.
And S5, the memory management module sends a system configuration file 1 to the parameter management module.
And S6, analyzing the system configuration file 1 by the parameter management module to obtain a pre-configuration list and storing the pre-configuration list.
In some embodiments, the above S1 and S6 belong to steps executed by the electronic device in the hatching start stage, for example, may occur in a scenario of turning on the electronic device. After the above steps, the runtime may complete the creation of the incubator. After the incubator creation is completed, an application start phase is entered. In this stage, the electronic device may create a process corresponding to the other application through the incubator. That is, the above method may further include:
and S7, responding to the operation of starting the application program 1, and the incubator instructs the runtime to create the application process a corresponding to the application program 1.
And S8, creating an application process a according to the hatching process and the special executable file corresponding to the application program 1 during running.
In some embodiments, the runtime may access the memory space 2 occupied by the hatching process and copy the data in the memory space 2 to the memory space 3, where the memory space 3 and the memory space 2 are different storage areas in the internal storage. For example, as shown in fig. 9, the internal memory includes a memory space 2, and the memory space 2 is a memory area occupied by the hatching process. When the application process a is created during operation, the data stored in the memory space 2 is copied to the memory space 3, and then the dedicated executable file corresponding to the application program 1 is analyzed in the memory space 3, so that the application process a occupying the memory space 3 can be created, and the application program 1 can also start to provide corresponding services for users.
And S9, transmitting the identifier 1 corresponding to the application program 1 to the parameter management module during running.
S10, the parameter management module determines GC related parameters 1 corresponding to the identifier 1.
In some embodiments, the corresponding GC related parameter 1 may be queried from the preconfigured list using identity 1.
S11, the parameter management module sends the GC related parameter 1 to the memory management module.
S12, the memory management module configures the GC related parameters of the application process a into GC related parameters 1.
And S13, in response to the operation of starting the application program 2, the incubator instructs the runtime to create the application process b corresponding to the application program 2.
And S14, creating an application process b according to the hatching process and the special executable file corresponding to the application program 2 during running.
In some embodiments, the runtime may access the memory space 2 occupied by the hatching process and copy the data in the memory space 2 to the memory space 4, where the memory space 4 and the memory space 2 are different storage areas in the internal storage. Then, in the memory space 4, the dedicated executable file corresponding to the application program 2 is analyzed, so that an application process b occupying the memory space 4 can be created, and the application program 2 can also start to provide corresponding services to the user.
And S15, sending the identifier 2 corresponding to the application program 2 to a parameter management module during running.
S16, the parameter management module determines that identity 2 does not belong to the preconfigured list.
In some embodiments, the parameter management module queries that the preconfigured list does not contain the identifier 2, and determines that the identifier 2 does not belong to the preconfigured list, so that the process is ended, since the hatching process and the same GC related parameter of the system are adopted, in an application process b hatched through the hatching process, under the condition that the GC related parameter is not reconfigured, the application program 2 and the hatching process and the same GC related parameter of the system are adopted.
The difference between the method provided by the application and the method not provided by the application used by the electronic device (such as a mobile phone) is introduced according to the GC frequency and the memory occupation condition in the actual operation process of each type of application.
Illustratively, third party application micro blogging (TM), which is common in electronic devices, belongs to heavily loaded applications. The method comprises the following steps of testing a scene (for example, referred to as a scene 1) of the electronic device using the method provided by the application and a scene (for example, referred to as a scene 2) of the electronic device not using the method provided by the application by using a microblog TM as a test object, wherein the test result is shown in the following table 1:
TABLE 1
Figure BDA0003876266180000171
The GC interval is the interval duration between two adjacent GCs, the GC average time is the average value of the durations occupied by the single GC, the GC times are the total GC times in the microblog TM running period, and the total GC time is the total actual GC execution time in the microblog TM running period.
Obviously, according to the test results in table 1, compared with the method without the application, after the method provided by the application is used, within the same running time, the GC interval of the electronic device for the microblog TM is longer, the GC times are fewer, and although the average GC time is slightly longer, the total GC time is shorter, that is, the problem of frequent GC for heavy load application of a third party is obviously improved, and the occupation time of the system resources by the GC is effectively reduced.
Also illustratively, a system service (system server) in an electronic device belongs to a heavily loaded system application. Taking a system server as a test object, testing a scenario (for example, referred to as scenario 1) of an electronic device using the method provided by the present application and a scenario (for example, referred to as scenario 2) of the electronic device not using the method provided by the present application, where the test results are shown in table 2 below for GC cases corresponding to the system server:
TABLE 2
system server Number of GC cycles GC interval(s) GC Total duration(s)
Scene 2 3102 65.79 68919
Scene 1 1796 163.97 38172
As can be seen from the test results in table 2, compared with the method without using the present application, after the method provided by the present application is used, in the same running time, the GC interval of the electronic device for the system server is longer, the GC frequency is less, and the total GC time is shorter, that is, the problem of frequent GC applied by the heavy-load system is obviously improved, and the occupation time of the GC on the system resources is effectively reduced.
Also exemplarily, the process com. Using com.android.phone as a test object, testing a scenario (for example, referred to as scenario 1) where the electronic device uses the method provided by the present application and a scenario (for example, referred to as scenario 2) where the electronic device does not use the method provided by the present application, and testing results of GC corresponding to com.android.phone are shown in table 3 below:
TABLE 3
com.android.phone Size of the resident memory
Scene
2 69M
Scene 1 47M
As can be seen from the test results in table 3, compared to the method without the application, the com phone has less resident memory after the application of the method within the same operation time. That is, the problem that the application with light load cannot trigger the GC for a long time, resulting in an excessively large resident memory, is significantly improved.
An embodiment of the present application further provides an electronic device, which may include: a memory and one or more processors. The memory is coupled to the processor. The memory is for storing computer program code comprising computer instructions. The computer instructions, when executed by the processor, may cause the electronic device to perform the various steps in the embodiments described above. Of course, the electronic device includes, but is not limited to, the above-described memory and one or more processors.
The embodiment of the present application further provides a chip system, which may be applied to the terminal device in the foregoing embodiment. As shown in FIG. 10, the system-on-chip includes at least one processor 2201 and at least one interface circuit 2202. The processor 2201 may be a processor in the electronic device described above. The processor 2201 and the interface circuit 2202 may be interconnected by wires. The processor 2201 may receive and execute computer instructions from the memory of the electronic device described above via the interface circuit 2202. The computer instructions, when executed by the processor 2201, may cause the electronic device to perform the various steps in the embodiments described above. Of course, the chip system may further include other discrete devices, which is not specifically limited in this embodiment of the present application.
In some embodiments, it is clear to those skilled in the art from the foregoing description of the embodiments that, for convenience and simplicity of description, the above division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
Each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or all or part of the technical solutions may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
The above description is only a specific implementation of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. A method for recovering memory garbage is applied to electronic equipment, and the method comprises the following steps:
receiving a first operation of a user for a first application;
responding to the first operation, starting the first application, wherein the size of a memory space occupied by the first application after the first application is subjected to the i-time garbage recycling treatment in the running process is a first memory numerical value, and i is a positive integer;
when the size of the memory occupied by the first application reaches a first preset threshold value from the first memory value, performing garbage recycling treatment for the (i + 1) th time aiming at the first application;
receiving a second operation of the user for a second application;
responding to the second operation, starting the second application, wherein the size of a memory space occupied by the second application after the j-th garbage recycling processing in the running process of the second application is the first memory numerical value, and j is a positive integer;
and when the memory size occupied by the second application reaches a second preset threshold value from the first memory value, performing (j + 1) th garbage recycling processing on the second application, wherein the second preset threshold value is smaller than the first preset threshold value, and the size of the application program installation package of the second application is smaller than that of the application program installation package of the first application.
2. The method of claim 1, wherein the first application and the second application are applications in a preset set of applications in the electronic device.
3. The method of claim 2, further comprising a third application and a fourth application in the electronic device, the third application and the fourth application being applications outside the preset set of applications, the method further comprising:
receiving a third operation of the user for the third application;
responding to the third operation, starting the third application, wherein the size of a memory space occupied by the third application after the m-th garbage recycling treatment in the running process of the third application is a second memory numerical value, and m is a positive integer;
when the size of the memory occupied by the third application reaches a third preset threshold value from the second memory value, performing m + 1-time garbage recycling treatment on the third application;
receiving a fourth operation of the user for the fourth application;
responding to the fourth operation, starting the fourth application, wherein the size of a memory space occupied by the fourth application after the nth garbage recycling processing in the running process of the fourth application is the second memory numerical value, and n is a positive integer;
and when the size of the memory occupied by the fourth application reaches the third preset threshold value from the second memory value, performing n + 1-time garbage recycling processing on the fourth application, wherein the size of the application program installation package of the third application is larger than that of the application program installation package of the fourth application.
4. The method according to any one of claims 1 to 3, wherein after the first application is subjected to i +1 th garbage collection processing in the running process, the size of the memory space occupied by the first application is a third memory value, and the method further comprises:
when the size of the memory occupied by the first application reaches a fourth preset threshold value from the third memory value, performing garbage recycling treatment for the (i + 2) th time aiming at the first application; the first memory value is different from the third memory value, and the fourth preset threshold is different from the first preset threshold.
5. The method according to claim 4, wherein a first mapping relationship is satisfied between the first memory value and the first preset threshold, the first mapping relationship is also satisfied between the third memory value and the fourth preset threshold, the first mapping relationship is used to indicate a corresponding relationship between different memory values and different preset thresholds, the first mapping relationship is determined based on a first parameter corresponding to the first application, the first parameter includes a first maximum threshold, a first minimum threshold, and a first scale factor between a memory value and a preset threshold.
6. The method according to any one of claims 1 to 3, wherein after the second application is subjected to a j +1 th garbage collection process during the operation process, the size of the memory space occupied by the second application is a fourth memory value, and the method further comprises:
when the size of the memory occupied by the second application reaches a fifth preset threshold value from the fourth memory value, performing garbage recycling processing for the (j + 2) th time aiming at the second application; the first memory value is different from the fourth memory value, and the fifth preset threshold is different from the second preset threshold.
7. The method according to claim 6, wherein a second mapping relationship is satisfied between the first memory value and the second preset threshold, the second mapping relationship is also satisfied between the fourth memory value and the fifth preset threshold, the second mapping relationship is used to indicate a corresponding relationship between different memory values and different preset thresholds, the second mapping relationship is determined based on a second parameter corresponding to the second application, and the second parameter includes a second maximum threshold, a second minimum threshold, and a second scaling factor between a memory value and a preset threshold.
8. The method of any of claims 1-7, wherein the first application is a social application and the second application is a clock application or a weather application.
9. The method of claim 2 or 3, wherein the set of applications comprises preconfigured applications, or wherein the set of applications comprises applications with at least one of application usage frequency, application load size, and application installation package size meeting preset requirements.
10. An electronic device, characterized in that the electronic device comprises one or more processors and memory; the memory is coupled to the processor, the memory for storing computer program code, the computer program code comprising computer instructions, which when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-9.
11. A computer storage medium comprising computer instructions that, when executed on an electronic device, cause the electronic device to perform the method of any of claims 1-9.
12. A computer program product, characterized in that the computer program product comprises a computer program which, when run on a computer, causes the computer to perform the method according to any one of claims 1-9.
CN202211214485.5A 2022-09-30 2022-09-30 Memory garbage recycling method and electronic equipment Pending CN115543864A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202310182903.5A CN116361200B (en) 2022-09-30 2022-09-30 Memory garbage recycling method and electronic equipment
CN202211214485.5A CN115543864A (en) 2022-09-30 2022-09-30 Memory garbage recycling method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211214485.5A CN115543864A (en) 2022-09-30 2022-09-30 Memory garbage recycling method and electronic equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202310182903.5A Division CN116361200B (en) 2022-09-30 2022-09-30 Memory garbage recycling method and electronic equipment

Publications (1)

Publication Number Publication Date
CN115543864A true CN115543864A (en) 2022-12-30

Family

ID=84732055

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202310182903.5A Active CN116361200B (en) 2022-09-30 2022-09-30 Memory garbage recycling method and electronic equipment
CN202211214485.5A Pending CN115543864A (en) 2022-09-30 2022-09-30 Memory garbage recycling method and electronic equipment

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202310182903.5A Active CN116361200B (en) 2022-09-30 2022-09-30 Memory garbage recycling method and electronic equipment

Country Status (1)

Country Link
CN (2) CN116361200B (en)

Family Cites Families (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309740B (en) * 2013-06-05 2016-12-28 腾讯科技(深圳)有限公司 Program starts method, device and equipment
US9146862B2 (en) * 2013-07-18 2015-09-29 International Business Machines Corporation Optimizing memory usage across multiple garbage collected computer environments
US9710379B2 (en) * 2015-02-27 2017-07-18 International Business Machines Corporation Tuning utilization and heap memory size for real-time garbage collection
CN109117242A (en) * 2017-06-22 2019-01-01 龙芯中科技术有限公司 Virtual machine garbage reclamation tuning method, apparatus, electronic equipment and storage medium
CN108228341B (en) * 2017-08-07 2021-03-02 珠海市魅族科技有限公司 Memory recovery method and device, terminal equipment and computer readable storage medium
CN108228449B (en) * 2017-08-15 2021-02-19 珠海市魅族科技有限公司 Terminal device control method and device, terminal device and computer readable storage medium
CN108121602B (en) * 2017-12-14 2022-05-06 捷开通讯(深圳)有限公司 Method for determining garbage collection trigger point, electronic equipment and storage medium
US10802836B2 (en) * 2018-10-19 2020-10-13 Oracle International Corporation Intelligently determining a virtual machine configuration during runtime based on garbage collection characteristics
CN109857555B (en) * 2019-01-15 2023-02-28 Oppo广东移动通信有限公司 Memory recovery method and device, storage medium and electronic equipment
CN112615947B (en) * 2019-09-18 2022-03-25 华为技术有限公司 Method for rapidly entering application and folding screen electronic equipment
CN110704191A (en) * 2019-09-29 2020-01-17 Oppo广东移动通信有限公司 Game optimization method, game optimization device and mobile terminal
CN112764891B (en) * 2019-10-21 2022-11-11 青岛海信移动通信技术股份有限公司 Electronic terminal and method for controlling application
CN110888746B (en) * 2019-12-10 2023-06-02 Oppo(重庆)智能科技有限公司 Memory management method and device, storage medium and electronic equipment
CN111258921B (en) * 2020-01-14 2024-01-26 Oppo广东移动通信有限公司 Garbage memory recycling method and device, electronic equipment and storage medium
CN111338796B (en) * 2020-02-18 2023-07-18 广州虎牙科技有限公司 Application memory optimization method and device, terminal equipment and readable storage medium
CN114721812A (en) * 2021-01-04 2022-07-08 华为技术有限公司 Memory release method and related equipment
US11494299B2 (en) * 2021-02-18 2022-11-08 Silicon Motion, Inc. Garbage collection operation management with early garbage collection starting point
CN116107922A (en) * 2021-09-30 2023-05-12 荣耀终端有限公司 Application management method and electronic device
CN115016885B (en) * 2021-11-19 2023-11-24 荣耀终端有限公司 Virtual machine garbage recycling operation method and electronic equipment
CN114265495A (en) * 2021-11-22 2022-04-01 上海小传科技有限公司 Application program processing method, intelligent terminal and storage medium

Also Published As

Publication number Publication date
CN116361200A (en) 2023-06-30
CN116361200B (en) 2023-11-14

Similar Documents

Publication Publication Date Title
CN110147251B (en) System, chip and calculation method for calculating neural network model
CN111045814B (en) Resource scheduling method and terminal equipment
WO2020042112A1 (en) Terminal and method for evaluating and testing ai task supporting capability of terminal
WO2022179473A1 (en) Frequency adjustment method for inter-core migration
CN111382087A (en) Memory management method and electronic equipment
CN115292052A (en) Memory recovery method, electronic device and computer-readable storage medium
CN116048742B (en) Data processing method and electronic equipment
CN114816686A (en) Processing method of computing task, electronic device and storage medium
EP4280060A1 (en) Power consumption control method and apparatus
CN116361200B (en) Memory garbage recycling method and electronic equipment
CN116303110B (en) Memory garbage recycling method and electronic equipment
CN118069542A (en) Memory garbage recycling method and electronic equipment
CN114090262A (en) Object processing method and device, electronic equipment and storage medium
CN114968546A (en) Load processing method and related device
US9354812B1 (en) Dynamic memory utilization in a system on a chip
CN116027878B (en) Power consumption adjustment method and electronic equipment
CN116055443B (en) Method for identifying social scene, electronic equipment and computer readable storage medium
WO2024087840A1 (en) Resource management and control method and apparatus, chip, electronic device, and medium
CN115361285B (en) Method, device, equipment and medium for realizing off-line service mixed deployment
CN116089055B (en) Resource scheduling method and device
CN114168065B (en) Method and device for adjusting memory configuration parameters
WO2024002189A1 (en) Processor resource isolation method and apparatus, and electronic device and medium
CN115061702A (en) IDE management method and electronic equipment
CN117687772A (en) Algorithm scheduling method and electronic equipment
CN115840528A (en) Method for setting waterline of storage disc, electronic equipment 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