WO2019238124A1 - 内存管理方法、装置、可读存储介质及终端 - Google Patents

内存管理方法、装置、可读存储介质及终端 Download PDF

Info

Publication number
WO2019238124A1
WO2019238124A1 PCT/CN2019/091302 CN2019091302W WO2019238124A1 WO 2019238124 A1 WO2019238124 A1 WO 2019238124A1 CN 2019091302 W CN2019091302 W CN 2019091302W WO 2019238124 A1 WO2019238124 A1 WO 2019238124A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
memory
application
threshold value
ratio
Prior art date
Application number
PCT/CN2019/091302
Other languages
English (en)
French (fr)
Inventor
杨浩
Original Assignee
奇酷互联网络科技(深圳)有限公司
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 奇酷互联网络科技(深圳)有限公司 filed Critical 奇酷互联网络科技(深圳)有限公司
Publication of WO2019238124A1 publication Critical patent/WO2019238124A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Definitions

  • the present invention relates to the field of electronic technology, and in particular, to a memory management method, device, readable storage medium, and terminal.
  • the system's memory resources are limited, when there are many processes running in the system, there will be insufficient memory resources, and the terminal will run more slowly.
  • the system forcibly closes other applications in the background. This method may forcibly close the program that the user needs to run in the background, the user experience is poor, and even the normal operation of the device is affected.
  • a terminal memory management method includes:
  • Monitor the remaining memory ratio of the terminal and determine whether the current remaining memory ratio is less than a first threshold value and greater than a second threshold value, the first threshold value is greater than a second threshold value, and the remaining memory ratio is A ratio of the remaining memory of the terminal to the total memory;
  • the step of compressing an application running in the background in the terminal includes:
  • the calculation formula for calculating the weight value of each of the applications based on the acquired data is:
  • W i is the weight value of the i-th application
  • S i is the memory occupied by the i-th application
  • S total is the memory occupied by all applications
  • P i is the priority parameter of the i-th application
  • T i is the i-th application.
  • the method further includes:
  • the compressed applications are sequentially decompressed in order of the weight value from ascending, and after the current application is decompressed, the current remaining memory ratio When it is greater than or equal to the first threshold value, decompression is stopped, and the third threshold value is greater than the first threshold value.
  • the foregoing terminal memory management method further includes:
  • the step of obtaining a priority parameter of each application running in the background in the terminal includes:
  • the priority parameter of each of the applications is determined according to the use frequency and the use time, and the higher the use frequency and the longer the use time, the smaller the priority parameter.
  • the method further comprises: determining a priority order of each of the applications in the background according to the use frequency and the use time; each priority corresponds to one of the priority parameters, the priority parameter and the priority It is inversely proportional.
  • the method further includes:
  • An embodiment of the present invention provides a terminal memory management device, including:
  • a judging module configured to monitor the remaining memory ratio of the terminal and determine whether the current remaining memory ratio is less than a first threshold value and greater than a second threshold value, where the first threshold value is greater than the second threshold value, and The remaining memory ratio is a ratio of the remaining memory of the terminal to the total memory;
  • the compression module is configured to compress an application running in the background in the terminal when the current remaining memory ratio is less than the first threshold value and greater than the second threshold value.
  • the compression module includes:
  • An obtaining module configured to obtain priority parameters, occupied memory, and unwake duration of each application running in the background in the terminal, and calculate a weight value of each of the applications according to the acquired data, wherein the weight value and the priority parameter The memory usage is positively related to the unawakened duration;
  • a compression submodule configured to sequentially compress the applications in the order of the weight values from large to small, and stop the compression when the current remaining memory ratio is greater than or equal to the first threshold value after the current application compression .
  • the foregoing terminal memory management device wherein the calculation formula for calculating the weight value of each of the applications according to the acquired data is:
  • W i is the weight value of the i-th application
  • S i is the memory occupied by the i-th application
  • S total is the memory occupied by all applications
  • P i is the priority parameter of the i-th application
  • T i is the i-th application.
  • the foregoing terminal memory management device further includes:
  • a decompression module configured to sequentially decompress the compressed applications according to the weight value in ascending order when the current remaining memory ratio is greater than a third threshold, and after the current application is decompressed, all the When the current remaining memory ratio is greater than or equal to the first threshold value, decompression is stopped, wherein the third threshold value is greater than the first threshold value.
  • the foregoing terminal memory management device further includes:
  • the obtaining and modifying module is configured to obtain a target priority parameter set by the user for the current application, and modify the current priority parameter of the current application to the target priority parameter.
  • the acquiring module is specifically configured to:
  • the priority parameter of each of the applications is determined according to the use frequency and the use time, and the higher the use frequency and the longer the use time, the smaller the priority parameter.
  • the obtaining module is further configured to:
  • Each priority corresponds to one of the priority parameters, and the priority parameter and the priority are inversely proportional.
  • the compression submodule is further configured to: when the remaining memory ratio of the terminal is less than the second threshold value, no more memory compression is performed.
  • the foregoing terminal memory management device further includes:
  • a shutdown module configured to sequentially close the applications running in the background according to the weight value in ascending order when the current remaining memory ratio is less than the second threshold, and after the current application is closed , When the current remaining memory ratio is greater than or equal to the second threshold, stopping and closing the remaining applications.
  • An embodiment of the present invention further provides a readable storage medium on which a program is stored, and when the program is executed by a processor, the steps of any one of the foregoing methods are implemented.
  • An embodiment of the present invention further provides a terminal, including a memory, a processor, and a program stored on the memory and executable on the processor.
  • a terminal including a memory, a processor, and a program stored on the memory and executable on the processor.
  • the processor executes the program, the steps of any of the foregoing methods are implemented.
  • the application running in the background is compressed, and the system memory is released on the premise of ensuring the normal operation of the system. It solves the problem of killing an application suddenly when the system memory is released in the prior art, which affects the normal use of the device.
  • FIG. 1 is a flowchart of a memory management method in a first embodiment of the present invention
  • FIG. 2 is a flowchart of a memory management method in a second embodiment of the present invention.
  • FIG. 3 is a structural block diagram of a memory management apparatus in a third embodiment of the present invention.
  • FIG. 1 is a terminal memory management method according to a first embodiment of the present invention.
  • the method is applied to a terminal (such as a mobile phone, a tablet computer, a multimedia player, etc.) to monitor and manage the terminal's memory.
  • the memory management method may include steps S11-S12.
  • Step S11 Monitor the remaining memory ratio of the terminal, and determine whether the current remaining memory ratio is less than the first threshold value and greater than the second threshold value. If step S12 is performed, the first threshold value is greater than the second threshold value.
  • a threshold value, the remaining memory ratio is a ratio of the terminal's remaining memory to the total memory.
  • Step S12 Compress applications running in the background in the terminal.
  • the compression mechanism of the application is triggered by setting the threshold of the remaining memory ratio, and compressing the application running in the background to release the system memory. That is, when it is detected that the current remaining memory ratio of the terminal is between the first threshold value and the second threshold value, the application running in the background of the terminal is compressed to increase the available memory of the terminal.
  • the first threshold value is used to trigger the compression mechanism of the application
  • the second threshold value is used to trigger the compression mechanism to stop application.
  • the remaining memory ratio of the terminal is less than the first threshold value, it means that the available memory of the system is small and affects the operation. Therefore, the available memory needs to be expanded by compressing the background application.
  • the terminal's remaining memory ratio is less than the second threshold, it indicates that the available memory of the system is very small. If you continue to compress the memory, it may cause the system to freeze. At this time, it is not appropriate to perform memory compression.
  • the size of the first threshold value and the second threshold value can be set according to actual conditions. For example, the first threshold value can be set to 10%, and the second threshold value can be set to 5%.
  • LZ4 compression algorithm is a lossless data compression algorithm that focuses on compression and decompression speed.
  • the applications running in the background are compressed, and the system memory is released on the premise of ensuring the normal operation of the system. It solves the problem of killing an application suddenly when the system memory is released in the prior art, which affects the normal use of the device.
  • a method for managing terminal memory according to a second embodiment of the present invention includes steps S21-S25.
  • Step S21 Monitor the remaining memory ratio of the terminal, and determine whether the current remaining memory ratio is less than a first threshold value and greater than a second threshold value, and the first threshold value is greater than a second threshold value.
  • Step S22 when the current remaining memory ratio is less than the first threshold value and greater than the second threshold value, obtain priority parameters, occupied memory, and unwake duration of each application running in the background in the terminal, and according to the acquired data A weight value is calculated for each said application.
  • step S23 the applications are sequentially compressed in the order of the weight values from large to small, and the compression is stopped when the current remaining memory ratio is greater than or equal to the first threshold value after the current application compression.
  • the application running in the background needs to be compressed to release the memory.
  • compression is not required for multiple applications running in the background.
  • some commonly used applications also need to be decompressed when they are used.
  • the background applications can be compressed according to the weight value of the applications running in the background, and some applications that are not commonly used and occupy a large amount of memory are preferentially compressed.
  • the weight value of each application is calculated according to the priority parameter of the corresponding application, the occupied memory and the unwake time.
  • the priority parameter of the application can be determined according to the frequency and time of use of each application.
  • the step of the terminal obtaining the priority parameter of each application running in the background includes:
  • Step S211 Obtain the use frequency and duration of each application running in the background in the terminal within the latest preset time period;
  • Step S212 Determine a priority parameter of each of the applications according to the use frequency and the use time. The higher the use frequency and the longer the use time, the smaller the priority parameter.
  • the frequency of use of each application is calculated according to the number of times of use in the most recent time period, and the preset time period can be set according to actual conditions, such as a week or a month.
  • the terminal can count the total usage times of an application in the last 7 days, and divide the counted total usage times by 7 to obtain the usage frequency of the application.
  • the usage time is also the total usage time of the application for 7 days.
  • Each priority corresponds to a priority parameter, and the priority is inversely proportional to the priority parameter, that is, the higher the priority, the smaller the priority parameter.
  • the priority parameters corresponding to each priority can be set in advance. For example, the priority parameter corresponding to the highest priority application is 1, followed by 2, and so on.
  • priority parameters of each application can be obtained by querying pre-stored parameters.
  • the terminal stores the priority parameters of each application, and the user can modify and reset the priority parameters of each application at any time.
  • the terminal obtains the target priority parameter set by the user for the current application, the current priority parameter of the current application is modified to the target priority parameter.
  • the memory occupied by each application running in the background and the unwake time can be detected by the terminal system.
  • the unawakened duration is the duration (in seconds) that the application has not been woken up to the foreground.
  • the calculation formula for the terminal to calculate the weight value of each application based on the acquired data is:
  • W i is the weight value of the i-th application
  • S i is the memory occupied by the i-th application
  • S total is the memory occupied by all applications
  • P i is the priority parameter of the i-th application
  • T i is the i-th application.
  • the weight value reflects the relationship between the memory occupied by each application, the priority, and the length of the unawakened time.
  • the purpose of setting the weight value is to lower the priority, occupy more memory, and increase the weighted result without a long wakeup time.
  • the applications with higher priority occupy less memory and have less weight when they are not awakened.
  • the above calculation formula can accurately and reasonably reflect this relationship. It can be understood that the weight calculation formula satisfying the above relationship is not limited to the above-mentioned calculation formula.
  • the weight formula may be
  • the terminal After calculating the weight value of each application running in the background according to the above formula, the terminal sequentially compresses the background applications according to the weight value in ascending order, and after the current application is decompressed, it is determined whether the current remaining memory ratio is greater than or equal to The first threshold value, if the current remaining memory ratio is greater than or equal to the first threshold value, compression is stopped.
  • the current remaining memory ratio is X (less than the first threshold and greater than the second threshold), and there are three applications running in the background, and their weights are W1, W2, and W3 (W1> W2> W3) .
  • the system first compresses the application with the weight of W1 and detects the current remaining memory ratio. If the current remaining memory ratio is still between the first threshold and the second threshold, it continues to compress the application with the weight of W2 and then detects the current remaining Memory ratio. When the current remaining memory ratio is greater than or equal to the first threshold, the application is no longer compressed.
  • application compression is performed in accordance with the order of weight values, and applications with a large memory consumption, a large priority parameter, and a long usage time can be preferentially compressed, thereby ensuring the smoothness of the system.
  • steps S24 and S25 can also be performed.
  • step S24 when the current remaining memory ratio is greater than a third threshold value, the compressed applications are sequentially decompressed in order of the weight value from ascending, and when the current application is decompressed, the current application When the remaining memory ratio is greater than or equal to the first threshold value, decompression is stopped, and the third threshold value is greater than the first threshold value.
  • the application When the terminal is in use, the application releases memory or the application is closed by the user. At this time, the available memory will increase. If the remaining memory ratio is greater than the third threshold, it means that there is a lot of free memory now, and the previously compressed application memory can be released. Improve the smoothness of compressed applications.
  • the terminal decompresses the application, the available memory is reduced.
  • the terminal selectively decompresses the application. Specifically, the terminal can decompress the application according to a certain decompression rule. For example, the priority order of decompression can be determined according to the size of the weight value, and the decompression priority is small to release the memory of the system. When the current remaining memory ratio of the system reaches the first threshold, When it is slightly larger than the first threshold, the decompression is stopped.
  • step S25 when the current remaining memory ratio is less than the second threshold, the applications running in the background are closed in order according to the weight value in ascending order, and when the current application is closed, the current When the remaining memory ratio is greater than or equal to the second threshold, stopping and closing the remaining applications.
  • the terminal detects that the current remaining memory ratio is less than or equal to the second threshold value, it means that the memory of the system is very small and affects the normal operation of the system.
  • one or more applications need to be closed to release the memory.
  • the system will preferentially choose to close applications running in the background.
  • the priority of the system to close the applications running in the background can be determined according to the weight value. Applications with a small weight value are closed first. Each time an application is closed, it is necessary to determine whether the current remaining memory ratio of the system is greater than or equal to the second threshold. If it is determined that the current remaining memory ratio is greater than or equal to the second threshold value, the action of stopping the application is stopped.
  • the applications running in the background in the terminal may be all compressed or uncompressed, or both compressed and uncompressed. In either case, they are closed in the priority order determined by the weight value. .
  • the order of the first threshold value A, the second threshold value B, and the third threshold value C is C> A> B.
  • the compressed applications are decompressed in the order of the weight value from ascending to X ⁇ A, and the decompression is stopped; when B ⁇ X ⁇ A, the weight is Compress background applications in order from large to small, until X ⁇ A, stop compression; when X ⁇ B, and a new application is opened, the compressed applications are sorted in ascending order according to the weight value. In order to close, when X ⁇ B, stop closing the remaining applications.
  • the current remaining memory ratio of the system when the current remaining memory ratio of the system is between the first threshold and the second threshold to, dynamically select applications with high priority, unused for a long time, and consume more memory according to the weight value of each application. And start a compression algorithm to compress the memory used by the corresponding application to relieve memory pressure; if some applications are actively closed during the use process, or the application releases the used memory, when the overall available memory of the system is large, you can actively The previously compressed application is decompressed to improve the response speed of the application. At the same time, the application is selectively closed when the current remaining memory ratio of the system is less than the second threshold.
  • FIG. 3 is a terminal memory management apparatus according to a third embodiment of the present invention, including:
  • a judging module 100 configured to monitor a remaining memory ratio of the terminal, and determine whether a current remaining memory ratio is less than a first threshold value and greater than a second threshold value, where the first threshold value is greater than a second threshold value,
  • the remaining memory ratio is a ratio of the remaining memory of the terminal to the total memory
  • the compression module 200 is configured to compress an application running in the background in the terminal when the current remaining memory ratio is less than a first threshold value and greater than a second threshold value.
  • the compression module 200 includes:
  • An obtaining module configured to obtain priority parameters, occupied memory, and unwake duration of each application running in the background in the terminal, and calculate a weight value of each of the applications according to the acquired data, wherein the weight value and the priority parameter The memory usage is positively related to the unawakened duration;
  • a compression submodule configured to sequentially compress the applications in the order of the weight values from large to small, and stop the compression when the current remaining memory ratio is greater than or equal to the first threshold value after the current application compression .
  • the foregoing terminal memory management device wherein the calculation formula for calculating the weight value of each of the applications according to the acquired data is:
  • W i is the weight value of the i-th application
  • S i is the memory occupied by the i-th application
  • S total is the memory occupied by all applications
  • P i is the priority parameter of the i-th application
  • T i is the i-th application.
  • the foregoing terminal memory management device further includes:
  • the decompression module 300 is configured to sequentially decompress the compressed applications according to the weight value in ascending order when the current remaining memory ratio is greater than a third threshold, and after the current application is decompressed, When the current remaining memory ratio is greater than or equal to the first threshold value, decompression is stopped, and the third threshold value is greater than the first threshold value.
  • the foregoing terminal memory management device further includes:
  • the obtaining and modifying module 400 is configured to obtain a target priority parameter set by a user for a current application, and modify the current priority parameter of the current application to the target priority parameter.
  • the acquiring module is specifically configured to:
  • the priority parameter of each of the applications is determined according to the use frequency and the use time, and the higher the use frequency and the longer the use time, the smaller the priority parameter.
  • the foregoing terminal memory management device further includes:
  • the shutdown module 500 is configured to sequentially close the applications running in the background according to the weight value in ascending order when the current remaining memory ratio is less than the second threshold, and when the current application is closed Then, when the current remaining memory ratio is greater than or equal to the second threshold, stopping and closing the remaining applications.
  • the implementation principle and technical effect of the terminal memory management device provided by the embodiment of the present invention are the same as those of the foregoing method embodiments.
  • the parts that are not mentioned in the device embodiments may refer to the corresponding content in the foregoing method embodiments. .
  • An embodiment of the present invention further provides a readable storage medium having a computer program stored thereon, which is implemented by the processor to implement the foregoing terminal memory management method.
  • An embodiment of the present invention further provides a terminal, including a memory, a processor, and a program stored on the memory and executable on the processor.
  • the processor implements the foregoing terminal memory management method when the processor executes the program.
  • a sequenced list of executable instructions that can be considered to implement a logical function can be embodied in any computer-readable medium,
  • the instruction execution system, device, or device such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from the instruction execution system, device, or device), or combine these instruction execution systems, devices, or devices Or equipment.
  • a "computer-readable medium” may be any device that can contain, store, communicate, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
  • computer readable media include the following: electrical connections (electronic devices) with one or more wirings, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disk read-only memory (CDROM).
  • the computer-readable medium may even be paper or other suitable medium on which the program can be printed, because, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or other suitable Processing to obtain the program electronically and then store it in computer memory.
  • each part of the present invention may be implemented by hardware, software, firmware, or a combination thereof.
  • multiple steps or methods may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it may be implemented using any one or a combination of the following techniques known in the art: Discrete logic circuits, application specific integrated circuits with suitable combinational logic gate circuits, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)

