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

Memory garbage recycling method and electronic equipment Download PDF

Info

Publication number
CN116361200A
CN116361200A CN202310182903.5A CN202310182903A CN116361200A CN 116361200 A CN116361200 A CN 116361200A CN 202310182903 A CN202310182903 A CN 202310182903A CN 116361200 A CN116361200 A CN 116361200A
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.)
Granted
Application number
CN202310182903.5A
Other languages
Chinese (zh)
Other versions
CN116361200B (en
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
Publication of CN116361200A publication Critical patent/CN116361200A/en
Application granted granted Critical
Publication of CN116361200B publication Critical patent/CN116361200B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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 method solves the problems of high GC energy consumption and more resident memories in the electronic equipment. 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 of the first application GC is the first memory value, if the occupied memory size of the first application GC reaches a first preset threshold value from the first memory value, GC is conducted on the first application again; receiving a second operation of a user for a second application; in response to the second operation, starting the second application, and if the memory size occupied by the second application reaches a second preset threshold value from the first memory value under the condition that the memory size occupied by the second application is the first memory value after GC is performed, performing GC on the second application again, wherein the second preset threshold value is smaller than the first preset threshold value, and the size of an application program installation package of the second application is smaller than the first application.

Description

Memory garbage recycling method and electronic equipment
This application is a divisional application, the filing number of the original application is 202211214485.5, the date of the original application is 2022, 09, 30, and the entire contents of the original application are incorporated herein by reference.
Technical Field
The application relates to the technical field of terminals, in particular to a memory garbage recycling method and electronic equipment.
Background
When an application is running, it needs to occupy internal memory in the electronic device. The memory area occupied by an application in internal memory may also be referred to as memory space. As application runtime increases, the memory space occupied by the application increases. At the same time, the occupied memory space also has idle memory space which is not accessed by the application program.
In general, the electronic device may use a garbage collection (garbage collection, GC) manner to collect the idle memory space, thereby improving the utilization efficiency of the memory space in the electronic device. However, the existing memory garbage recycling method has the problem of poor recycling effect.
Disclosure of Invention
The embodiment of the application provides a memory garbage recycling method and electronic equipment, which are used for solving the problem of high GC energy consumption in the electronic equipment.
In order to achieve the above purpose, the embodiments of the present application adopt the following technical solutions:
in a first aspect, a method for recycling memory garbage provided in an embodiment of the present application is applied to an electronic device, where the method includes: receiving a first operation of a user for a first application; and responding to the first operation, starting a first application, wherein the size of a memory space occupied by the first application is a first memory value after the ith garbage collection treatment in the running process of the first application, and i is a positive integer. When the memory size occupied by the first application reaches a first preset threshold value from the first memory value, carrying out i+1st garbage collection treatment on 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 memory space occupied by the second application after the jth garbage collection treatment in the running process of the second application is the first memory 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+1th garbage collection treatment on the second application, wherein the second preset threshold value is smaller than the first preset threshold value, and the size of an application program installation package of the second application is smaller than the size of an 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 watermark values, and are applicable to a memory size threshold for evaluating whether GC is performed for an application program.
In the above method, the memory size occupied by the first application is recovered when the first memory value reaches a first preset threshold value, and the memory size occupied by the second application is recovered when the first memory value reaches a second preset threshold value, which is equivalent to setting different GC waterline values for the first application and the second application.
In the application, through distributing larger GC waterline value for the application program of the application program installation package, distributing smaller GC waterline value for the application program of the application program installation package, can more pointedly set up the GC waterline value according to the type of the application program, compare with the unified GC waterline value that sets up in traditional scheme, this application scheme sets up different waterline values for different applications through nimble, can reduce because frequent GC is to the occupation of resource, more pointedly carry out GC processing, reduce the occupation of resource, reduce the consumption.
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 set of applications preset in the electronic device.
In the embodiment, the electronic device performs GC processing on the applications in the preset application set by using different GC waterlines, so that the application with different user attention or GC processing frequency can be processed by using different GC waterlines, and the flexibility is higher.
In some embodiments, after launching the first application, the method further comprises: determining that a first application is located in an application set preset by electronic equipment; after launching the second application, the method further comprises: and determining that the second application is positioned in an application set preset by the electronic equipment.
In some embodiments, the electronic device further includes a third application and a fourth application, where the third application and the fourth application are applications that are outside the preset application set, and the method further includes:
receiving a third operation of a 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 mth garbage collection treatment in the running process of the third application is a second memory value, and m is a positive integer; when the memory size occupied by the third application reaches a third preset threshold value from the second memory value, carrying out m+1st garbage collection 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 treatment is the second memory value in the running process of the fourth application, and n is a positive integer; and when the memory size occupied by the fourth application reaches the third preset threshold value from the second memory value, carrying out n+1th garbage collection treatment on the fourth application, wherein the size of an application program installation package of the third application is larger than that of an application program installation package of the fourth application.
In the above embodiment, for some common applications, a unified GC waterline is adopted, the unified GC waterline has universality, and a large number of tests need to be performed on a single application by a dedicated GC waterline, and for the common applications, the unified 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 the i+1th garbage collection process 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 memory size occupied by the first application reaches a fourth preset threshold value from the third memory value, performing i+2th garbage collection treatment on 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 actual occupied memory is different, and the allocated GC waterline is different, so that the GC waterline can adapt to different operation phases 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 for indicating 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, and the first parameter includes a first maximum threshold, a first minimum threshold, and a first scale factor between the memory value and the preset threshold.
In some embodiments, after the j+1th garbage collection process of the second application 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 memory size occupied by the second application reaches a fifth preset threshold value from the fourth memory value, j+2th garbage collection treatment is conducted on 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 for indicating 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 scale factor between the memory value and the 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 application set includes application programs preconfigured by a developer, or the application set includes application programs of which at least one of application use frequency, application load size and application installation package size meets preset requirements. For example, the application use frequency conforms to an application of a preset use frequency condition. For another example, the application load size conforms to an application of a load evaluation condition set in advance. For another example, the application installation package size conforms to an 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 is coupled to the processor, the memory for storing computer program code comprising computer instructions that, when executed by the one or more processors, operate 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 ith garbage collection treatment in the running process of the first application is a first memory value; when the memory size occupied by the first application reaches a first preset threshold value from the first memory value, carrying out i+1st garbage collection treatment on 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 treatment 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+1th garbage collection treatment on the second application, wherein the second preset threshold value is smaller than the first preset threshold value, and the size of an application program installation package of the second application is smaller than the size of an application program installation package of the first application.
In some embodiments, the first application and the second application are applications located in a set of applications preset in the electronic device.
In some embodiments, the electronic device further includes a third application and a fourth application, where the third application and the fourth application are applications located outside the preset application set, and the one or more processors are configured to: receiving a third operation of a user for a third application; responding to the third operation, and starting the third application, wherein the size of a memory space occupied by the third application after the mth garbage collection treatment in the running process of the third application is a second memory value; when the memory size occupied by the third application reaches a third preset threshold value from the second memory value, carrying out m+1st garbage collection 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 the memory space occupied by the fourth application after the nth garbage collection treatment in the running process of the fourth application is the second memory value; and when the memory size occupied by the fourth application reaches the third preset threshold value from the second memory value, carrying out n+1th garbage collection treatment on the fourth application, wherein the size of an application program installation package of the third application is larger than that of an application program installation package of the fourth application.
In some embodiments, after the i+1th garbage collection process of the first application in the running process, the memory space occupied by the first application is a third memory value, and the one or more processors are configured to: when the memory size occupied by the first application reaches a fourth preset threshold value from the third memory value, performing i+2th garbage collection treatment on 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 for indicating 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, and the first parameter includes a first maximum threshold, a first minimum threshold, and a first scale factor between the memory value and the preset threshold.
In some embodiments, after the j+1th garbage collection process of the second application in the running process, the memory space occupied by the second application is a fourth memory value, and the one or more processors are configured to: when the memory size occupied by the second application reaches a fifth preset threshold value from the fourth memory value, j+2th garbage collection treatment is conducted on 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 for indicating 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 scale factor between the memory value and the 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 application set includes application programs preconfigured by a developer, or the application set includes application programs of which at least one of application use frequency, application load size and application installation package size meets preset requirements.
In a third aspect, embodiments of the present application provide a computer storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method of the first aspect and possible embodiments thereof.
In a fourth aspect, the present application provides a computer program product for, when run on an electronic device as described above, causing the electronic device to perform the method of the first aspect and possible embodiments thereof as described above.
It will be appreciated that the electronic device, the computer storage medium and the computer program product provided in the above aspects are all applicable to the corresponding methods provided above, and therefore, the advantages achieved by the electronic device, the computer storage medium and the computer program product may refer to the advantages in the corresponding methods provided above, and are not repeated herein.
Drawings
FIG. 1 is an exemplary diagram of an application program occupying a memory space according to an embodiment of the present application;
FIG. 2 is a diagram of an example GC provided in an embodiment of the application;
FIG. 3 is a diagram illustrating an exemplary relationship between an actual occupied memory space and a reserved memory space according to an embodiment of the present disclosure;
fig. 4 is a schematic hardware structure of an electronic device according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating steps of a method for recycling memory garbage according to an embodiment of the present disclosure;
FIG. 6 is a flow chart of substeps of S102 provided in an embodiment of the present application;
FIG. 7 is a flow chart of substeps of S105 provided in an embodiment of the present application;
fig. 8 is an exemplary diagram of an implementation of a method for recycling memory garbage according to an embodiment of the present application;
Fig. 9 is an exemplary diagram of a hatching 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
The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.
Memory in the electronic device is the basis for the running of all applications. The memory may be divided into an internal memory and an external memory. The external memory can be used for storing program files of various installed application programs. The internal memory may be used to provide the memory space that is required to be occupied during the running of the application.
In some embodiments, the electronic device may divide a block of exclusive storage area (also referred to as memory space) in internal memory for an application while the application is running. Obviously, the more applications run, the greater the internal memory footprint. Of course, the available memory space in the electronic device is limited, and under the condition that the memory space is occupied, not only other application programs which are not started cannot be started normally, but also the running effect of the started application programs is poor.
In some embodiments, the electronic device may employ a garbage collection (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 a certain application program is not accessed by the application program, that is, when an idle part appears in the memory space allocated to the certain application program, the idle memory space can be recovered by utilizing the GC algorithm, so that the recovered memory space can be used by other application programs. In addition, the above recovery of the idle memory space by the GC algorithm may be simply referred to as performing GC.
The following describes a scenario of GC algorithm usage for application a as an example:
first, when the application a starts to run, the electronic device may allocate the memory space exclusive during running for the application a.
For example, after the application a starts to run, the electronic device may determine the memory space actually occupied by the application a in the internal memory, which is simply referred to as the real memory space. It will be appreciated that the real memory space is the memory space being used by application a. Then, the electronic device may determine the reserved memory space to be allocated to the application a according to the real memory space of the application a. It will be appreciated that the reserved memory space is a memory space that can be used by 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 occupied memory space and the reserved memory space belong to the memory space exclusive to the application a. Of course, 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 application a, the memory space actually occupied by application a increases. In this scenario, application a may occupy a reserved memory space. It can be understood that the occupied portion of the reserved memory space becomes the real occupied memory space corresponding to the application a, so that as the real occupied memory space corresponding to the application a increases, 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 is smaller and smaller, and the real memory space is larger and larger. After the reserved memory space is occupied by the application a, the electronic device needs to allocate the exclusive memory space for the application a again.
In some embodiments, after each allocation of the exclusive memory space for the application a, the electronic device may determine a GC watermark value corresponding to the application a, where the GC watermark value is a threshold that triggers reallocation of the exclusive memory space. In general, the GC watermark value may be equal to the size of the memory space allocated exclusively to application a, e.g., equal to the sum of the size of the real memory space and the reserved memory space. Or slightly larger than the sum of the sizes of the real memory space and the reserved memory space.
And secondly, during the operation of the application a, the corresponding real occupied memory space gradually increases, and the real occupied memory space reaches or exceeds the corresponding GC waterline value, so that the electronic equipment can be triggered to reallocate the exclusive memory space for the application a.
In addition, a memory space that is no longer accessed (or is no longer used) by the application a may occur in the real memory space, such as a so-called 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 a GC algorithm. The process of reclaiming the free space can refer to the related art, and will not be described herein. For example, as shown in fig. 2, after the real memory space of the application a reaches 67M, if there is 17M free memory space in the real memory space, the real memory space of the application a becomes 50M after GC algorithm processing, that is, the 17M free memory space is recovered.
And then, the electronic equipment can redetermine the reserved memory space corresponding to the application a according to the real occupied memory space processed by the GC. For example, after GC, the real memory space corresponding to application a is 50M, and the electronic device may determine the reserved memory space of 5M according to the real memory space of 50M. Thus, the memory space that is reallocated to application a as exclusive is not less than 55M, for example, application a may be allocated 56M and exclusive memory space. The GC watermark value corresponding to application a may be updated to 56M. The application a exclusive 56M memory space comprises a real occupied memory space of 50M and a reserved memory space of 5M.
In this way, the electronic device can effectively manage the occupation of the internal memory by each application by using the GC algorithm.
In addition, in the above process of allocating the memory space exclusive to the application a, the electronic device needs to use multiple GC-related parameters. The GC-related parameters include one or a combination of an exclusive space upper limit, a maximum reserved limit, a minimum reserved limit, and a space utilization ratio.
The upper limit value of the exclusive space refers to the maximum value of the exclusive memory space that can be allocated to the application program, for example, the upper limit value of the exclusive space is 512M, and then the size of the exclusive memory space allocated to the single application program does not exceed 512M. For example, the exclusive spatial upper limit value may be different for lightweight applications and bulky applications. For example, the exclusive space upper limit includes an upper limit 1 (e.g., 384M) and an upper limit 2 (e.g., 512M). The upper limit value 1 is an exclusive space upper limit value for a lightweight application program. 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 belongs to a lightweight application or a bulky application, so that after the application is installed, the electronic device may determine its corresponding exclusive upper limit value according to the type of the application (whether it belongs to a lightweight or bulky application).
In some examples, if the size of the real occupied memory space corresponding to the application a exceeds the corresponding upper limit value of the exclusive space, the electronic device may display a reminder to prompt the application a that there is an abnormal memory occupancy problem.
In addition, the space utilization is used for calculating the proportion of reserved memory space on the basis of the actual occupied memory space. In other words, space utilization may characterize the relationship between real-world memory space and reserved memory space. When calculating the reserved memory space according to the real occupied memory space, the electronic device needs to ensure that the real occupied memory space and the calculated reserved memory space meet the preset condition, and the preset condition is associated with the space utilization rate. Illustratively, the sum of the real occupied memory space and the calculated reserved memory space is referred to as a memory space 1, and when the ratio of the real occupied memory space to the memory space 1 is equal to the space utilization ratio, it is determined that the preset condition is satisfied. For example, in a scenario with a space utilization of 75%, if the size of the real memory space is 75M, the size of the reserved memory space may be calculated to be 25M, so that the real 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 reservation limit, a minimum reservation limit. The maximum reservation limit indicates the maximum reserved memory space that can be allocated to an application. The minimum reservation limit indicates the minimum reserved memory space that can be allocated to an application. For example, when the maximum reserved limit value is 8M, if the calculated reserved memory space is greater than 8M according to the actual occupied memory space and the space utilization ratio, the size of the reserved memory space actually allocated is determined to be equal to 8M. For example, when the minimum reserved limit is 2M, if the calculated reserved memory space is smaller than 2M according to the actual occupied memory space and the space utilization, the size of the reserved memory space actually allocated is determined to be equal to 2M.
In summary, when the space utilization is 0.75, the maximum reservation limit is 8M, and the minimum reservation limit is 2M, the relationship between the reserved memory space and the real memory space may 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 electronic device is affected by GC-related parameters. In addition, the above GC-related parameters also affect the validation of the GC watermark value of the application. In some embodiments, all applications in the electronic device share a set of GC-related parameters.
Obviously, for a heavy-load application (such as a system service, a foreground running application, etc.), the GC watermark value determined by the GC-related parameters is lower for the application, which may cause the application to GC frequently, that is, may cause the power consumption of the electronic device to increase. Illustratively, a heavy-duty application program corresponds to a larger installation package volume, e.g., the corresponding installation package volume is greater than a set first volume threshold. Still further exemplary, the newly increased memory footprint per unit time of the heavily loaded application is greater than the first memory threshold. Still further exemplary, 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. Still further exemplary, the memory access frequency exceeds the first frequency value during the running of the heavily loaded application.
For light-load application programs (such as clock application or background application programs which are not commonly used), the GC waterline value determined by the GC related parameters is higher for the application programs, so that the application programs cannot trigger the GC for a long time, the memory space occupied by the application programs cannot be effectively recycled, and the resident memory is increased. In addition, GC performance of different third party applications is greatly different, and the phenomenon that GC efficiency of part of applications is low exists. It will be appreciated that a lightly loaded application may correspond to a smaller installation package volume, e.g., a corresponding installation package volume that is less than a set second volume threshold, the first volume threshold being greater than the second volume threshold. Still further exemplary, the newly increased memory usage per unit time of the heavily loaded application is less than a second memory threshold, where the first memory threshold is greater than the second memory threshold. Still further exemplary, the system resources occupied by the electronic device when running the heavily loaded application are less than a second preset load threshold, the first preset load threshold being greater than the second preset load threshold. Still further exemplary, 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.
The electronic device may perform active GC for the problem of excessive resident memory. The active GC may be that when the application program does not have GC for a long time (for example, when the time of not executing GC exceeds a specified duration), the electronic device actively performs GC on the application program. In addition to active GC, the electronic device may provide multiple GC modes, such as banded GC and full GC.
In summary, the number of banded GCs and full GCs enabled by a heavy duty application is greater and the number of active GCs is less with the same set of GC-related parameters. 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 improve the above problems, an embodiment of the present application provides a method for recycling memory garbage, which is applied to an electronic device. According to the method, different GC waterlines can be configured for different types of application programs by matching different GC related parameters with different application programs, the GC waterlines configured in the mode are more specific, and compared with the unified GC waterline value set in the traditional scheme, the GC waterline value setting method can reduce occupation of resources due to frequent GC, conduct GC processing more specifically, reduce occupation of resources and reduce power consumption through setting different waterline values for different applications flexibly.
Illustratively, the electronic device may be a mobile phone, a tablet computer, a laptop, a handheld computer, a notebook, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) \virtual reality (VR) device, or other android devices, etc., and the specific form of the electronic device is not limited in the embodiments of the present application.
Fig. 4 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present application.
As shown in fig. 4, the electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (universal serial bus, USB) interface 130, charge management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headset interface 170D, sensor module 180, keys 190, motor 191, indicator 192, camera 193, display 194, and subscriber identity module (subscriber identification module, SIM) card interface 195, etc.
The sensor module 180 may include a pressure sensor, a gyroscope sensor, a barometric sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity 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 structure illustrated in the present embodiment does not constitute a specific limitation on the electronic apparatus 100. In other embodiments, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the 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 the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called directly from memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the connection relationship between the modules illustrated in this embodiment is only illustrative, and does not limit the structure of the electronic device 100. In other embodiments, the electronic device 100 may also employ different interfaces in the above embodiments, or a combination of interfaces.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (flex), a mini, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize 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 the 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 onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. 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 other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
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: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
Implementation details of the memory garbage recycling method provided by the embodiment of the application are described below with reference to the accompanying drawings.
In this embodiment of the present application, as shown in fig. 5, the method for recycling the memory garbage includes:
S101, when the application 1 starts to run, the identifier 1 of the application 1 is acquired.
Wherein, the identifier 1 may uniquely indicate the application 1. The identifier 1 may be an application name corresponding to the application 1. Also, for example, the identifier 1 may also be a process name corresponding to the application 1, that is, a name of an application process created when the application 1 runs.
In some embodiments, the developer of application 1 may write identification 1 in the application profile of application 1. The application configuration file is a program file belonging to the application program 1, for example, may include an executable file dedicated to the application program 1. It will be appreciated that, when the electronic device creates the 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 can acquire the identifier 1 corresponding to the application configuration file.
S102, inquiring the GC related parameters 1 corresponding to the identification 1 when the identification 1 belongs to a pre-configuration list.
In some embodiments, an application set is included in the electronic device, which may indicate all applications that need to configure the specific 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 subsequent embodiments, description is mainly given by taking the preconfigured list as an example.
In some embodiments, the application set may be configured by a system developer of the electronic device, where before the system developer does not add the newly published application program to the application set, the newly published application program 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 program.
In addition, if the installation package volume size corresponding to the application program is between the first volume threshold value and the second volume threshold value, the application program may not be put into the application set.
If the newly increased 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 also not be put into the application set.
The application may not be put in the application set if the frequency of access of the memory space by the application is based on between the first frequency value and the second frequency value.
In addition, the application use frequency is not high, the average duration of single operation is shorter, or the application program with lower download amount can be not put into the application set. It will be appreciated that the manner in which whether the application usage frequency is high and whether the average usage time is short may refer to related techniques, such as by mining user usage records for each application program, obtaining a frequency threshold defining how high the application usage frequency is, and a duration threshold for evaluating how long the usage time is. As for the download amount threshold value for determining whether the download amount is low, the corresponding download threshold value may be obtained by clustering the download amounts of the respective application programs.
In summary, the application set includes an application program specified by a system developer, and may also include an application program that satisfies the first condition. The first condition may include a plurality of types of conditions, or may be preset. Illustratively, the above-described first condition (or referred to as a preset requirement) may be at least one of a condition for an application use frequency, a condition for an operation load, a condition for an installation package size, and the like. For example, the conditions for the application usage frequency may include the application program using a frequency greater than a frequency threshold 1 or less than a frequency threshold 2 for a specified period (e.g., one day), the frequency threshold 1 being greater than the frequency threshold 2. The condition for the operating load may include the number of accesses to the memory space per unit time exceeding the first frequency value or being lower than the second frequency value during the operation of the application. Conditions for the installation package size may include the installation package size of the application being greater than a first volume threshold or less than a second volume threshold, etc.
In addition, if an application does not meet the first condition, the system developer is also entitled to add it to the application set.
In some embodiments, the preconfigured list is a form of existence of the application set in the electronic device, and the preconfigured list may be a parameter list parsed from the system configuration file 1, where the preconfigured list includes a plurality of identifiers and GC-related parameters corresponding to each identifier. The plurality of identifiers may indicate a plurality of applications, where the plurality of applications indicated by the plurality of identifiers are applications that need to configure specific GC-related parameters.
Illustratively, as shown in fig. 6, the above S102 may include the following substeps:
s102-1, the electronic device may parse the system configuration file 1 to obtain a preconfigured list.
As shown in fig. 6, the pre-configuration list obtained by parsing includes: system service (system_server), sports health (health), camera (camera), etc., the above-mentioned identification "system_server" indicates a system service application, the above-mentioned identification "health" indicates a sports health application, and the above-mentioned identification "camera" indicates a camera application. That is, the system service application, the sports health application, and the camera application in the electronic device are all applications selected as the applications requiring configuration of the specific GC-related parameters.
In the above preconfigured list, the GC related parameter corresponding to the identifier "system_server" is [8M 32M 0.5], that is, the minimum reservation limit value in the GC related parameter is 8M, the maximum reservation limit value is 32M, and the space utilization is 0.5. The GC related parameter corresponding to the 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 is 0.75. The GC related parameter corresponding to the above-mentioned identifier "camera" is [2M 8M0.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 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 the identifier 1 is a system service, the GC-related parameters corresponding to the 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, GC-related parameter 1 may also include an exclusive spatial upper limit. The upper limit value of the exclusive space corresponding to the GC-related parameter 1 may be the same as the upper limit value of the exclusive space in the GC-related parameter (e.g., referred to as GC-related parameter 2) default by the system. It can 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 a plurality of parameters including a minimum reserved limit, a maximum reserved limit, a space utilization, and an exclusive space upper limit. The electronic device may analyze the GC-related parameter 2 from the system configuration parameters during the power-on phase. The GC-related parameter 2 described above does not belong to the preconfigured list.
The GC-related parameter 1 is a dedicated GC parameter suitable for the system service application. In addition, there is a difference between the GC-related parameters 1 and 2, for example, at least one of the corresponding minimum reservation limit, the corresponding maximum reservation limit, and the corresponding space utilization is different.
S103, according to the GC related parameters 1, exclusive memory space is allocated for the application program 1.
In some embodiments, the electronic device first determines the memory space actually occupied by the application process corresponding to the application program 1, that is, the real memory space corresponding to the application program 1. And then, determining the reserved memory space corresponding to the application program 1 according to the real occupied memory space, the space utilization rate in the GC related parameters 1 and the maximum reserved limit value. Thus, the memory space exclusively allocated to the application 1 can be determined based on 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. Under the limitation that the maximum reserved limit value is 32M, the actual reserved memory space can be determined to be 32M. Thus, the exclusive memory space allocated to application 1 includes 50M real memory space and 32M reserved memory space.
In some examples, the size of the memory space allocated to application 1 exclusive may be slightly greater than 82M, for example 83M. In other examples, the size of the exclusive memory space allocated to application 1 may be equal to 82M.
For another example, when the application process corresponding to the application program 1 already occupies 20M, the calculated reserved memory space is 20M according to the space utilization. It will be appreciated that 20M is less than the maximum reservation limit (32M) in GC-related parameter 1 and greater than the minimum reservation limit (8M) in GC-related parameter 1. The electronic device may determine that the reserved memory space allocated to application 1 is 20M. Thus, the memory space exclusively allocated by the electronic device to the application 1 includes the real memory space of 20M and the reserved memory space of 20M.
For another example, when the application process corresponding to the application program 1 occupies 6M, the calculated reserved memory space is 6M according to the space utilization. It will be appreciated that 6M is less than the minimum reservation limit in GC-related parameter 1. The electronic device may determine that the reserved memory space allocated to application 1 is equal to the minimum reservation limit described above (i.e., 8M). Thus, the memory space exclusively allocated by the electronic device to the application 1 includes 6M of real memory space and 8M of reserved memory space.
After determining the exclusive memory space allocated to the application program 1, determining the GC waterline value corresponding to the application program 1 according to the size of the exclusive memory space. Illustratively, the GC watermark value is equal to the size of the exclusive memory space allocated to application 1. For example, when the size of the exclusive memory space allocated to the application 1 is 82M, it is determined that the GC watermark value corresponding to the application 1 is 82M.
Thus, during the running of the application program 1, when the actually occupied memory space exceeds 82M, the electronic device may be triggered to GC the application program 1.
In the above embodiments, the electronic device may enable GC-related parameters specific to a particular application (e.g., application 1). The specific GC-related parameter may be an empirical value for the specific application. And determining the GC waterline value adapted to the specific application program through the special GC related parameters. The GC waterline value can avoid frequent triggering of the GC and can also avoid long-term failure to trigger the GC. In this way, the system energy consumption of the electronic equipment can be effectively reduced.
In some embodiments, the heavy-load application program and the light-load application program that are commonly used in the electronic device may be configured as specific application programs, and then GC-related parameters corresponding to the specific application programs are determined by means of testing or the like. Illustratively, the test mode may be: for each particular application, an attempt is made to enable different GC-related parameters and to record the energy consumption incurred during the running of that particular application. In this way, 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, the identifier corresponding to each specific application program may be obtained, and according to each identifier and the dedicated GC related parameter, a system configuration file 1 corresponding to the pre-configuration list is generated, and the system configuration file 1 is stored in the electronic device. Thus, the preconfigured list may include the identifier corresponding to the heavy-load application program and the dedicated GC-related parameter, or may include the identifier corresponding to the light-load application program and the dedicated GC-related parameter.
In some possible embodiments, the same particular application may include multiple sets of dedicated GC-related parameters. Different sets of proprietary GC-related parameters are applicable to specific applications at different stages of operation.
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. The GC-related parameter a is suitable for the start-up phase of the application b, or the phase with lighter load. The GC-related parameter b is applicable to the stage of applying b heavy load.
In this way, the electronic device may allocate an exclusive memory space for the application b and determine the corresponding GC waterline by using the GC-related parameter a at the stage of starting the application b. The electronic device may then distinguish whether the application b is in a heavy load phase or a light load phase according to the running duration of the application b. For example, during a period of time 1 (e.g., 10 minutes) that application b is running, application b is determined to be in a light load phase. Outside the duration 1 (e.g., 10 minutes) of the application b start-up run, it is determined that the application b is in the heavy load phase.
For example, the GC-related parameter a is used to allocate exclusive memory space for the application b within a period of time 1 after the application b is started, for example, within 10 minutes of the start-up operation of the application b, and a corresponding GC waterline value is determined. After the duration 1 of the application b is started, for example, after the application b is started to run for 10 minutes, if the GC is triggered, the GC-related parameter b is used to allocate an exclusive memory space for the application b, and a corresponding GC waterline value is determined.
In other embodiments, the electronic device may further determine whether the application b is running in the heavy load stage or the light load stage according to a change condition of the memory space actually occupied by the application.
For example, when the application b is started, the electronic device determines an exclusive memory space and a corresponding GC waterline 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 occupied memory space corresponding to the application b in the unit time, that is, the ratio between the difference value of the space sizes acquired in two adjacent times and the corresponding acquisition time interval. For example, the current collection of the space size of the real occupied memory space corresponding to the application b is 56M, the space size of the adjacent real occupied memory space corresponding to the application b is 52M, and if the time interval between the two collection is 2s, the corresponding change rate is 2M/s. In this way, the electronic device can obtain the latest rate of change obtained before each application b triggers GC. If the change rate is greater than the threshold value 1, determining the GC-related parameter corresponding to the application b as the GC-related parameter b. If the rate of change is not greater than the threshold value 1, determining the GC-related parameter corresponding to the application b as the GC-related parameter a.
In some scenarios, a first application, a second application are installed in an 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-duty application and the second application may be a light-duty application.
(2) The first application installation package size is larger than the installation package size of the second application.
(3) During operation, the newly-increased memory occupation amount in the unit time of the first application is larger than the newly-increased memory occupation amount in the unit time of the second application.
(4) The running load of the first application (the amount of occupied system resources) is larger than the running load of the second application.
(5) During operation, the memory access frequency of the first application unit time is higher than the memory access frequency of the second application unit time.
For example, the first application may be a social application that requires long-term foreground operation, and the second application may be a system-provided clock application or weather application, etc.
In addition, the plurality of identifiers included in the pre-configuration list may also be referred to as a plurality of application identifiers. The plurality of application identifiers comprise a first identifier for indicating a first application and a second identifier for indicating a second application. In some embodiments, the electronic device receives a first operation of a user for a first application, where the first operation may indicate that the first application is running, for example, an operation of clicking an application icon of the first application. The electronic device then initiates the first application in response to the first operation. Thus, the first application also enters the running state.
During the running of the first application, the electronic device may perform GC multiple times for the first application. After the ith garbage collection treatment of the first application, if the size of the memory space occupied by the first application is the first memory value, the electronic device sets a first preset threshold (i.e., GC waterline) for the first application according to the first memory value. In this way, after the memory size occupied by the first application reaches a first preset threshold value from the first memory value, the i+1th garbage collection process for the first application is triggered.
In some embodiments, the electronic device receives a second operation by the user for the second application, where the second operation may indicate that the second application is running, e.g., is an operation to click on an application icon of the second application. The electronic device then initiates the second application in response to the second operation. Thus, the second application also enters the running state.
Likewise, during the running of the second application, the electronic device may perform GC multiple times for the second application. After the second application is subjected to the jth garbage collection treatment, 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 (i.e., GC waterline) for the second application according to the first memory value. In this way, after the memory size occupied by the second application reaches the second preset threshold value from the first memory value, the j+1th garbage collection process for the second application is triggered.
However, since the first application and the second application are both located in the application set, they both correspond to GC related parameters dedicated to each other, and even if the memory space actually occupied by the first application and the second application after GC is the same, GC waterlines allocated to them are different. In addition, the first preset threshold may be greater than the second preset threshold due to the aforementioned difference between the first application and the second application.
In the case that the first application is a heavy-load application and the second application is a light-load application, compared with the case that the same GC related parameters are used for configuring a unified GC waterline, in the embodiment of the present application, a higher GC waterline is configured for the first application, so that the first application can be prevented from frequently triggering the GC. The second application is also configured with lower GC parameters, so that the situation that the second application cannot GC in a scene during operation is avoided, and the memory space occupied by the second application cannot be effectively recovered, so that excessive resident memory in the system is caused.
In addition, after each GC of the first application, if the size of the occupied memory space is different, the GC waterline configured by the electronic device is also different. For example, after the first application is subjected to the i+1th garbage collection treatment in the running process, the size of the memory space occupied by the first application is a third memory value. And when the memory size occupied by the first application reaches a fourth preset threshold (GC waterline) from the third memory value, performing i+2th garbage collection 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 each GC of the second application, if the size of the occupied memory space is different, the GC waterline configured by the electronic device is also different. For example, after the second application is subjected to the j+1th garbage recycling treatment in the running process, the size of the memory space occupied by the second application is the fourth memory value. And when the memory size occupied by the second application reaches a fifth preset threshold (GC waterline) from the fourth memory value, performing i+2th garbage recycling treatment on 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, and may be the same or different, which is not limited in the embodiment of the present 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 a third memory value and the fourth preset threshold, the first mapping relationship is used to indicate a correspondence 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 value and the preset threshold. The first maximum threshold, the first minimum threshold and the first scale factor may be determined according to GC related parameters 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 the real memory space and the reserved memory space, and that the first scale factor is a rate of change between the exclusive memory space (sum of the real memory space and the reserved memory space) and the real memory space. In addition, the first mapping relationship may be a piecewise linear function, and there is a difference between the memory value and the preset threshold value in different stages.
In some embodiments, for applications that do not need to use dedicated GC-related parameters, the corresponding exclusive memory space and GC waterline value may be determined directly using the system default GC-related parameters. In addition, the GC-related parameters default to the above system may be referred to as fourth parameters. For example, as shown in fig. 5, the method further includes:
s104, when the application program 2 starts to run, the identification 2 of the application program 2 is acquired.
In some embodiments, the identifier 2 may uniquely indicate the application 2. The identifier 2 may be an application name corresponding to the application 2. Also, for example, the identifier 2 may also be a process name corresponding to the application 2, that is, a name of an application process created when the application 2 runs.
S105, when the identifier 2 does not belong to the pre-configuration list, determining the exclusive memory space allocated to the application program 2 according to the default GC related parameters 2 of the system. Illustratively, as shown in fig. 7, the above S105 may include the following substeps:
s105-1, the electronic device may obtain a pre-configured list.
In some embodiments, if system profile 1 has been parsed, the preconfigured list is obtained directly. If the system configuration file 1 is not already parsed, the system configuration file 1 is parsed first to obtain the pre-configuration list.
S105-2, acquiring the GC related parameters 2 when the identification 2 is different from the identification in the pre-configuration list.
As shown in fig. 7, when the identifier 2 is "chat", the identifier "chat" is not included in the preconfigured list. Thus, the electronic device can query the GC-related parameters 2 analyzed during the startup phase. It will be appreciated that when the identifier 2 is "chat", it may indicate that the application 2 belongs to a chat application, and in addition, since the preconfigured list does not contain the identifier "chat", it indicates that the application 2 does not belong to an application requiring a dedicated GC-related parameter, that is, for the application 2, the GC-related parameter 2 default by the system is the most suitable GC-related parameter.
S105-3, determining reserved memory space allocated to the application program 2 according to the GC related parameters 2 and the real occupied memory space corresponding to the application program 2.
For example, as shown in fig. 7, the GC related parameter 2 includes a minimum reservation limit of 2M, a maximum reservation limit of 12M, a space utilization of 0.8, and an exclusive space upper limit of 512M. Under the condition that the application process corresponding to the application program 2 occupies 50M, the calculated reserved memory space is 12.5M according to the space utilization rate. Under the limitation of the maximum reserved limit (e.g., 12M), the actual reserved memory space may be determined to be 12M.
For another example, in the case that the application process corresponding to the application program 2 already occupies 40M, the calculated reserved memory space is 10M according to the space utilization. It will be appreciated that 10M is less than the maximum reservation limit (12M) in GC-related parameter 2 and greater than the minimum reservation limit (2M) in GC-related parameter 2. The electronic device may determine that the reserved memory space allocated to application 2 is 10M.
For another example, in the case that the application process corresponding to the application program 2 already occupies 6M, the calculated reserved memory space is 1.5M according to the space utilization. It will be appreciated that 1.5M is less than the minimum reservation limit (2M) in GC-related parameter 2. The electronic device may determine that the reserved memory space allocated to application 2 is equal to the minimum reservation limit (i.e., 2M) described above.
In this way, the electronic device determines the memory space exclusively allocated to the application program 2 according to the real occupied memory space and the reserved memory space corresponding to the application program 2.
In some embodiments, the exclusive memory space allocated to application 2 includes real-world memory space and reserved memory space. For example, the size of the memory space allocated exclusively to application 2 may be equal to the sum of the real memory space and the reserved memory space. Also for example, the size of the memory space allocated exclusively to 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 watermark value corresponding to the application 2 according to the size of the exclusive memory space allocated to the application 2. When the real occupied memory space corresponding to the application 2 is greater than or equal to the corresponding GC waterline value, the GC for the application 2 may be triggered.
In other embodiments, the preconfigured list does not contain application icons (e.g., referred to as third identifiers) of the third application and the fourth application, that is, the third application and the fourth application do not belong to a preset application set.
In some embodiments, the electronic device receives a third operation by the user for a third application, where the third operation may indicate that the third application is running, for example, an operation to click on an application icon of the third application. The electronic device then initiates the third application in response to a third operation. Thus, the third application also enters the running state.
During the running of the third application, the electronic device may perform GC multiple times for the third application. After the third application is subjected to the mth garbage collection process, if the size of the memory space occupied by the third application is the second memory value, the electronic device sets a third preset threshold (i.e., GC waterline) for the third application according to the second memory value. In this way, after the memory size occupied by the third application reaches a third preset threshold value from the second memory value, the m+1th garbage collection process for the third application is triggered.
In some embodiments, the electronic device receives a fourth operation by the user for the fourth application, where the fourth operation may indicate that the fourth application is running, for example, an operation of clicking an application icon of the fourth application. Then, the electronic device starts the fourth application in response to the fourth operation. Thus, the fourth application also enters the running state.
During the running of the fourth application, the electronic device may perform GC multiple times for the fourth application. After the fourth application is subjected to the nth garbage collection process, 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 (i.e., GC waterline) for the fourth application according to the second memory value. Thus, after the memory size occupied by the fourth application reaches a third preset threshold value from the second memory value, the (n+1) th garbage collection processing for the fourth application is triggered.
That is, for applications not belonging 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 GC waterline for them according to the same GC-related parameters.
In addition, m and n are positive integers greater than 0, and may be the same or different, which is not limited in the embodiment of the present application.
In some embodiments, a second mapping relationship is satisfied between the first memory value and a second preset threshold, and a second mapping relationship is also satisfied between the fourth memory value and a fifth preset threshold, where the second mapping relationship is used to indicate a correspondence 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 scale factor between the memory value and the preset threshold.
The second maximum threshold, the second minimum threshold, and the second scaling factor may be determined according to GC related parameters 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 reservation limit value corresponding to the second application. The second scale factor may be obtained by conversion according to a space utilization corresponding to the second application. In addition, the second mapping relationship may be a piecewise linear function, and there is a difference between the memory value and the preset threshold value at different stages.
As one implementation, the above-described method may be coordinated by multiple software modules in an electronic device. The electronic device may include an incubator, a device initialization, a run time (run time), a memory management module, and a parameter management module, for example. The incubator is used for indicating the application processes corresponding to the application programs to be incubated when the incubator runs. The device is initialized and used for creating a virtual machine for running the hatching process. And the running process 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, execute GC, and the like. The parameter management module is used for analyzing the system configuration file to obtain a 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 during running.
S2, after the virtual machine is created in the running process, a hatching process is created.
It is understood that the program files corresponding to the application programs include common files. The common file may be an executable file required for all applications installed in the electronic device. For example, a system profile 2 may be included, where the system profile 2 includes system default GC-related parameters.
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 memory 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 can also write data generated during the running of the hatching process into the memory space 2.
S3, initializing a hatching process during running.
In some embodiments, the implementation process of S3 may refer to related art, and will not be described herein.
S4, sending the GC related parameters and the system configuration file 1 defaults to the memory management module in the running process.
In some embodiments, the GC-related parameters corresponding to the hatching process may be indicated to be configured as the GC-related parameters default to the system by sending the GC-related parameters default to the memory management module. In this way, GC-related parameters default to the system can be utilized when GC is performed for the hatching process. In addition, by sending the system configuration file 1 to the memory management module, the memory management module is instructed to trigger the parameter management module to parse the system configuration file 1.
S5, the memory management module sends the system configuration file 1 to the parameter management module.
S6, the parameter management module analyzes the system configuration file 1 to obtain a pre-configuration list and stores the pre-configuration list.
In some embodiments, S1 and S6 belong to steps performed by the electronic device during the incubation start-up phase, for example, may occur in a scenario in which the electronic device is powered on. After the above steps, the creation of the incubator can be completed at run-time. After the incubator creation is completed, an application start phase is entered. In this phase, the electronic device may create processes corresponding to other applications through the incubator. That is, the above method may further include:
s7, responding to the operation of starting the application program 1, and indicating the application process a corresponding to the application program 1 to be created by the incubator at the running time.
S8, creating an application process a according to the incubation process and the exclusive executable file corresponding to the application program 1 during operation.
In some embodiments, the running 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 memory. For example, as shown in fig. 9, a memory space 2 is included in the internal memory, and the memory space 2 is a memory area occupied by the hatching process. When the application process a is created in the running process, the data stored in the memory space 2 is copied into the memory space 3, and then the exclusive 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.
S9, the identifier 1 corresponding to the application program 1 is sent to the parameter management module in the running process.
S10, the parameter management module determines the GC-related parameters 1 corresponding to the identification 1.
In some embodiments, the corresponding GC-related parameters 1 may be queried from the preconfigured list described above using the identification 1.
S11, the parameter management module sends the GC related parameters 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.
S13, in response to the operation of starting the application 2, the incubator instructs the runtime to create the application process b corresponding to the application 2.
S14, creating an application process b according to the incubation process and the exclusive executable file corresponding to the application program 2 during operation.
In some embodiments, the operation 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 memory. Then, in the memory space 4, the dedicated executable file corresponding to the application program 2 is parsed, 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 for the user.
And S15, the identifier 2 corresponding to the application program 2 is sent to the parameter management module during running.
S16, the parameter management module determines that the identifier 2 does not belong to the pre-configuration list.
In some embodiments, the parameter management module queries that the pre-configuration list does not contain the identifier 2, and determines that the identifier 2 does not belong to the pre-configuration list, so that the process ends, and as the hatching process adopts the GC-related parameter default by the system, the application process b hatched through the hatching process adopts the GC-related parameter default by the system as the hatching process, and under the condition that the GC-related parameter is not reconfigured, the application program 2 adopts the GC-related parameter default by the system as the hatching process.
The differences between the methods provided by the application and the methods not provided by the application are described below through GC frequency and memory occupation in the actual running process of various types of application programs.
Exemplary, third party application microblogs common in electronic devices TM Belongs to heavy load application. By microblog TM For testing objects, a test electronic device uses a scenario of the method provided herein (e.g., referred to as scenario 1) and does not use a scenario provided hereinScenario of method (e.g., referred to as scenario 2), microblog TM The corresponding GC cases, test results are shown in table i below:
TABLE 1
Figure BDA0004103863580000171
Wherein the GC interval is the interval time between two adjacent GC, the GC average time is the average value of the time occupied by a single GC, and the GC times are microblogs TM GC total times during operation, wherein the GC total time length refers to microblog TM During run-time, the total duration of the GC is actually performed.
Obviously, according to the test results of table 1, after the method provided by the application is used, compared with the method not used by the application, the electronic device aims at microblog in the same operation time period TM The GC interval of the system is longer, the GC times are fewer, the average time of the GC is longer, but the total GC duration is shorter, namely, the problem of frequent GC application by heavy load of a third party is obviously improved, and the occupied duration of the GC to system resources 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 scene (such as a scene 1) of the method provided by the application and a scene (such as a scene 2) of the method not provided by the application, wherein the GC conditions correspond to the system server, and the test results are shown in the following table 2:
TABLE 2
system server GC times GC interval(s) GC total duration(s)
Scene 2 3102 65.79 68919
Scene 1 1796 163.97 38172
According to the test results of table 2, compared with the method without the application, after the method provided by the application is used, in the same operation time, the GC interval of the electronic device for the system server is longer, the GC times are fewer, the total GC time is shorter, that is, the problem of frequent GC of the heavy-load system application is obviously improved, and the occupation time of the GC on the system resource is effectively reduced.
Also illustratively, the process com. Taking com.android.phone as a test object, testing a scene (such as a scene 1) of the method provided by the application and a scene (such as a scene 2) of the method not provided by the application, wherein the com.android.phone corresponds to the GC condition, and the test results are shown in the following table 3:
TABLE 3 Table 3
com.android.phone Size of resident memory
Scene
2 69M
Scene 1 47M
As can be seen from the test results of table 3, after using the method provided herein, less resident memory corresponds to com. That is, the problem that the GC cannot be triggered for a long time by the application of significantly improving the light load, resulting in the excessive resident memory is caused.
The embodiment of the application also 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, the computer program code comprising computer instructions. The computer instructions, when executed by a processor, cause the electronic device to perform the various steps of the embodiments described above. Of course, the electronic device includes, but is not limited to, the memory and the one or more processors described above.
The embodiment of the application also provides a chip system, which can be applied to the terminal equipment in the previous 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 an electronic device as 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 through the interface circuit 2202. The computer instructions, when executed by the processor 2201, may cause the electronic device to perform the various steps described in the embodiments above. Of course, the chip system may also include other discrete devices, which are not specifically limited in this embodiment of the present application.
In some embodiments, it will be clearly understood by those skilled in the art from the foregoing description of the embodiments, for convenience and brevity of description, only the division of the above functional modules is illustrated, and in practical application, the above functional allocation may be implemented by different functional modules, that is, the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above. The specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
The functional units in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform 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 disk, read-only memory, random access memory, magnetic or optical disk, and the like.
The foregoing is merely a specific implementation of the embodiments of the present application, but the protection 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 protection 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 (13)

1. A method for recycling memory garbage, which is characterized by being applied to electronic equipment, the method comprising:
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 ith garbage collection treatment in the running process of the first application is a first memory value, and i is a positive integer;
when the memory size occupied by the first application reaches a first preset threshold value from the first memory value, carrying out i+1st garbage collection treatment on 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 memory space occupied by the second application after the jth garbage collection treatment in the operation process of the second application is the first memory 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, j+1th garbage collection processing is performed on the second application, wherein the second preset threshold value is smaller than the first preset threshold value, and the first application and the second application are different applications.
2. The method of claim 1, wherein the first application and the second application satisfy at least one of the following conditions:
the size of the first application installation package is larger than the size of the installation package of the second application;
in the running process of the first application and the second application, the newly-increased memory occupation amount in the unit time of the first application is larger than the newly-increased memory occupation amount in the unit time of the second application;
the running load of the first application is greater than the running load of the second application;
and in the running process of the first application and the second application, the memory access frequency of the first application in unit time is higher than the memory access frequency of the second application in unit time.
3. The method of claim 1, wherein the first application and the second application are applications located in a set of applications preset in the electronic device.
4. The method of claim 3, further comprising a third application and a fourth application in the electronic device, the third application and the fourth application being applications that are outside of the preset set of applications, the method further comprising:
receiving a third operation of a 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 mth garbage collection treatment in the running process of the third application is a second memory value, and m is a positive integer;
when the memory size occupied by the third application reaches a third preset threshold value from the second memory value, carrying out m+1st garbage collection 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 treatment in the running process of the fourth application is the second memory value, and n is a positive integer;
and when the memory size occupied by the fourth application reaches the third preset threshold value from the second memory value, carrying out n+1th garbage collection treatment on the fourth application, wherein the size of an application program installation package of the third application is larger than that of an application program installation package of the fourth application.
5. The method according to any one of claims 1-4, wherein after the first application is subjected to the i+1th garbage collection process 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 memory size occupied by the first application reaches a fourth preset threshold value from the third memory value, performing i+2th garbage collection treatment on 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.
6. The method of claim 5, 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 correspondence 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.
7. The method according to any one of claims 1-4, wherein after the second application is subjected to the j+1th garbage collection process 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 memory size occupied by the second application reaches a fifth preset threshold value from the fourth memory value, j+2th garbage collection treatment is conducted on 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.
8. The method of claim 7, 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 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 scale factor between a memory value and a preset threshold.
9. The method of any of claims 1-8, wherein the first application is a social application or a system service and the second application is a clock application or a weather application.
10. The method of claim 3 or 4, wherein the application set comprises a preconfigured application program, or wherein the application set comprises an application program with at least one of an application use frequency, an application load size, and an application installation package size meeting a preset requirement.
11. An electronic device comprising one or more processors and memory; the memory being coupled to a processor, the memory being for storing computer program code comprising computer instructions which, when executed by one or more processors, are for performing the method of any of claims 1-10.
12. A computer storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-10.
13. 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 of claims 1-10.
CN202310182903.5A 2022-09-30 2022-09-30 Memory garbage recycling method and electronic equipment Active CN116361200B (en)

Priority Applications (1)

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

Applications Claiming Priority (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

Related Parent Applications (1)

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

Publications (2)

Publication Number Publication Date
CN116361200A true CN116361200A (en) 2023-06-30
CN116361200B CN116361200B (en) 2023-11-14

Family

ID=84732055

Family Applications (2)

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

Country Status (1)

Country Link
CN (2) CN115543864A (en)

Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309740A (en) * 2013-06-05 2013-09-18 腾讯科技(深圳)有限公司 Program starting method, device and equipment
US20150026429A1 (en) * 2013-07-18 2015-01-22 International Business Machines Corporation Optimizing memory usage across multiple garbage collected computer environments
US20160253103A1 (en) * 2015-02-27 2016-09-01 International Business Machines Corporation Tuning utilization and heap memory size for real-time garbage collection
CN108121602A (en) * 2017-12-14 2018-06-05 捷开通讯(深圳)有限公司 A kind of method, electronic equipment and the storage medium of definite garbage collection trigger point
CN108228449A (en) * 2017-08-15 2018-06-29 珠海市魅族科技有限公司 Terminal equipment control method and device, terminal device and computer readable storage medium
CN108228341A (en) * 2017-08-07 2018-06-29 珠海市魅族科技有限公司 Method for recovering internal storage and device, terminal device and computer readable storage medium
CN109117242A (en) * 2017-06-22 2019-01-01 龙芯中科技术有限公司 Virtual machine garbage reclamation tuning method, apparatus, electronic equipment and storage medium
CN109857555A (en) * 2019-01-15 2019-06-07 Oppo广东移动通信有限公司 Method for recovering internal storage and device, storage medium and electronic equipment
CN110704191A (en) * 2019-09-29 2020-01-17 Oppo广东移动通信有限公司 Game optimization method, game optimization device and mobile terminal
CN110888746A (en) * 2019-12-10 2020-03-17 Oppo(重庆)智能科技有限公司 Memory management method and device, storage medium and electronic equipment
US20200125373A1 (en) * 2018-10-19 2020-04-23 Oracle International Corporation Intelligently Determining A Virtual Machine Configuration During Runtime Based On Garbage Collection Characteristics
CN111258921A (en) * 2020-01-14 2020-06-09 Oppo广东移动通信有限公司 Method and device for recycling garbage memory, electronic equipment and storage medium
CN111338796A (en) * 2020-02-18 2020-06-26 广州虎牙科技有限公司 Application memory optimization method and device, terminal equipment and readable storage medium
CN112615947A (en) * 2019-09-18 2021-04-06 华为技术有限公司 Method for rapidly entering application and folding screen electronic equipment
CN112764891A (en) * 2019-10-21 2021-05-07 青岛海信移动通信技术股份有限公司 Electronic terminal and method for controlling application
CN114020652A (en) * 2021-09-30 2022-02-08 荣耀终端有限公司 Application program management method and electronic equipment
CN114265495A (en) * 2021-11-22 2022-04-01 上海小传科技有限公司 Application program processing method, intelligent terminal and storage medium
CN114721812A (en) * 2021-01-04 2022-07-08 华为技术有限公司 Memory release method and related equipment
US20220261342A1 (en) * 2021-02-18 2022-08-18 Silicon Motion, Inc. Garbage collection operation management
CN115016885A (en) * 2021-11-19 2022-09-06 荣耀终端有限公司 Virtual machine garbage recycling operation method and electronic equipment

Patent Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309740A (en) * 2013-06-05 2013-09-18 腾讯科技(深圳)有限公司 Program starting method, device and equipment
US20150026429A1 (en) * 2013-07-18 2015-01-22 International Business Machines Corporation Optimizing memory usage across multiple garbage collected computer environments
US20160253103A1 (en) * 2015-02-27 2016-09-01 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
CN108228341A (en) * 2017-08-07 2018-06-29 珠海市魅族科技有限公司 Method for recovering internal storage and device, terminal device and computer readable storage medium
CN108228449A (en) * 2017-08-15 2018-06-29 珠海市魅族科技有限公司 Terminal equipment control method and device, terminal device and computer readable storage medium
CN108121602A (en) * 2017-12-14 2018-06-05 捷开通讯(深圳)有限公司 A kind of method, electronic equipment and the storage medium of definite garbage collection trigger point
US20200125373A1 (en) * 2018-10-19 2020-04-23 Oracle International Corporation Intelligently Determining A Virtual Machine Configuration During Runtime Based On Garbage Collection Characteristics
CN109857555A (en) * 2019-01-15 2019-06-07 Oppo广东移动通信有限公司 Method for recovering internal storage and device, storage medium and electronic equipment
CN112615947A (en) * 2019-09-18 2021-04-06 华为技术有限公司 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
CN112764891A (en) * 2019-10-21 2021-05-07 青岛海信移动通信技术股份有限公司 Electronic terminal and method for controlling application
CN110888746A (en) * 2019-12-10 2020-03-17 Oppo(重庆)智能科技有限公司 Memory management method and device, storage medium and electronic equipment
CN111258921A (en) * 2020-01-14 2020-06-09 Oppo广东移动通信有限公司 Method and device for recycling garbage memory, electronic equipment and storage medium
CN111338796A (en) * 2020-02-18 2020-06-26 广州虎牙科技有限公司 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
US20220261342A1 (en) * 2021-02-18 2022-08-18 Silicon Motion, Inc. Garbage collection operation management
CN114020652A (en) * 2021-09-30 2022-02-08 荣耀终端有限公司 Application program management method and electronic equipment
CN115016885A (en) * 2021-11-19 2022-09-06 荣耀终端有限公司 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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王溪波;尹振中;于戈;: "基于动态优先级的实时Java垃圾回收策略", 沈阳工业大学学报, no. 03, pages 321 - 325 *
胡振宇等: "基于程序分析的大数据应用内存预估方法", 《中国科学:信息科学》, pages 1178 - 1195 *

Also Published As

Publication number Publication date
CN116361200B (en) 2023-11-14
CN115543864A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
CN111158910B (en) Memory management method and device, storage medium and electronic equipment
WO2021057619A1 (en) Memory reclamation method and apparatus, electronic device, and storage medium
WO2020073672A1 (en) Resource scheduling method and terminal device
CN112035238A (en) Task scheduling processing method and device, cluster system and readable storage medium
WO2021057623A1 (en) Memory recovery method and apparatus, electronic device and storage medium
CN114145006A (en) Scheduling method and device of artificial intelligence resources, storage medium and chip
CN109598250A (en) Feature extracting method, device, electronic equipment and computer-readable medium
CN110738156B (en) Face recognition system and method based on message middleware
WO2022179473A1 (en) Frequency adjustment method for inter-core migration
CN116361200B (en) Memory garbage recycling method and electronic equipment
CN116048742B (en) Data processing method and electronic equipment
CN116700816A (en) Resource management method and electronic equipment
CN117687772A (en) Algorithm scheduling method and electronic equipment
CN116303110B (en) Memory garbage recycling method and electronic equipment
CN114003238B (en) Container deployment method, device, equipment and storage medium based on transcoding card
CN115587049A (en) Memory recovery method and device, electronic equipment and storage medium
CN114090262A (en) Object processing method and device, electronic equipment and storage medium
CN113222401A (en) Non-invasive load type intelligent identification method, device, server and system
CN113641674A (en) Adaptive global sequence number generation method and device
CN115061702B (en) IDE management method and electronic equipment
CN117421123B (en) GPU resource adjustment method and system, electronic equipment and storage medium
WO2024087840A1 (en) Resource management and control method and apparatus, chip, electronic device, and medium
CN113127510B (en) Method and device for archiving data, electronic equipment and storage medium
CN115934302A (en) Memory leak processing method and electronic equipment
CN115168054A (en) Task allocation method and device for intelligent service

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
GR01 Patent grant
GR01 Patent grant