Abstract

一种内存管理方法、装置、可读存储介质及终端,该方法包括:监测所述终端的剩余内存比,并判断当前剩余内存比是否小于第一门限值且大于第二门限值,所述第一门限值大于第二门限值,所述剩余内存比为所述终端的剩余内存与总的内存的比值;若是,压缩所述终端中后台运行的应用。本发明中,当终端的剩余内存比小于第一门限值且大于第二门限值时,对后台运行的应用进行压缩,在保证系统正常运行的前提下,释放系统内存。解决了现有技术中在释放系统内存时突然杀掉某个应用,影响设备的正常使用的问题。

Description

内存管理方法、装置、可读存储介质及终端 技术领域
本发明涉及电子技术领域,特别是涉及一种内存管理方法、装置、可读存储介质及终端。
背景技术
随着移动通讯的迅猛发展,终端如手机、平板电脑、可穿戴设备等电子设备为人们的通讯带来了极大的便利,成为人们生活工作中必不可少的工具。内存是电子设备的一个重要组成部件,电子设备中所有程序的运行都是在内存中进行的,内存的性能对电子设备的整体性能而言至关重要。
由于系统的内存资源是有限的,当系统内运行的进程较多时,会出现内存资源不足的情况,终端的运行速度会越来越慢。一般来说终端在高内存使用率情况下打开新应用时,系统强制关闭后台的其他应用。这种方式可能将用户需要在后台运行的程序强制关闭,给用户带来的体验很差,甚至影响设备的正常运行。
发明内容
鉴于上述状况,有必要针对现有技术中当终端内存不够时强制关闭后台运行的应用,导致用户体验差的问题,提供一种内存管理方法、装置、可读存储介质及终端。
一种终端内存管理方法,包括:
监测所述终端的剩余内存比,并判断当前剩余内存比是否小于第一门限值且大于第二门限值,所述第一门限值大于第二门限值,所述剩余内存比为所述终端的剩余内存与总的内存的比值;
若是,压缩所述终端中后台运行的应用。
进一步的,当所述终端的剩余内存比小于所述第二门限值时,不再进行内存压缩。
进一步的,上述终端内存管理方法,所述压缩所述终端中后台运行的应用的步骤包括:
获取所述终端中后台运行的各个应用的优先级参数、占用内存和未唤醒时长,并根据获取的数据计算每个所述应用的权重值,其中,权重值与优先级参数、占用内存,和未唤醒时长呈正相关的关系;
按照所述权重值从大至小的顺序依序压缩所述应用,并当当前应用压缩后,所述当前剩余内存比大于或等于所述第一门限值时停止压缩。
进一步的,上述终端内存管理方法,其中,所述根据获取的数据计算每个所述应用的权重值的计算公式为:
Figure PCTCN2019091302-appb-000001
其中,W i为第i个应用的权重值,S i为第i个应用占用的内存,S total为所有应用占用的内存,P i为第i个应用的优先级参数,T i为第i个应用的未唤醒时长。
进一步的,上述终端内存管理方法,其中,查询所述终端的当前剩余内存比的步骤之后还包括:
当所述当前剩余内存比大于第三门限值时,按照所述权重值从小至大的顺序将已压缩的所述应用依序进行解压,并当当前应用解压后,所述当前剩余内存比大于或等于所述第一门限值时,停止解压,其中,所述第三门限值大于所述第一门限值。
进一步的,上述终端内存管理方法,还包括:
获取用户针对当前应用设置的目标优先级参数,并将所述当前应用的当前优先级参数修改为所述目标优先级参数。
进一步的,上述终端内存管理方法,其中,所述获取所述终端中后台运行的各个应用的优先级参数的步骤包括:
获取所述终端中后台运行的各个应用在最近的预设时间段内的使用频率和使用时长;
根据所述使用频率和使用时长确定各个所述应用的优先级参数,使用频率越高且使用时长越长的优先级参数越小。
进一步的,所述方法还包括:根据所述使用频率和所述使用时长确 定后台各个所述应用的优先级排序;每个优先级对应一个所述优先级参数,所述优先级参数和优先级呈反比。
进一步的,上述终端内存管理方法,其中,所述监测所述终端中的当前剩余内存比的步骤之后还包括:
当所述当前剩余内存比小于所述第二门限值时,按照所述权重值从小至大的顺序将后台运行的所述应用依序进行关闭,并当当前应用关闭后,所述当前剩余内存比大于或等于所述第二门限值时,停止关闭剩余的应用。
本发明实施例该提供了一种终端内存管理装置,包括:
判断模块,用于监测所述终端的剩余内存比,并判断当前剩余内存比是否小于第一门限值且大于第二门限值,所述第一门限值大于第二门限值,所述剩余内存比为所述终端的剩余内存与总的内存的比值;
压缩模块,用于当当前剩余内存比小于第一门限值且大于第二门限值时,压缩所述终端中后台运行的应用。
进一步的,上述终端内存管理装置,其中,所述压缩模块包括:
获取模块,用于获取所述终端中后台运行的各个应用的优先级参数、占用内存和未唤醒时长,并根据获取的数据计算每个所述应用的权重值,其中,权重值与优先级参数、占用内存,和未唤醒时长呈正相关的关系;
压缩子模块,用于按照所述权重值从大至小的顺序依序压缩所述应用,并当当前应用压缩后,所述当前剩余内存比大于或等于所述第一门限值时停止压缩。
进一步的,上述终端内存管理装置,其中,所述根据获取的数据计算每个所述应用的权重值的计算公式为:
Figure PCTCN2019091302-appb-000002
其中,W i为第i个应用的权重值,S i为第i个应用占用的内存,S total为所有应用占用的内存,P i为第i个应用的优先级参数,T i为第i个应用的未唤醒时长。
进一步的,上述终端内存管理装置,还包括:
解压模块,用于当所述当前剩余内存比大于第三门限值时,按照所 述权重值从小至大的顺序将已压缩的所述应用依序进行解压,并当当前应用解压后,所述当前剩余内存比大于或等于所述第一门限值时,停止解压,其中,所述第三门限值大于所述第一门限值。
进一步的,上述终端内存管理装置,还包括:
获取及修改模块,用于获取用户针对当前应用设置的目标优先级参数,并将所述当前应用的当前优先级参数修改为所述目标优先级参数。
进一步的,上述终端内存管理装置,其中,所述获取模块具体用于:
获取所述终端中后台运行的各个应用在最近的预设时间段内的使用频率和使用时长;
根据所述使用频率和使用时长确定各个所述应用的优先级参数,使用频率越高且使用时长越长的优先级参数越小。
进一步的,所述获取模块还用于:
根据所述使用频率和所述使用时长确定后台各个所述应用的优先级排序;
每个优先级对应一个所述优先级参数,所述优先级参数和优先级呈反比。
进一步的,所述压缩子模块还用于:当所述终端的剩余内存比小于所述第二门限值时,不再进行内存压缩。
进一步的,上述终端内存管理装置,还包括:
关闭模块,用于当所述当前剩余内存比小于所述第二门限值时,按照所述权重值从小至大的顺序将后台运行的所述应用依序进行关闭,并当当前应用关闭后,所述当前剩余内存比大于或等于所述第二门限值时,停止关闭剩余的应用。
本发明实施例还提供了一种可读存储介质,其上存储有程序,所述程序被处理器执行时实现上述任意一方法的步骤。
本发明实施例还提供了一种终端,包括存储器、处理器以及存储在存储器上并可在处理器上运行的程序,所述处理器执行所述程序时实现上述任意一方法的步骤。
本发明实施例中,当终端的剩余内存比小于第一门限值且大于第二 门限值时,对后台运行的应用进行压缩,在保证系统正常运行的前提下,释放系统内存。解决了现有技术中在释放系统内存时突然杀掉某个应用,影响设备的正常使用的问题。
附图说明
图1为本发明第一实施例中的内存管理方法的流程图;
图2为本发明第二实施例中的内存管理方法的流程图;
图3为本发明第三实施例中的内存管理装置的结构框图。
具体实施方式
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。
参照下面的描述和附图,将清楚本发明的实施例的这些和其他方面。在这些描述和附图中,具体公开了本发明的实施例中的一些特定实施方式,来表示实施本发明的实施例的原理的一些方式,但是应当理解,本发明的实施例的范围不受此限制。相反,本发明的实施例包括落入所附加权利要求书的精神和内涵范围内的所有变化、修改和等同物。
请参阅图1,为本发明第一实施例中的终端内存管理方法,该方法应用于终端中(例如手机、平板电脑、多媒体播放器等),以对终端的内存进行监控和管理。该内存管理方法可以包括步骤S11ˉS12。
步骤S11,监测所述终端的剩余内存比,并判断当前剩余内存比是否小于第一门限值且大于第二门限值,若是执行步骤S12,其中,所述第一门限值大于第二门限值,所述剩余内存比为终端的剩余内存与总的内存的比值。
步骤S12,压缩所述终端中后台运行的应用。
终端系统运行时,可动态检测内存使用量和剩余量,当内存的剩余量较小时影响终端系统的整体性能和运行速度。本实施例中通过设置剩 余内存比的门限值来触发应用的压缩机制,对后台运行的应用进行压缩,以释放系统内存。即当监测到终端的当前剩余内存比在第一门限值和第二门限值之间时则对终端后台运行的应用进行压缩,以增大终端的可用内存。
其中,第一门限值用来触发应用的压缩机制、第二门限值用来触发停止应用压缩机制。当终端的剩余内存比小于第一门限值时说明系统可用内存较小,影响运行,则需要通过压缩后台应用的方式扩充可用内存。当终端的剩余内存比小于第二门限值时,说明此时表明系统可用内存非常小了,若继续压缩内存可能会导致系统卡死,此时不宜进行内存压缩。第一门限值和第二门限值的大小可根据实际情况进行设置,例如第一门限值可设置为10%,第二门限值设置为5%。
终端后台运行的应用可能有一个或多个,当终端的后台应用只有一个时,则直接压缩该应用。若后台运行的多个应用时,则可对后台运行的应用全部压缩,或对部分应用进行压缩。具体的,对后台部分应用的压缩可按照用户设置的规则进行,例如对占用内存最大的几个应用进行压缩或将长时间未被唤醒的几个应用进行压缩,其具体的压缩规则和压缩的应用的数量此处不予限定。
对后台运行的应用进行压缩可采用现有的压缩算法进行,例如,可采用LZ4压缩算法,该算法是一种无损数据压缩算法,着重于压缩和解压缩速度。
本实施例中,当终端的剩余内存比小于第一门限值且大于第二门限值时,对后台运行的应用进行压缩,在保证系统正常运行的前提下,释放系统内存。解决了现有技术中在释放系统内存时突然杀掉某个应用,影响设备的正常使用的问题。
前参阅图2,为本发明第二实施例中的终端内存管理方法,包括步骤S21-S25。
步骤S21,监测所述终端的剩余内存比,并判断当前剩余内存比是否小于第一门限值且大于第二门限值,所述第一门限值大于第二门限值。
步骤S22,当当前剩余内存比小于第一门限值且大于第二门限值时, 获取所述终端中后台运行的各个应用的优先级参数、占用内存和未唤醒时长,并根据获取的数据计算每个所述应用的权重值。
步骤S23,按照所述权重值从大至小的顺序依序压缩所述应用,并当当前应用压缩后,所述当前剩余内存比大于或等于所述第一门限值时停止压缩。
当检测到终端的剩余内存比在第一门限值和第二门限值之间时,需要对后台运行的应用进行压缩,以释放内存。但很多情况下,后台运行的多个应用中,并非都需要进行压缩,例如有些常用的应用压缩后用户使用时还还要进行解压,有一定的延时性,影响用户的使用,对于这些应用用户更希望在后台运行或最后压缩。
因此,本实施例中可根据后台运行的应用的权重值来压缩后台应用,将一些不常用、占用内存大的应用优先进行压缩。每个应用的权重值根据对应应用的优先级参数、占用内存和未唤醒时长进行计算。其中,应用的优先级参数可根据各个应用的使用频率和时间进行确定,具体的,终端获取后台运行的各个应用的优先级参数的步骤包括:
步骤S211,获取所述终端中后台运行的各个应用在最近的预设时间段内的使用频率和使用时长;
步骤S212,根据所述使用频率和使用时长确定各个所述应用的优先级参数,使用频率越高和使用时长越长的优先级参数越小。
其中,各个应用的使用频率根据最近的时间段的使用次数进行计算,该预设时间段可根据实际情况进行设置,例如一周或一个月等。举例说明,终端可统计最近7天一应用的总使用次数,将统计的总使用次数除以7即可得到该应用的使用频率。其使用时长也即是统计7天该应用的使用时间的总和。根据使用频率和使用时长确定后台各个应用进行优先级排序,并确定各个应用的优先级参数。具体的,使用频率越高的优先级越低;使用频率相同的,则比较使用时长,使用时长越长的优先级越低,以此进行优先级排序。每个优先级对应一个优先级参数,优先级与优先级参数呈反比,即优先级越高的优先级参数越小。每个优先级对应的优先级参数可预先设置好,例如最高优先级的应用对应的优先级参数 为1,其次则为2,依次类推。
可以理解的,作为本发明的一种可实施的方式,各个应用的优先级参数可通过查询预存的参数得到。终端中存储有每个应用程序的优先级参数,用户可随时修改和重置各个应用的优先级参数。具体实施时,当终端获取用户针对当前应用设置的目标优先级参数时,将当前应用的当前优先级参数修改为目标优先级参数。
其中,后台运行的每个应用所占用内存和未唤醒时长可通过终端系统检测得到。未唤醒时长即是应用未被唤醒到前台使用的时长(单位为秒)。具体的,终端根据获取的数据计算每个应用的权重值的计算公式为:
Figure PCTCN2019091302-appb-000003
其中,W i为第i个应用的权重值,S i为第i个应用占用的内存,S total为所有应用占用的内存,P i为第i个应用的优先级参数,T i为第i个应用的未唤醒时长。
该权重值体现的是每个应用的占用内存、优先级和未唤醒时长的关系,设置权重值的目的是低优先级、占用内存较多和未被唤醒时长较大的权重计算结果会大,优先级高的应用占用内存小和未被唤醒时长小的权重结果会相对偏低,上述计算公式可准确、合理的体现这一关系。可以理解的,满足上述关系的权重计算公式不限于上述提到的计算公式,例如,在本发明的其他实施例中权重公式可为
Figure PCTCN2019091302-appb-000004
根据上式计算得到后台运行的每个应用的权重值后,终端按照该权重值从大至小的顺序依序压缩后台的应用,并当当前应用解压后,判断当前剩余内存比是否大于或等于第一门限值,若当前剩余内存比大于或等于第一门限值,则停止压缩。举例说明,当前剩余内存比为X(小于第一门限值且大于第二门限值)、后台运行的应用有3个,其权重值分别为W1、W2、W3(W1>W2>W3)。系统首先压缩权重为W1的应用,并检测当前剩余内存比,若当前剩余内存比还在第一门限值和第二门限值之间,则继续压缩权重为W2的应用,再检测当前剩余内存比,当当前剩余内 存比大于或等于第一门限值时,则不再压缩应用。
本实施例中,按照权重值的顺序进行应用的压缩,可优先将占用内存大、优先级参数大和使用时间长的应用优先进行压缩,以此保证系统的流畅性。
进一步的,步骤S21之后,还可以执行步骤S24和S25。
步骤S24,当所述当前剩余内存比大于第三门限值时,按照所述权重值从小至大的顺序将已压缩的所述应用依序进行解压,并当当前应用解压后,所述当前剩余内存比大于或等于所述第一门限值时,停止解压,其中,所述第三门限值大于所述第一门限值。
终端在使用时,应用释放了内存或者应用被用户关闭了,此时可用内存会增加,如果剩余内存比大于第三门限值时,表示现在空闲内存很多,可以将之前压缩的应用内存释放,提高被压缩应用的流畅度。
同时,终端解压应用后伴随着可用内存的减小,为了避免应用解压后导致可用内存太小,以至于影响系统的运行,因此,终端选择性的解压应用。具体的,终端可按照一定的解压规则解压应用,例如可根据权重值的大小确定解压优先顺序,权重值小的优先解压,释放系统的内存,当系统的当前剩余内存比达到第一门限值或略大于第一门限值时,停止解压。
步骤S25,当当前剩余内存比小于所述第二门限值时,按照所述权重值从小至大的顺序将后台运行的所述应用依序进行关闭,并当当前应用关闭后,所述当前剩余内存比大于或等于所述第二门限值时,停止关闭剩余的应用。
当终端监测到当前剩余内存比小于或等于所述第二门限值时,说明系统的内存非常小,影响系统的正常运行,此时需关闭一个或多个应用,以释放内存。此种情况下,系统会优先选择关闭后台运行的应用。系统关闭后台运行的应用的优先顺序可根据权重值的大小来确定,权重值小的应用优先进行关闭,每关闭一应用时需判断系统的当前剩余内存比是否大于或等于第二门限值。若判断到当前剩余内存比大于或等于第二门限值时,停止关闭应用的动作。
可以理解的,终端中在后台运行的应用可能全部是已压缩的也可能全部是未压缩的,或既有已压缩的和未压缩的,不管哪种情况均按照权重值确定的优先顺序进行关闭。
第一门限值A、第二门限值B和第三门限值C的大小顺序为C>A>B。当终端检测到系统的当前剩余内存比X>C时,按照权重值从小至大的顺序将已压缩的应用进行解压,直至X≥A时,停止解压;当B<X<A时,按照权重值从大至小的顺序依序压缩后台的应用,直至X≥A时,停止压缩;当X<B,且有一新的应用打开时,按照权重值从小至大的顺序将已压缩的应用依序进行关闭,直至X≥B时,停止关闭剩余的应用。
本实施例在系统的当前剩余内存比在第一门限值和第二门限至之间时,根据各个应用的权重值动态选择高优先级、较长时间未使用和耗较多内存的应用,并启动压缩算法将对应的应用使用的内存压缩起来,以缓解内存压力;如果在使用过程中随着部分应用主动关闭,或者应用释放了使用的内存,系统的整体可用内存较多时,可以主动将之前压缩的应用解压缩,以提高应用的响应速度,同时,系统的当前剩余内存比小于第二门限值时选择性地关闭应用。
请参阅图3,为本发明第三实施例中的终端内存管理装置,包括:
判断模块100,用于监测所述终端的剩余内存比,并判断当前剩余内存比是否小于第一门限值且大于第二门限值,所述第一门限值大于第二门限值,所述剩余内存比为所述终端的剩余内存与总的内存的比值;
压缩模块200,用于当当前剩余内存比小于第一门限值且大于第二门限值时,压缩所述终端中后台运行的应用。
进一步的,上述终端内存管理装置,其中,所述压缩模块200包括:
获取模块,用于获取所述终端中后台运行的各个应用的优先级参数、占用内存和未唤醒时长,并根据获取的数据计算每个所述应用的权重值,其中,权重值与优先级参数、占用内存,和未唤醒时长呈正相关的关系;
压缩子模块,用于按照所述权重值从大至小的顺序依序压缩所述应用,并当当前应用压缩后,所述当前剩余内存比大于或等于所述第一门限值时停止压缩。
进一步的,上述终端内存管理装置,其中,所述根据获取的数据计算每个所述应用的权重值的计算公式为:
Figure PCTCN2019091302-appb-000005
其中,W i为第i个应用的权重值,S i为第i个应用占用的内存,S total为所有应用占用的内存,P i为第i个应用的优先级参数,T i为第i个应用的未唤醒时长。
进一步的,上述终端内存管理装置,还包括:
解压模块300,用于当所述当前剩余内存比大于第三门限值时,按照所述权重值从小至大的顺序将已压缩的所述应用依序进行解压,并当当前应用解压后,所述当前剩余内存比大于或等于所述第一门限值时,停止解压,其中,所述第三门限值大于所述第一门限值。
进一步的,上述终端内存管理装置,还包括:
获取及修改模块400,用于获取用户针对当前应用设置的目标优先级参数,并将所述当前应用的当前优先级参数修改为所述目标优先级参数。
进一步的,上述终端内存管理装置,其中,所述获取模块具体用于:
获取所述终端中后台运行的各个应用在最近的预设时间段内的使用频率和使用时长;
根据所述使用频率和使用时长确定各个所述应用的优先级参数,使用频率越高且使用时长越长的优先级参数越小。
进一步的,上述终端内存管理装置,还包括:
关闭模块500,用于当所述当前剩余内存比小于所述第二门限值时,按照所述权重值从小至大的顺序将后台运行的所述应用依序进行关闭,并当当前应用关闭后,所述当前剩余内存比大于或等于所述第二门限值时,停止关闭剩余的应用。
本发明实施例所提供的终端内存管理装置,其实现原理及产生的技术效果和前述方法实施例相同,为简要描述,装置实施例部分未提及之处,可参考前述方法实施例中相应内容。
本发明实施例还提出了一种可读存储介质,其上存储有计算机程序, 该程序被处理器执行时实现上述的终端内存管理方法。
本发明实施例还提出了一种终端,包括存储器、处理器以及存储在存储器上并可在处理器上运行的程序,所述处理器执行所述程序时实现上述的终端内存管理方法。
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,“计算机可读介质”可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。
计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例 描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种终端内存管理方法,其中,包括:
    监测所述终端的剩余内存比,并判断当前剩余内存比是否小于第一门限值且大于第二门限值,所述第一门限值大于第二门限值,所述剩余内存比为所述终端的剩余内存与总的内存的比值;
    若是,压缩所述终端中后台运行的应用。
  2. 如权利要求1所述的终端内存管理方法,其中,当所述终端的剩余内存比小于所述第二门限值时,不再进行内存压缩。
  3. 如权利要求1所述的终端内存管理方法,其中,所述压缩所述终端中后台运行的应用的步骤包括:
    获取所述终端中后台运行的各个应用的优先级参数、占用内存和未唤醒时长,并根据获取的数据计算每个所述应用的权重值,其中,所述权重值与优先级参数、占用内存,和未唤醒时长呈正相关的关系;
    按照所述权重值从大至小的顺序依序压缩所述应用,并当当前应用压缩后,所述当前剩余内存比大于或等于所述第一门限值时停止压缩。
  4. 如权利要求3所述的终端内存管理方法,其中,所述根据获取的数据计算每个所述应用的权重值的计算公式为:
    Figure PCTCN2019091302-appb-100001
    其中,W i为第i个应用的权重值,S i为第i个应用占用的内存,S total为所有应用占用的内存,P i为第i个应用的优先级参数,T i为第i个应用的未唤醒时长。
  5. 如权利要求3所述的终端内存管理方法,其中,查询所述终端的当前剩余内存比的步骤之后还包括:
    当所述当前剩余内存比大于第三门限值时,按照所述权重值从小至大的顺序将已压缩的所述应用依序进行解压,并当当前应用解压后,所述当前剩余内存比大于或等于所述第一压缩门限值时,停止解压,其中,所述第三门限值大于所述第一门限值。
  6. 如权利要求1所述的终端内存管理方法,其中,还包括:
    获取用户针对当前应用设置的目标优先级参数,并将所述当前应用的当前优先级参数修改为所述目标优先级参数。
  7. 如权利要求3所述的终端内存管理方法,其中,所述获取所述终端中后台运行的各个应用的优先级参数的步骤包括:
    获取所述终端中后台运行的各个应用在最近的预设时间段内的使用频率和使用时长;
    根据所述使用频率和使用时长确定各个所述应用的优先级参数,使用频率越高且使用时长越长的优先级参数越小。
  8. 如权利要求7所述的终端内存管理方法,其中,所述方法还包括:根据所述使用频率和所述使用时长确定后台各个所述应用的优先级排序;每个优先级对应一个所述优先级参数,所述优先级参数和优先级呈反比。
  9. 如权利要求3所述的终端内存管理方法,其中,所述监测所述终端中的当前剩余内存比的步骤之后还包括:
    当所述当前剩余内存比小于所述第二门限值时,按照所述权重值从小至大的顺序将后台运行的所述应用依序进行关闭,并当当前应用关闭后,所述当前剩余内存比大于或等于所述第二门限值时,停止关闭剩余的应用。
  10. 一种终端内存管理装置,其中,包括:
    判断模块,用于监测所述终端的剩余内存比,并判断当前剩余内存比是否小于第一门限值且大于第二门限值,所述第一门限值大于第二门限值,所述剩余内存比为所述终端的剩余内存与总的内存的比值;
    压缩模块,用于当当前剩余内存比小于第一门限值且大于第二门限值时,压缩所述终端中后台运行的应用。
  11. 如权利要求10所述的终端内存管理装置,其中,所述压缩模块包括:
    获取模块,用于获取所述终端中后台运行的各个应用的优先级参数、占用内存和未唤醒时长,并根据获取的数据计算每个所述应用的权重值,其中,所述权重值与优先级参数、占用内存,和未唤醒时长呈正相关的 关系;
    压缩子模块,用于按照所述权重值从大至小的顺序依序压缩所述应用,并当当前应用压缩后,所述当前剩余内存比大于或等于所述第一门限值时停止压缩。
  12. 如权利要求11所述的终端内存管理装置,其中,所述根据获取的数据计算每个所述应用的权重值的计算公式为:
    Figure PCTCN2019091302-appb-100002
    其中,W i为第i个应用的权重值,S i为第i个应用占用的内存,S total为所有应用占用的内存,P i为第i个应用的优先级参数,T i为第i个应用的未唤醒时长。
  13. 如权利要求11所述的终端内存管理装置,其中,还包括:
    解压模块,用于当所述当前剩余内存比大于第三门限值时,按照所述权重值从小至大的顺序将已压缩的所述应用依序进行解压,并当当前应用解压后,所述当前剩余内存比大于或等于所述第一压缩门限值时,停止解压,其中,所述第三门限值大于所述第一门限值。
  14. 如权利要求10所述的终端内存管理装置,其中,还包括:
    获取及修改模块,用于获取用户针对当前应用设置的目标优先级参数,并将所述当前应用的当前优先级参数修改为所述目标优先级参数。
  15. 如权利要求11所述的终端内存管理装置,其中,所述获取模块具体用于:
    获取所述终端中后台运行的各个应用在最近的预设时间段内的使用频率和使用时长;
    根据所述使用频率和使用时长确定各个所述应用的优先级参数,使用频率越高且使用时长越长的优先级参数越小。
  16. 如权利要求15所述的终端内存管理装置,其中,所述获取模块还用于:
    根据所述使用频率和所述使用时长确定后台各个所述应用的优先级排序;
    每个优先级对应一个所述优先级参数,所述优先级参数和优先级呈 反比。
  17. 如权利要求11所述的终端内存管理装置,其中,所述压缩子模块还用于:当所述终端的剩余内存比小于所述第二门限值时,不再进行内存压缩。
  18. 如权利要求11所述的终端内存管理装置,其中,还包括:
    关闭模块,用于当所述当前剩余内存比小于所述第二门限值时,按照所述权重值从小至大的顺序将后台运行的所述应用依序进行关闭,并当当前应用关闭后,所述当前剩余内存比大于或等于所述第二门限值时,停止关闭剩余的应用。
  19. 一种可读存储介质,其上存储有程序,其中,所述程序被处理器执行时实现如权利要求1-9任一所述的方法。
  20. 一种终端,包括存储器、处理器以及存储在存储器上并可在处理器上运行的程序,其中,所述处理器执行所述程序时实现如权利要求1-9任意一项所述的方法。
PCT/CN2019/091302 2018-06-15 2019-06-14 内存管理方法、装置、可读存储介质及终端 WO2019238124A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810621328.3A CN108932163A (zh) 2018-06-15 2018-06-15 内存管理方法、装置、可读存储介质及终端
CN201810621328.3 2018-06-15

Publications (1)

Publication Number Publication Date
WO2019238124A1 true WO2019238124A1 (zh) 2019-12-19

Family

ID=64446803

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/091302 WO2019238124A1 (zh) 2018-06-15 2019-06-14 内存管理方法、装置、可读存储介质及终端

Country Status (2)

Country Link
CN (1) CN108932163A (zh)
WO (1) WO2019238124A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076193A (zh) * 2021-03-26 2021-07-06 北京车和家信息技术有限公司 一种内存优化的方法、装置及计算机可读存储介质
CN113127094A (zh) * 2021-04-19 2021-07-16 Oppo广东移动通信有限公司 应用程序运行方法、装置、存储介质以及终端
CN116302572A (zh) * 2023-05-19 2023-06-23 长通智能(深圳)有限公司 基于ai智能推荐的算力资源调度分配系统及方法
US11861395B2 (en) 2020-12-11 2024-01-02 Samsung Electronics Co., Ltd. Method and system for managing memory for applications in a computing system

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108932163A (zh) * 2018-06-15 2018-12-04 奇酷互联网络科技(深圳)有限公司 内存管理方法、装置、可读存储介质及终端
CN110865884A (zh) * 2019-09-30 2020-03-06 华为技术有限公司 一种内存管理方法及装置
CN110888746B (zh) * 2019-12-10 2023-06-02 Oppo(重庆)智能科技有限公司 内存管理方法、装置、存储介质及电子设备
CN113886060B (zh) * 2021-05-28 2022-09-23 荣耀终端有限公司 压缩内存的方法和装置
CN116243850B (zh) * 2021-06-08 2024-05-28 荣耀终端有限公司 一种存储器管理方法及电子设备
TWI793966B (zh) * 2022-01-10 2023-02-21 群聯電子股份有限公司 記憶體管理方法、記憶體儲存裝置及記憶體控制電路單元
CN115309664B (zh) * 2022-10-11 2023-01-17 深圳市诚王创硕科技有限公司 一种软件问题跟踪方法和系统
CN115794413B (zh) * 2023-01-09 2024-05-14 荣耀终端有限公司 一种内存处理方法及相关装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975348A (zh) * 2016-05-31 2016-09-28 宇龙计算机通信科技(深圳)有限公司 一种内存优化方法、优化装置以及终端
CN106354562A (zh) * 2016-08-25 2017-01-25 上海传英信息技术有限公司 内存清理系统和内存清理方法
CN107220076A (zh) * 2016-09-27 2017-09-29 华为技术有限公司 一种内存回收方法及装置
CN108932163A (zh) * 2018-06-15 2018-12-04 奇酷互联网络科技(深圳)有限公司 内存管理方法、装置、可读存储介质及终端

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102479213B (zh) * 2010-11-25 2014-07-30 北大方正集团有限公司 数据缓冲方法和装置
CN103220427A (zh) * 2013-04-16 2013-07-24 广东欧珀移动通信有限公司 手机后台程序清理方法及手机
CN104503740A (zh) * 2014-12-01 2015-04-08 小米科技有限责任公司 内存管理方法和装置
CN104461737B (zh) * 2014-12-10 2018-01-16 广东欧珀移动通信有限公司 一种内存管理方法和装置
CN104503840B (zh) * 2014-12-15 2016-09-28 北京奇虎科技有限公司 对终端资源进行优化的方法及装置
CN105354093A (zh) * 2015-12-09 2016-02-24 广东欧珀移动通信有限公司 内存管理方法及移动终端
CN105701025B (zh) * 2015-12-31 2019-07-23 华为技术有限公司 一种内存回收方法及装置
CN106201708A (zh) * 2016-06-29 2016-12-07 宇龙计算机通信科技(深圳)有限公司 应用程序的冻结方法、应用程序的冻结装置和终端
CN106502785A (zh) * 2016-09-30 2017-03-15 维沃移动通信有限公司 一种移动终端的清理内存方法及装置
CN106959892A (zh) * 2017-03-30 2017-07-18 联想(北京)有限公司 进程处理方法、装置及电子设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975348A (zh) * 2016-05-31 2016-09-28 宇龙计算机通信科技(深圳)有限公司 一种内存优化方法、优化装置以及终端
CN106354562A (zh) * 2016-08-25 2017-01-25 上海传英信息技术有限公司 内存清理系统和内存清理方法
CN107220076A (zh) * 2016-09-27 2017-09-29 华为技术有限公司 一种内存回收方法及装置
CN108932163A (zh) * 2018-06-15 2018-12-04 奇酷互联网络科技(深圳)有限公司 内存管理方法、装置、可读存储介质及终端

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11861395B2 (en) 2020-12-11 2024-01-02 Samsung Electronics Co., Ltd. Method and system for managing memory for applications in a computing system
CN113076193A (zh) * 2021-03-26 2021-07-06 北京车和家信息技术有限公司 一种内存优化的方法、装置及计算机可读存储介质
CN113076193B (zh) * 2021-03-26 2024-03-26 北京车和家信息技术有限公司 一种内存优化的方法、装置及计算机可读存储介质
CN113127094A (zh) * 2021-04-19 2021-07-16 Oppo广东移动通信有限公司 应用程序运行方法、装置、存储介质以及终端
CN116302572A (zh) * 2023-05-19 2023-06-23 长通智能(深圳)有限公司 基于ai智能推荐的算力资源调度分配系统及方法
CN116302572B (zh) * 2023-05-19 2023-08-01 长通智能(深圳)有限公司 基于ai智能推荐的算力资源调度分配系统及方法

Also Published As

Publication number Publication date
CN108932163A (zh) 2018-12-04

Similar Documents

Publication Publication Date Title
WO2019238124A1 (zh) 内存管理方法、装置、可读存储介质及终端
US11204806B2 (en) Systems and methods for user adaptive resource management
TWI533205B (zh) 應用程式存留期管理
US9696782B2 (en) Battery parameter-based power management for suppressing power spikes
US7596705B2 (en) Automatically controlling processor mode of multi-core processor
US8839256B2 (en) Utilization of special purpose accelerators using general purpose processors
US9244682B2 (en) Idle detection
CN109525500B (zh) 一种自调整阈值的信息处理方法及信息处理装置
US20160134723A1 (en) Adaptive compression management for web services
US20100070669A1 (en) Smart profiler
US11301296B2 (en) Memory management based on classification of a software process
CN105824691B (zh) 动态调节线程的方法及装置
CN106406494B (zh) 一种处理器调度的方法及终端
CN114253683B (zh) 任务处理方法、装置、电子设备及存储介质
CN113225265B (zh) 流量控制方法、装置、设备和计算机存储介质
CN116204293A (zh) 一种资源调度方法、装置、计算机设备以及存储介质
US20140337038A1 (en) Method, application, and device for audio signal transmission
US20150212569A1 (en) User space based performance state switching of a processor of a data processing device
US20050050550A1 (en) Method and system for moderating thread priority boost for I/O completion
CN111090627B (zh) 基于池化的日志存储方法、装置、计算机设备及存储介质
KR102037479B1 (ko) 최적화된 게임 설정 정보 제공 방법 및 장치, 게임 실행 최적화 방법 및 장치
CN112806070B (zh) 网络功耗调整方法、网络功耗调整装置及移动终端
CN107861894B (zh) NVMe协议的队列命令的执行方法、装置及存储介质
US11431349B2 (en) Method, electronic device and computer program product for processing data
EP3812902B1 (en) Method for controlling memory resources in an electronic device, device for controlling memory resources, electronic device and computer program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19819917

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19819917

Country of ref document: EP

Kind code of ref document: A1