CN106843758A - Mobile device memory management method and device - Google Patents

Mobile device memory management method and device Download PDF

Info

Publication number
CN106843758A
CN106843758A CN 201710026421 CN201710026421A CN106843758A CN 106843758 A CN106843758 A CN 106843758A CN 201710026421 CN201710026421 CN 201710026421 CN 201710026421 A CN201710026421 A CN 201710026421A CN 106843758 A CN106843758 A CN 106843758A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
application
memory
exchanged
step
process
Prior art date
Application number
CN 201710026421
Other languages
Chinese (zh)
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

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from or digital output to record carriers, e.g. RAID, emulated record carriers, networked record carriers
    • G06F3/0601Dedicated interfaces to storage systems
    • G06F3/0602Dedicated interfaces to storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from or digital output to record carriers, e.g. RAID, emulated record carriers, networked record carriers
    • G06F3/0601Dedicated interfaces to storage systems
    • G06F3/0628Dedicated interfaces to storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0634Configuration or reconfiguration of storage systems by changing the state or mode of one or more devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from or digital output to record carriers, e.g. RAID, emulated record carriers, networked record carriers
    • G06F3/0601Dedicated interfaces to storage systems
    • G06F3/0628Dedicated interfaces to storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATIONS NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/60Subscription-based services using application servers or record carriers, e.g. SIM application toolkits

Abstract

The invention discloses a mobile device memory management method and device, wherein the method comprises the steps of finding at least one application independent of a specified application and meeting a predetermined algorithm as an application to be exchanged; executing memory exchange according to the application to be exchanged, wherein the execution of memory exchange is completed before the startup of the specified application. In memory exchange, finding an application to be exchanged according to the predetermined algorithm is considered, dependence between the applications is also considered; therefore, invalid memory exchange is eliminated, and user experience on device use is improved.

Description

一种移动设备内存管理方法及装置 A mobile device memory management method and apparatus

[0001]本申请为申请人“中兴通讯股份有限公司”于申请日2011年5月23日提交的、申请号为〃201110135149.7〃、发明名称为“一种移动设备内存管理方法及装置,,的发明专利申请的分案申请。 [0001] The applicant of the present application is a "ZTE" filed on May 23, 2011, filed, 〃201110135149.7〃 Application No., entitled Method and apparatus for memory management apparatus "of a mobile ,, divisional patent application of the invention.

技术领域 FIELD

[0002]本发明涉及内存管理,尤其涉及一种移动设备内存管理系统及方法。 [0002] The present invention relates to memory management, memory management, and particularly to a system and method a mobile device.

背景技术 Background technique

[0003]随着3G和智能机时代的来临,手机等移动设备上的应用程序越来越多,这类手机等移动设备采用多任务的操作系统,可以同时运行着多个任务。 [0003] As more and more applications on the 3G era of intelligent machines and the advent of mobile phones and other mobile devices, mobile phones and other mobile devices using such multitasking operating system, you can run the multiple tasks simultaneously. 为了提高多任务的用户体验,手机等移动设备配备了大容量内存。 In order to improve the user experience, multi-tasking, mobile phones and other mobile devices with large memory capacity. 但是,内存容量的增加受到成本、功耗、体积等的限制。 However, increasing the memory capacity is limited by cost, power consumption, size and the like. 因此,如何在多任务情况下降低内存使用量成为亟待解决的问题。 Therefore, how to reduce memory usage has become an urgent problem in multitasking situations.

[0004]内存交换是在PC机和服务器上广泛使用的一种用来降低内存使用量的方法。 A method for reducing the amount of memory used for [0004] exchange memory is widely used in the PC and server. 它的基本原理是:当系统内存不足时,把内存中的一些内容交换到外存中,从而腾出内存空间; 当系统运行到需要被交换到外存的内容时,就把交换到外存中的内容再次交换到内存中; 在这个过程中如果发生内存不足,就会涉及到另一次交换过程。 Its basic principle is: When the system memory, some contents of memory swapped to external memory, thus freeing up memory space; when the system needs to run to be traded to the content of external memory, put the exchange to the external memory the contents again switched into memory; in this process if insufficient memory occurs, it involves another exchange. 这样,系统的有效内存空间大小就是实际内存大小加上外存上可以用来存放交换内容的空间之和。 Thus, the effective size of the system memory is coupled with the actual memory size of the space of the external memory can be used to store and exchange content. 通过内外存交换, 可以实现用较少的内存达到更大内存的效果。 And external storage through the exchange, may be implemented with less memory achieve more memory. 目前,PC机和服务器上的内存交换方法基本上是作为操作系统的一个基本功能(即虚拟存储器管理)模块在操作系统的内核中实现,其使用LRU (Lease Recently Use,最近最少使用)算法,将最近最长时间不使用的优先交换出去,并以内存页为最小单位进行交换。 Currently, PC machine and memory on the server switching method substantially as a basic function of the operating system (i.e., virtual memory management) module implemented in an operating system kernel, using LRU (Lease Recently Use, least recently used) algorithm, the most recent time priority switching is not used to go out, and to the memory page is the smallest unit of exchange. 内存页是操作系统管理内存的基本单位,32位的Linux操作系统的一个内存页大小一般为4KB。 Memory page is the basic unit of the operating system manages memory, a memory page size 32-bit Linux operating system is generally 4KB.

[0005] 然而,PC机和服务器上使用的内存交换方式存在以下问题: [0005] However, there is a problem, PC machine, and memory use on the server exchange:

[0006] 1)当把最近最长时间不使用的内存页交换出去时,有可能发生当前要运行的应用程序就要使用刚被交换出去的内存页,于是这部分被交换出去的内存页中的内容又马上要交换到内存中来; [0006] 1) When the most recent memory pages swapped out for a long time do not use, it may happen to run applications that are currently necessary to use the memory page has just been swapped out, so this part of the swap out memory pages the content then immediately be exchanged into memory;

[0007] 2)为了提高内存使用率,操作系统每次会选择尽可能少交换内存页,于是当前要运行的应用程序在正常运行过程中可能又会发生内存不足的情况,于是系统又会进行内存交换,以便让应用程序能够正常运行下去。 [0007] 2) In order to improve memory usage, the operating system will choose the less each swap memory pages as possible, so the application is currently possible to run out of memory will occur during normal operation, the system will then be swapping to allow applications to continue to run normally.

[0008] 这两个问题导致无效的内存交换和内存交换过于频繁,而且,在进行内存交换时, 系统不能执行任何其它的操作。 [0008] These two issues led to invalid memory and swap memory swap too often, and, during the swapping, the system can not perform any other operations. 因此,过多和频繁的内存交换就会使应用程序运行变慢,运行不流畅,运行过程中时不时出现短促的停顿,这会极大降低用户体验。 Therefore, excessive and frequent memory swapping will make applications run slow, is not running smoothly, a short pause from time to time occur during operation, which will greatly reduce the user experience. PC机和服务器由于CPU性能强劲,这种运行变慢和运行不流畅对用户体验的影响相对轻微,而手机等移动设备的CPU性能相对较弱,运行变慢和运行不流畅对用户体验的影响就会很明显,从而导致用户体验变得很差。 Due to strong PC and server CPU performance, which is not running smoothly run slower and impact on the user experience is relatively minor, and the CPU performance of mobile phones and other mobile devices is relatively weak, slow running and not running smoothly impact on the user experience it will be very obvious, so the user experience becomes poor. 正是由于这个原因,在手机等移动设备上都没有使用内存交换来降低内存使用量。 It is for this reason, do not use swap memory in mobile phones and other mobile devices to reduce memory usage.

发明内容 SUMMARY

[0009] 本发明要解决的主要技术问题是,提供一种移动设备中内存管理的方法及装置, 在通过内存交换降低内存使用量的同时,尽量做到不影响用户体验。 [0009] The present invention is to solve the major technical problem is to provide a mobile device memory management method and apparatus, while reducing the amount of memory used by the memory swap, as far as possible without affecting the user experience.

[0010] 根据本发明的一种实施方式,提供一种移动设备内存管理方法,包括:查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序;根据所述待交换的应用程序执行内存交换处理,其中,所述执行内存交换处理在启动所述指定应用程序之目! [0010] According to one embodiment of the present invention, there is provided a memory management method for a mobile device, comprising: at least one application and find application no dependencies specified and in accordance with a predetermined algorithm as the application to be exchanged; according to the application to be exchanged perform memory swapping process, wherein performing the swapping process entry specifies the start of the application! J完成。 J to complete.

[0011] 进一步地,所述查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序这一步骤包括:从正运行的应用程序中查找符合预定算法的应用程序;从查找到的符合预定算法的应用程序中查找与指定应用程序无依赖关系的应用程序,将其作为待交换的应用程序。 [0011] Further, the program can not find the specified application and in accordance with a predetermined algorithm dependency of the at least one step application as the application to be exchanged comprises: finding applications in line with a predetermined algorithm from an application running in ; find an application with the specified application no dependencies from the found application meets predetermined algorithm, as their applications to be exchanged.

[0012] 一种实施例中,根据所述待交换的应用程序执行内存交换处理这一步骤包括:选中一个所述待交换的应用程序,将该选中的应用程序所对应的进程所属的内存页交换到外存中;判断该应用程序所占的内存量与系统当前的可用内存量之和是否大于等于第一预设阈值;如果不是,则继续执行选中一个所述待交换的应用程序这一步骤。 [0012] In one embodiment, according to the application program execution memory to be exchanged this exchange processing step comprises: a check of the application to be exchanged, the memory page corresponding to the selected application process belongs switching to the external memory; determining the current amount of memory available and the amount of system memory is occupied by the application and not less than a first preset threshold value; if not, proceed to select one application program that is to be exchanged step.

[0013] 另一种实施例中,根据待交换的应用程序执行内存交换处理这一步骤包括:选中一个所述待交换的应用程序,标记该选中的应用程序;判断该标记的应用程序所占的内存量与系统当前的可用内存量之和是否大于等于第一预设阈值;如果不是,则继续执行选中一个所述待交换的应用程序这一步骤;如果是,则将所有标记的应用程序各自对应的进程所属的内存页交换到外存中。 [0013] In another embodiment, the processing performed according to the application swapping to be exchanged in this embodiment comprises: a check of the application to be exchanged, the flag of the selected application; determining the application share tag the current amount of memory the system and the amount of memory available is greater than equal to a first predetermined threshold; if not, proceed to select one application program to be exchanged this step; If so, the applications of all the tags memory pages corresponding to each switching process belongs to the external memory.

[0014] 又一种实施例中,根据待交换的应用程序执行内存交换处理这一步骤包括:将所述待交换的应用程序所对应的进程所属的内存页交换到外存中。 [0014] In yet another embodiment, depending on the application execution memory to be exchanged this exchange process comprising the step of: switching to the external memory in the memory page of the application to be exchanged corresponding process belongs.

[0015] 优选地,所述查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序这一步骤之前还包括:判断系统当前的可用内存量是否大于等于第二预设阈值;若小于所述第二预设阈值,则执行所述查找与指定应用程序无依赖关系且符合预定算法的应用程序作为待交换的应用程序步骤;否则不作处理。 Before [0015] Preferably, said at least one step of this find application as the application to be exchanged with the specified application no dependencies and meets predetermined algorithm further comprises: determining the current amount of memory available is greater than equal to a second system preset threshold; if less than the second predetermined threshold value, the lookup is performed and the specified application no dependencies predetermined algorithm and in accordance with the application as an application instruction to be exchanged; otherwise not be processed.

[0016] 优选地,所述符合预定算法的应用程序包括最近最少使用CPU的应用程序。 [0016] Preferably, the predetermined algorithm compliant application comprises a least recently used application CPU.

[0017] 优选地,根据待交换的应用程序执行内存交换管理处理这一步骤之后还包括:执行正常的应用程序启动流程启动所述指定应用程序;当所述指定应用程序为系统当前正待启动的新的应用程序时,所述根据待交换的应用程序执行内存交换管理处理这一步骤之后还包括:执行正常的应用程序启动流程启动所述新的应用程序。 After [0017] Preferably, the processing steps of the application to be exchanged to exchange management execution memory further comprising: performing a normal application is started the process starts said specified application program; when the specified application is currently pending system boot when a new application, the management process performed after the swapping step further comprises the application to be exchanged according to: perform a normal application of the startup process to start a new application.

[0018] 根据本发明的另一种实施方式,提供一种移动设备内存管理装置,包括:应用管理与控制模块,用于查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序;内存交换模块,用于根据所述应用管理与控制模块的指示,将所述待交换的应用程序所对应的进程所属的内存页交换到外存中。 [0018] According to another embodiment of the present invention, there is provided a mobile device memory management apparatus comprising: an application management and control module, configured to search the application to specify dependencies and non-compliance with a predetermined algorithm as at least one application application to be exchanged; memory switching module, according to an instruction of the application for management and control module, said application memory page to be exchanged corresponding process belongs to the exchange of the external memory.

[0019] 进一步地,所述符合预定算法的应用程序包括最近最少使用CPU的应用程序。 [0019] Further, the application of the line with a predetermined algorithm comprises a least recently used application CPU.

[0020] 本发明的有益效果在于:在进行内存交换时既考虑了按预定算法查找待交换的应用程序,又考虑到应用程序间的依赖性,从而消除了无效的内存交换,提高了用户使用设备的体验感。 [0020] Advantageous effects of the present invention is that: during swapping consider both lookup algorithm to be exchanged by a predetermined application, taking into account dependencies between applications, thereby eliminating the invalid memory exchange, improved user experience a sense of the device. 一种实施例中$考虑了一次交换出去的内存页数量与系统当前最大内存使用量的关系^而解决了P存交换过于频繁问题,降低内存交换频率;又一种实施例中考虑在启动程序前完成内存交换,保证在应用程序运行过程中没有内存交换,从而消除内存交换对应用程序运行过程的影响。 One embodiment consider the relationship between the current maximum $ memory usage of the system with a number of memory pages swapped out ^ too often solves the problem P deposit exchange, reduce memory swapping frequency; yet another example, consider the implementation of the program to start before completing the swap memory, memory swapping to ensure that no application is running in the process, thereby eliminating the impact on the process of swapping applications running.

附图说明 BRIEF DESCRIPTION

[0021]图1是本发明实施例提供的移动设备内存管理装置的结构示意图; [0021] FIG. 1 is a schematic structural diagram of a mobile device memory management apparatus according to an embodiment of the present invention;

[0022]图2是本发明实施例一移动设备内存管理方法的流程示意图; [0022] FIG. 2 is a schematic view of a process memory management method of a mobile apparatus according to the present invention;

[0023] 图3是本发明实施例二移动设备内存管理方法的流程示意图; [0023] FIG. 3 is a schematic view of the process the second mobile device memory management method according to embodiments of the present invention;

[0024] 图4是本发明实施例三移动设备内存管理方法的流程示意图; [0024] FIG. 4 is a schematic flow three mobile device memory management method according to embodiments of the present invention;

[0025]图5是本发明实施例四移动设备内存管理方法的流程示意图; [0025] FIG. 5 is a schematic view of four memory management process of the mobile device according to embodiments of the present invention;

[0026]图6是本发明实施例五移动设备内存管理方法的流程示意图; [0026] FIG. 6 is a schematic flow five mobile device memory management method according to embodiments of the present invention;

[0027]图7是本发明实施例六移动设备内存管理方法的流程示意图; [0027] FIG. 7 is a flowchart of a mobile device according to a sixth embodiment of a memory management method of the present invention, a schematic view;

[0028]图8是本发明一种实施例应用于Android手机中的内存管理装置的结构示意图; [0029]图9是与图8相对应的Andro id手机中内存管理方法的流程示意图。 [0028] FIG. 8 is a schematic structural diagram applied Android phone memory management apparatus of the embodiment of the present invention; [0029] FIG. 9 is a flow chart of Andro id phone memory management corresponding to FIG. 8.

具体实施方式 Detailed ways

[0030]下面通过具体实施方式结合附图对本发明作进一步详细说明。 [0030] The following figures present invention will be further described in detail by specific embodiments in combination.

[0031]本发明实施例的设计思想是:1)选择要交换出去的内存页时,既考虑使用预定算法来选择应用程序,也考虑当前要运行的应用程序是否可能使用,只有同时满足这两个条件的内存页才被选择交换出去;2)—次交换出去的内存页数量要满足当前要运行的应用程序可能的最大内存使用量;3)内存交换在启动当前要运行的应用程序之前完成。 [0031] The design idea of ​​an embodiment of the present invention is: 1) Select the memory page to be swapped out when using a predetermined algorithm to consider both the selected application, the application is also currently considering whether to run may be used, only satisfy both the condition was only choose to swap out memory pages; 2) - the number of times a page to be swapped out of memory to run applications that meet current possible maximum memory usage; 3) memory swap completed before the start of the current application to run . 其中,思想点1)消除了无效的内存交换,思想点2)降低了内存交换频率到只有1次,思想点3)保证在应用程序运行过程中没有内存交换,从而消除内存交换对应用程序运行过程的打扰。 Among them, thinking point 1) eliminates invalid memory exchange ideas point 2) reduces the memory switching frequency to only once, ideological point 3) to ensure that no swapping the application is running, eliminating memory swap running applications disturb the process. 一种实施例中将这三点结合起来,就可以既能够使用内存交换来降低内存使用量,又不会降低应用程序运行的速度和流畅性,消除了传统内存交换技术在移动设备如手机上的缺点。 One embodiment, the combination of these three o'clock, can either be used to reduce memory swapping memory usage, but no application running speed and fluidity, eliminating the traditional exchange of memory in mobile devices such as mobile phones on a Shortcomings.

[0032]如图1所示,本发明一种实施例提供的移动设备中内存管理装置包括:应用管理与控制模块和内存交换模块。 Application management and control module and a switching module memory: [0032] As shown in FIG 1, the present invention is a mobile device memory management apparatus include embodiments. 其中,应用管理与控制模块,用于查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序;所述内存交换模块,用于根据所述应用管理与控制模块的指示,将所述待交换的应用程序所对应的进程所属的内存页交换到外存中。 Wherein the application management and control module, configured to search the application to specify dependencies and non-compliance with the predetermined algorithm of the at least one application as the application to be exchanged; switching to the memory module, according to the application for management and control module indication, the application of the pages of memory to be exchanged corresponding process belongs to the exchange of the external memory. 一种实施例中,内存是RAM,外存是FLASH。 In one embodiment, the memory is a RAM, the external memory is FLASH.

[0033] 本发明实施方式提供了基于上述内存管理装置的内存管理方法,包括:查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序;根据所述待交换的应用程序执行内存交换处理。 [0033] Embodiment of the present invention provides a memory management method based on the above-described memory management apparatus, comprising: at least one application and find application no dependencies specified and in accordance with a predetermined algorithm as the application to be exchanged; to be exchanged in accordance with the the application performs memory swapping process.

[0034] 一种实施例中,预定算法采用类似最近最少使用页面置换算法(LRU)的算法,即最近最少使用CHJ算法(为方便描述,下文将最近最少使用(PU的算法也称为LRU算法),也就是说,在该实施例中,符合预定算法的应用程序为最近最少使用CPU的应用程序;其他实施例中还可以使用其他算法,本发明不限于LRU这种算法。 [0034] In one embodiment, the predetermined algorithm is a least recently used algorithm similar page replacement algorithm (LRU), i.e., least recently used algorithm CHJ (For convenience of description, hereinafter the least recently used (PU algorithm is also called the LRU algorithm ), that is to say, in this embodiment, the application meets predetermined algorithm is a least recently used application CPU; the other embodiments, other algorithms may also be used, the present invention is not limited to such a LRU algorithm.

[0035] 一种实施例中,所述查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序这一步骤包括:从正运行的应用程序中查找符合预定算法的应用程序;从查找到的符合预定算法的应用程序中查找与指定应用程序无依赖关系的应用程序,将其作为待交换的应用程序。 [0035] In one embodiment, this step is to find the specified application no dependencies predetermined algorithm and in accordance with at least one application as the application to be exchanged comprises: a predetermined algorithm to find qualified from an application running in application; find an application with the specified application no dependencies from the found application meets predetermined algorithm, as their applications to be exchanged. 对于该步骤,一种示例性做法是:查找符合预定算法的一个应用程序;判断该查找到的应用程序与指定应用程序之间是否存在依赖关系;若存在依赖关系,则重新查找下一个符合预定算法的应用程序。 For this step, an exemplary approach is: find application in line with a predetermined algorithm; determining whether a dependency exists between the applications and to find a specified application; if dependencies exist, re-find the next predetermined the application of the algorithm.

[0036] 对于根据所述待交换的应用程序执行内存交换处理这一步骤: [0036] For the implementation of the swapping based on the application of this process to be exchanged steps:

[0037] 一种实施例中,该步骤包括:将所述待交换的应用程序所对应的进程所属的内存页交换到外存中。 [0037] In one embodiment, the step comprising: switching to the external memory in the memory page of the application to be exchanged corresponding process belongs.

[0038] 另一种实施例中该步骤包括:选中一个所述待交换的应用程序,将该选中的应用程序所对应的进程所属的内存页交换到外存中;判断该应用程序所占的内存量与系统当前的可用内存量之和是否大于等于第一预设阈值;如果不是,则继续执行选中一个所述待交换的应用程序这一步骤。 [0038] Another embodiment comprises the steps: to select one of the application to be exchanged, the memory page corresponding to the selected application process belongs to the exchange of the external memory; application determines the share the current amount of memory available and the amount of memory the system is greater than equal to a first predetermined threshold; if not, proceed to select one application program to be exchanged in this step. 出于执行效率上的考虑,可将该实施例进行优化,即该步骤包括: 选中一个所述待交换的应用程序,标记该选中的应用程序;判断该标记的应用程序所占的内存量与系统当前的可用内存量之和是否大于等于第一预设阈值;如果不是,则继续执行选中一个所述待交换的应用程序这一步骤;如果是,则将所有标记的应用程序各自对应的进程所属的内存页交换到外存中。 For considerations of efficiency, this embodiment may be optimized, i.e., the step comprising: one of said selected application program to be exchanged, the flag of the selected application; Analyzing the labeled amount of memory occupied by the application the current system and the amount of memory available is greater than equal to a first predetermined threshold; if not, proceed to select one application program to be exchanged this step; if so, all the marks corresponding to each of the application process memory page belongs exchange to the external memory. 这里,第一预设阈值为实验值,实施例中第一预设阈值是能满足移动设备中任意一个应用程序运行时需要的内存量。 Here, the first preset threshold value Found, embodiment, the first threshold is a predetermined amount of memory to meet any of a mobile device when an application needs to run.

[0039] 一种实施例中,所述查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序这一步骤之前还包括:判断系统当前的可用内存量是否大于等于第二预设阈值;若小于第二预设阈值,则执行所述查找与指定应用程序无依赖关系且符合预定算法的应用程序作为待交换的应用程序步骤;否则不作处理。 Before [0039] In one embodiment, this step is to find the at least one application as the application to be exchanged with the specified application no dependencies and meets predetermined algorithm further comprises: determining the current amount of memory available is greater than the system equal to a second predetermined threshold; if less than a second predetermined threshold value, the lookup is performed and the specified application no dependencies predetermined algorithm and in accordance with the application as an application instruction to be exchanged; otherwise not be processed. 这里,第二预设阈值为实验值,实施例中第二预设阈值是能满足移动设备中任意一个应用程序运行时需要的内存量。 Here, the second predetermined threshold is the experimental value, the second embodiment is the embodiment preset threshold value needs to meet any one of the runtime application the amount of memory in a mobile device.

[0040] —种实施例中,根据待交换的应用程序执行内存交换管理处理这一步骤之后还包括:执行正常的应用程序启动流程启动所述指定应用程序;当所述指定应用程序为系统当前正待启动的新的应用程序时,所述根据待交换的应用程序执行内存交换管理处理这一步骤之后还包括:执行正常的应用程序启动流程启动所述新的应用程序。 [0040] - after the seed embodiment, depending on the application of this process to be exchanged exchange memory management steps further comprising: performing a normal application is started the process starts said specified application program; when the specified application system for the current when starting a new pending application execution after the switching memory management process further comprising the step of the application to be exchanged: performing normal application startup process to start the new application.

[0041] 以下通过几个实施例并结合图2-9详细说明根据本发明实施方式提供的移动设备内存管理方法。 [0041] By the following several embodiments 2-9 and described in detail in conjunction with memory management method for providing a mobile device according to an embodiment of the present invention, FIG. 为便于描述,以下各实施例中统一采用的预定算法为前述LRU算法,即最近最少使用CPU;应理解,本发明实施例还可以使用其他算法,并不限于LRU算法。 For ease of description, following a predetermined algorithm using the exemplary embodiment of the unified LRU algorithm, the CPU i.e., the least recently used; should be understood that the embodiments of the present invention may also use other algorithms, it is not limited to the LRU algorithm.

[0042] 实施例一: [0042] Example a:

[0043] 如图2所示,本实施例包含如下步骤: [0043] As shown in FIG. 2, this embodiment comprises the steps of:

[0044] 步骤S201:按预定算法查找APP; [0044] Step S201: Find APP predetermined algorithm;

[0045] 采用LRU算法查找应用程序APP,即在当前运行应用程序列表中查找最近最少使用CPU的应用程序;可以理解,正在运行的应用程序并不一定是正占用CPU的应用程序,而是操作系统为这个应用程序创建了进程的应用程序。 [0045] The LRU algorithm to find the application APP, that is, look at the list of applications currently running in the application of the least recently used CPU; to be understood that the application is running is not necessarily being CPU-intensive applications, but the operating system Creating the application process for this application.

[0046] 步骤S2〇2:判断指定应用程序是否依赖于所查找的应用程序APP的组件,这里,指定应用程序是指当前运行应用程序列表中除应用程序APP外的其他应用程序。 [0046] Step S2〇2: determining whether the specified application component depends on the sought applications APP, where, specify the application refers to the list of applications currently running other applications in addition to the application APP.

[0047] 若指定应用程序与应用程序APP存在依赖关系,则排除应用程序APP,转步骤S201, 查找下一个最近最少使用CHJ的应用程序;可以理解,排除应用程序APP是指不考虑将应用程序APP对应的进程所属的内存页作为可以交换出去的内存页。 [0047] When the application designates application APP dependencies, excluded the application APP, transfer step S201, the Find a least recently used CHJ application; will be understood to exclude the application APP means irrespective application APP memory page corresponding process belongs as a memory page can be swapped out.

[0048]若预定的应用程序与应用程序APP不存在依赖关系,则转步骤S2〇3。 [0048] When a predetermined application program and the application APP no dependency, then go to step S2〇3.

[0049]步骤S203:进行内存交换,具体而言,把查找到的最近最少使用CPU的应用程序App 所对应的进程所属的内存页作为可以交换出去的内存页,将其交换到外存中。 [0049] Step S203: for memory exchange, specifically, the memory pages to find the least recently used CPU in the App corresponding process belongs as can be swapped out of memory pages, swap it to the external memory.

[0050] 步骤S204:内存交换流程结束。 [0050] Step S204: swapping process ends.

[0051]本实施例既考虑LRU算法的优势又考虑应用程序之间组件的依赖关系,只有同时满足这两个条件的内存页才被选择交换出去,从而消除了无效的内存交换。 [0051] Advantages of the present embodiment, the LRU algorithm considering both the components and considering the dependencies between applications, only satisfy these two conditions was only selected memory page swapped out, thereby eliminating the invalid memory exchange.

[0052] 实施例二: [0052] Example II:

[0053]如图3所示,本实施例包含如下步骤: [0053] As shown in FIG. 3, this embodiment comprises the steps of:

[00M]步骤S301:与实施例一的步骤S201相同,即,在当前运行应用程序列表中查找最近最少使用(PU的应用程序APP。 [00M] Step S301: S201 and the same procedure as in Example one embodiment, i.e., find the least recently used (PU applications running in the application APP in the current list.

[0055]步骤S3〇2:判断指定应用程序是否依赖于应用程序APP的组件,同样地,这里的指定应用程序是当前运行应用程序列表中除应用程序APP外的应用程序。 [0055] Step S3〇2: determining whether the specified application component depends on the application APP, likewise, where the specified application is running in the application list of applications in addition to the current application of APP. 若存在依赖关系,则排除应用程序APP,转步骤S301,查找下一个最近最少使用(yu的应用程序;若不存在依赖, 则转步骤S303; If there is a dependency relationship, the APP application is excluded, transfer step S301, the Find a least recently used (Yu application; if there is a dependency, then go to step S303;

[0056]步骤S303:将步骤S302中得到的符合预定算法且不存在依赖关系的应用程序所对应的进程所属的所有内存页作为可以交换出去的内存页,通知内存管理模块把这些内存页交换到外存中; [0056] Step S303: The application meets all memory pages predetermined algorithm and there is no dependence obtained in step S302 corresponds to the process belongs, as can be swapped out of memory pages, a memory management module notifies these to the exchange memory page external memory;

[0057]步骤S304:把系统当前的可用内存量加上步骤S303中交换出去的内存量,判断二者之和是否大于等于第一预设阈值。 [0057] Step S304: the current amount of memory available in the system plus the amount of memory to swap out the step S303, it is determined whether the sum is greater than both equal to a first predetermined threshold value. 这里,第一预设阈值含义如前述,在此不再赘述[0058]若二者之和大于等于预设阈值,转步骤S305;否则转步骤S301,查找下一个最近最少使用CPU的应用程序; Here, the first preset threshold meanings as mentioned above, are not repeated here [0058] if the sum of the two is greater than equal to the threshold, proceed to step S305; otherwise, turn step S301, the Find a least recently used application program for the CPU;

[0059]步骤S305:内存交换流程结束。 [0059] Step S305: swapping process ends.

[0060]本实施例不仅既考虑LRU算法的优势又考虑应用程序之间组件的依赖性关系,还考虑了进行一次内存交换的内存量要满足可能使用的最大内存量,只有同时满足这三个条件的内存页才被选择交换出去,从而既消除了无效的内存交换,又降低了交换频率至只有一次内存交换。 [0060] The present embodiment not only take into account both the advantages of LRU algorithm and consider the component dependencies between applications, but also consider the amount of memory in the memory once the exchange to meet the maximum amount of memory that may be used only meet three conditions memory pages swapped out why we have chosen, which not only eliminates invalid memory exchange, but also reduces the switching frequency to only one memory swapping.

[0061] 实施例三: [0061] Example III:

[0062]如图4所示,本实施例包括如下步骤: [0062] As shown in FIG. 4, the present embodiment includes the following steps:

[0063]步骤S401:与实施例一的步骤S2〇1相同,g卩,在当前运行应用程序列表中查找最近最少使用CPU的应用程序APP。 [0063] Step S401: a S2〇1 same procedure as in Example embodiment, g Jie, find the least recently used application CPU running the application APP in the current list. |^〇64]步骤S4=:判断指定应用程序是否依赖于应用程序APP的组件,同样地,这里的指定应用程序是当前运行应用程序列表中除应用程序APP外的应用程序。 | ^ 〇64] Step S4 =: determining whether the application is dependent on the specified component application APP, likewise, where the specified application is running in the application list of applications in addition to the current application of APP. 若存在依赖关系,则排除应用程序APP,转步骤S401,查找下一个最近最少使用CPU的应用程序;若不存在依赖, 则转步骤S403; If there is a dependency relationship, the APP application is excluded, transfer step S401, the Find a least recently used application program of the CPU; if there is a dependency, then go to step S403;

[0065]步骤S403:标记步骤S402中得到的符合预定算法且不存在依赖关系的应用程序APP [0065] Step S403: mark obtained in step S402 satisfies a predetermined algorithm and there is no dependence of the application APP

[0066]步骤S404:把系统当前的可用内存量加上步骤s4〇3中标记的应用程序所占的内存M,刊断一有乙和疋口、大于等于弟一预设阈值。 [0066] Step S404: The current system plus the amount of memory available in the memory flag M in step s4〇3 occupied applications, published acetate and have a breaking mouth piece goods, brother greater than or equal to a predetermined threshold. 这里,第一预设阈值为实验值,实施例中第一预设阈^是能满足移动设备中任意一个应用程序运行时需要的内存量。 Here, the first preset threshold value is experimental, as in the first embodiment ^ preset threshold amount of memory is able to meet any of a mobile device application that requires runtime.

[0067]若二者之和大于等于预设阈值,转步骤S405;否则转步骤s4〇1,查找下一个最近最少使用CPU的应用程序; ^°〇68]步骤S405:将所有标记的应用程序各自所对应的进程所属的所有内存页作为可以交换出去的内存页,通知内存管理模块把这些内存页交换到外存中. [0067] If the sum of the two is greater than equal to the threshold, proceed to step S405; otherwise, turn to Step s4〇1, Find a least recently used application program of the CPU; ^ ° 〇68] Step S405: The applications all marked All memory pages corresponding to each process belongs to a memory page can be swapped out, notify these memory management module page swapping memory to external memory.

[0069]步骤S406:内存交换流程结束。 [0069] Step S406: swapping process ends. ' '

[0070i可以看出,本实施例实际上是对实施例二在执行方面的优化,通过循环找出所有需要交换出去的应用程序后,然后集中一次把这些进程所属的内存页交换到外存中,从而优化了执行的效率。 [0070i can be seen that the present embodiment is actually in the two embodiments optimized implementation embodiment, by recycling all application needs to communicate to find out, and then concentrated to a memory page is swapped into these processes belong external memory to optimize the efficiency of the implementation.

[0071] 实施例四: [0071] Example IV:

[0072]如图5所示,本实施例包括如下步骤: [0072] As shown in FIG 5, the present embodiment includes the following steps:

[0073]步骤S501:首先判断系统当前的内存可用量是否大于第二预设阈值,若是,转步骤S5〇5;右否,则转步骤S5〇2;这里,第二预设阈值含义如前述,在此不再赘述 [0073] Step S501: First, the system determines whether the current memory can be an amount greater than a second predetermined threshold value, if yes, go to step S5〇5; Right no, then go to step S5〇2; Here, the second predetermined threshold value as described above meanings , not discussed here

[0074]步骤35〇2、35〇3、35〇4、55〇5分别与实施例一中的步骤5201、32〇2、5203、5204相同, 在此不再赘述。 The same [0074] Step 35〇2,35〇3,35〇4,55〇5 respectively example 1 step 5201,32〇2,5203,5204 embodiment, not described herein again.

[0075]本实施例在进行内存交换前,首先考虑系统当前内存可用量,然后再进行如实施例一的内存交换方法,进一步消除了无效的内存交换。 [0075] Example embodiment of the present swapping is performed before, first consider the systems currently available amount of memory, such as memory and then to an embodiment of the method of exchanging embodiment further eliminate invalid memory swapping.

[0076] 实施例五: [0076] Example Five:

[0077]如图6所示,本实施例包括如下步骤: [0077] As shown in FIG 6, the present embodiment includes the following steps:

[0078]步骤S601:首先判断系统当前的内存可用量是否大于预设阈值,若是,转步骤S606;若否,则转步骤S602; [0078] Step S601: First, the system determines the current amount of memory available is greater than a predetermined threshold value, if yes, go to step S606; if not, then go to step S602;

[0079]步骤3602、8603、8604、5605、3606分别与实施例二中的步骤3301、3302、3303、 S304、S305相同,在此不再赘述。 Respectively 3301,3302,3303, S304, same [0079] Step II Step 3602,8603,8604,5605,3606 Example embodiments S305, are not repeated here.

[0080]本实施例在进行内存交换前,首先考虑系统当前内存可用量,然后再进行如实施例二的内存交换方法,进一步消除了无效的内存交换。 [0080] The present embodiment is performed before the swapping, first consider the systems currently available amount of memory, such as memory and then to exchange method according to the second embodiment further eliminate invalid memory swapping.

[0081] 实施例六: [0081] Example VI:

[0082]如图7所示,包括如下步骤: [0082] As shown in FIG 7, comprising the steps of:

[0083]步骤S701:首先判断系统当前的内存可用量是否大于预设阈值,若是,转步骤S6〇6;若否,则转步骤S602; [0083] Step S701: First, the system determines the current amount of memory available is greater than a predetermined threshold value, if yes, go to step S6〇6; if not, then go to step S602;

[0084]步骤S702至S707分别与实施例三的步骤3401至34〇6相同,在此不再赘述。 [0084] Step S702 to step S707 are the same as in Example III and 3401 to 34〇6 embodiments, not described herein again.

[00K]本实施例在进行内存交换前,首先考虑系统当前内存可用量,然后再进行如实施例二的内存交换方法,进一步消除了无效的内存交换。 [00K] Example embodiment of the present swapping is performed before, first consider the systems currently available amount of memory, such as memory and then to exchange method according to the second embodiment further eliminate invalid memory swapping.

[0086]上述各个实施例的内存交换方法可应用在启动指定应用程序前,即在启动指定应^程序前,执行如上述各个实施例的内存交换流程,等内存交换完毕后在执行该指定应用程序别地,当该指定应用程序为系统当前待启动的新的应用程序时,在启动该新的应用程序前,执行如上述各个实施例的内存交换流程,等内存交换完毕后在执行该新的应用程序。 [0086] The respective memory exchange method of this embodiment may be applied before starting the specified application, i.e. after the start specified should ^ before the program is executed swapping processes of each of the above embodiments, and other memory swap completed the execution of the specified application procedures do not, when a new application of the designated application for the current system to be started before starting the new application, perform memory swapping processes of each of the above embodiments, and other memory after exchange was finished the execution of the new s application. 这种方式不仅消除了无效的内存交换,还保证在应用程序运行过程中没有内存交换,从而消除了内存交换对应用程序运行过程的打扰。 This approach not only eliminates invalid memory exchange, but also to ensure that no swapping the application is running, eliminating the bother of swapping process applications running.

[0087] 根据上述各实施例可以理解,在本发明实施例提供的移动设备内存管理装置中, 内存交换模块负责完成把指定的内存页的内容交换到外存中,以及把交换在外存中的内存页的内容在需要使用时(也就是CPU要读写这些内存页所属地址的内容时)自动读入到指定的内存页中;而应用管理与控制模块负责选择要交换出去的内存页和决定把内存页交换出去的时机,需要注意的是,实施例中应用管理与控制模块只是控制交换出去,而把交换出去的内容交换进来则是由内存交换模块自动完成的(该功能是由操作系统内核的缺页中断来完成的,本领域技术人员可通过现有技术实现)。 [0087] According to the above-described embodiments will be appreciated, in a mobile device memory management apparatus according to an embodiment of the present invention, the memory module is responsible for switching the complete contents of the specified memory page is swapped into the external memory, external memory and the exchange of (that is, when the CPU to memory to read and write the contents of these pages belong addresses) the contents of memory pages in use when needed automatically read into the specified memory pages; and application management and control module is responsible for selecting memory page and decided to swap out the timing of the memory pages swapped out, it is noted that the embodiment of application management and control module only controls swapped out, and the contents swapped out swapped is a swapping module automatically (this function by the operating system kernel page fault to complete, skilled in the art can be achieved by the prior art). 可以理解,本发明中的这种模块划分是为了描述方便而引入的一种逻辑上的概念,具体实现时,既可以一个模块对应一个独立的软件模块实体(如函数、类、进程、线程等),也可以多个模块对应一个软件模块实体,或者一个模块对应多个软件模块实体。 It will be appreciated, such a module is divided for convenience of description the present invention is introduced the concept of a logical, specific implementation, one module may be a separate software module corresponding to an entity (e.g., function, class, processes, threads, etc. ), corresponding to a plurality of modules may be software modules entity, or a module of software modules corresponding to the plurality of entities.

[0088] 下面以Android手机为例来进一步说明本发明一种实施例提供的移动设备内存管理方法。 [0088] In the following an example to further illustrate the Android mobile A mobile device memory management method according to an embodiment of the present invention. 现有技术中,Android手机米用了Linux操作系统技术和Java技术,这使得Android 手机的运行对内存大小非常敏感。 Art, rice Android phone with the Linux operating system and Java technology, which makes the Android phone running very sensitive to memory size. 当内存比较小时,Android手机运行会非常缓慢。 When the memory is small, Android phones will run very slowly. 为此, Android手机基本上都配备了大容量的内存。 For this reason, Android phones basically are equipped with large-capacity memory.

[0089] 如图8所不,应用管理和控制模块由ActivityManagerService和PackageManageService这两个类组成,而内存交换模块由Linux操作系统内核中的虚拟存储管理代码模块组成。 [0089] FIG. 8 is not the application by a management and control module and PackageManageService ActivityManagerService these two classes, and the memory switching modules by the Linux operating system kernel virtual memory management code module. 另外,应用控制与管理模块和内存交换模块之间的通信采用虚拟设备驱动程序——MMUDriver来完成。 Further, the communication between the application module and the control and management of the virtual memory swap modules --MMUDriver device drivers to complete.

[0090] 如图9所示,本例包含如下步骤: [0090] As shown in FIG. 9, the present embodiment comprises the steps of:

[0091] 步骤S901: Act ivityManagerService打开MMUDriver驱动,准备进行内存交换处理。 [0091] Step S901: Act ivityManagerService open MMUDriver drive in preparation for swapping process.

[0092] 步骤S902:ACtiVityManagerService检查系统当前可用的内存量是否大于等于预设阈值,如果是,转步骤S909,如果否,则转步骤S903。 [0092] Step S902: ACtiVityManagerService inspection system currently available is greater than the amount of memory equal to a preset threshold, if yes, turn step S909, the if no, then go to step S903. 这里,预设阈值通过试验来确定,原则上是能够满足手机上任意一个应用运行时需要的内存量; Here, the preset threshold is determined experimentally, in principle, the amount of memory to meet the needs of any application running on a mobile phone;

[0093] 步骤S9〇3:ActivityManagerService从正在运行的应用程序列表中找出最近最长时间没有使用CPU的应用程序; [0093] Step S9〇3: ActivityManagerService find the most recent time the application is not using the CPU from the list of applications running in;

[0094]步骤S904: ActivityManagerService 通过PackageManagerService 检查当前待启动的应用程序的描述信息,看其所要依赖的外部应用程序组件,可通过Intent方式描述,把这些信息进一步转换成要依赖的应用程序名称; [0094] Step S904: ActivityManagerService check the description information of the application to be activated by a current PackageManagerService, see the external application components it is dependent, can be described by Intent, the information is further converted into the name of the application dependent;

[0095] 步骤S905: ActivityManagerService查询正在运行的应用程序列表,将该表按最近最长时间没有使用CPU的原则进行排序(称为LRU表),从LRU表中选出第一个不在步骤S904中的应用程序(也就是说,该应用程序最近最长时间没有使用Cpu且其组件不被依赖), 作为要交换出去的应用程序; [0095] Step S905: the list of programs Application ActivityManagerService running queries, the sort tables (called LRU table) according to the most recent time the principle of not using the CPU, not elected the first step S904 from the LRU table the application (i.e., the application time is not the most recently used Cpu and its components are not dependent), as the application to be swapped out;

[0096] 步骤S9〇6: ActivityManagerService把步骤S905中选出的应用程序所对应的进程号以写MMUDriver驱动的方式发给丽UDriver驱动,然后通过读MMUDriver驱动的方式等待MMUDriver驱动返回处理结果; [0096] Step S9〇6: ActivityManagerService step S905 the selected application corresponding to the process ID for writing distributed manner MMUDriver Li UDriver driven drive, and wait for MMUDriver processing result is returned by the read drive MMUDriver driven manner;

[0097]步骤S907: MMUDriver 驱动收到步骤S906 中ActivityManagerService 发来的进程号后,调Linux内核的函数让内核的虚拟存储器模块把这个进程所占有的内存内容交换到外存中,完成这个操作后,MMUDriver驱动向上层回写一个状态值; After MMUDriver driver received in step S906 ActivityManagerService sent to process ID, tune the Linux kernel function so that the kernel virtual memory module to the process of memory occupied by the content exchange to the external memory to complete this operation: [0097] Step S907 write, MMUDriver drive back to a top state value;

[0098]步骤S9〇8:步骤S9〇6 中ActivityManagerService—直在等待MMUDriver 驱动的返回结果,待结果反馈时,六(:1:;[¥;^71&11^8666;1:¥;^6解除等待,读出|^1]〇;1';^61'驱动回写的状态值,继续往下执行如下操作:查看系统当前的空闲内存是否大于等于预设阈值,如果是, 则转步骤S909,否则,从LRU表中排除刚交换出去的应用,转步骤S905; [0098] Step S9〇8: When step S9〇6 ActivityManagerService- waiting MMUDriver return results in a straight drive, the results to be fed back, six (: 1:; [¥; ^ 71 & amp; 11 ^ 8666; 1: ¥; ^ 6 release wait, read | ^ 1] billion; 1 '; ^ 61' can drive the write state value, proceed down as follows: Check if the current system idle memory than or equal to a preset threshold, if yes, turn step S909, the otherwise exclude application just switched out from the LRU list, go to step S905;

[0099] 步骤S909:执行应用程序启动,流程结束。 [0099] Step S909: execute the application starts, the process ends.

[0100] 可以理解,作为一种执行效率上的优化,ActivityManagerService可以先循环找出所有需要交换出去的应用程序后,然后集中一次通知MMUDriver驱动把这些应用程序所对应的进程所属的内存页交换到外存中。 [0100] It is understood that as an optimization efficiency, ActivityManagerService cycle can first identify all the applications need to be swapped out, and then concentrated to a notice MMUDriver drive memory page corresponding to the application of these processes belongs to the exchange external memory.

[0101] 从上述各实施例可以看出,本发明实施例通过改进传统的内存交换方法来降低无效的内存交换,减弱传统内存交换方法对应用程序运行流畅度的影响,从而移动设备如手机上的内存使用量得以降低且又不影响用户体验。 [0101] As can be seen from the foregoing embodiments, for example by improving the conventional method of switching memory to reduce memory swapping invalid embodiment of the present invention, reduce the influence of the conventional memory exchange method for the application to run smoother, so that mobile devices such as mobile phones the memory usage is reduced and without affecting the user experience.

[0102] 上述实施例只是本发明的举例,尽管为说明目的公开了本发明的最佳实施例和附图,但是本领域的技术人员可以理解:在不脱离本发明及所附的权利要求的精神和范围内, 各种替换、变化和修改都是可能的。 [0102] the above-described embodiments are merely exemplary of the invention, while disclosing preferred embodiments of the present invention and the accompanying drawings for illustrative purposes, those skilled in the art will appreciate: without departing from the present invention as claimed in the appended claims and within the spirit and scope of the various alternatives, variations and modifications are possible. 因此,本发明不应局限于最佳实施例和附图所公开的内容。 Accordingly, the present invention should not be limited to the disclosure of preferred embodiments and the accompanying drawings.

Claims (10)

  1. 1. 一种移动设备内存管理方法,其特征在于,包括以下步骤: 查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序; 根据所述待交换的应用程序执行内存交换处理, 其中,所述执行内存交换处理在启动所述指定应用程序之前完成。 A mobile device memory management method, characterized by comprising the steps of: at least one application and find application no dependencies specified and in accordance with a predetermined algorithm as the application to be exchanged; application to be exchanged in accordance with the perform memory swapping process, wherein performing the swapping process is completed before starting the specified application.
  2. 2. 如权利要求1所述的方法,其特征在于,所述查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序这一步骤包括: 从正运行的应用程序中查找符合预定算法的应用程序; 从查找到的符合预定算法的应用程序中查找与指定应用程序无依赖关系的应用程序, 将其作为待交换的应用程序。 2. The method according to claim 1, characterized in that the program can not find the specified application and in accordance with a predetermined algorithm dependency of the at least one step of this application as the application to be exchanged includes: running the application from Find application program meets a predetermined algorithm; find an application with the specified application no dependencies from the found application meets predetermined algorithm, as will be exchanged in the application.
  3. 3. 如权利要求1或2所述的方法,其特征在于,根据所述待交换的应用程序执行内存交换处理这一步骤包括: 选中一个所述待交换的应用程序,将该选中的应用程序所对应的进程所属的内存页交换到外存中; 判断该应用程序所占的内存量与系统当前的可用内存量之和是否大于等于第一预设阈值;如果不是,则继续执行选中一个所述待交换的应用程序这一步骤。 3. The method according to claim 1, wherein the step of performing the swapping process comprising the application program to be exchanged: select one of the applications to be exchanged, the selected application memory page corresponding process belongs to the exchange of the external memory; current determines the amount of memory available and the amount of system memory is occupied by the application and not less than a first preset threshold value; if not, proceed to the selected one of this application step described later to be exchanged.
  4. 4. 如权利要求1或2所述的方法,其特征在于,根据待交换的应用程序执行内存交换处理这一步骤包括: 选中一个所述待交换的应用程序,标记该选中的应用程序; 判断该标记的应用程序所占的内存量与系统当前的可用内存量之和是否大于等于第一预设阈值;如果不是,则继续执行选中一个所述待交换的应用程序这一步骤;如果是,则将所有标记的应用程序各自对应的进程所属的内存页交换到外存中。 4. The method of claim 1 or claim 2, wherein the step of performing the swapping process comprising the application to be exchanged: select one of the applications to be exchanged, the flag of the selected application; Analyzing the amount of memory the system marks the current application occupied amounts of memory available is greater than and equal to a first predetermined threshold; if not, proceed to select one application program to be exchanged this step; if so, All memory pages will mark application the process belongs to the respective corresponding exchange to the external memory.
  5. 5. 如权利要求1或2所述的方法,其特征在于,根据待交换的应用程序执行内存交换处理这一步骤包括:将所述待交换的应用程序所对应的进程所属的内存页交换到外存中。 5. The method of claim 1 or claim 2, wherein the memory swap performs processing in accordance with the application to be exchanged includes the step of: the application swap memory pages to be exchanged by the corresponding process belongs to the external memory.
  6. 6. 如权利要求1-5任一项所述的方法,其特征在于,所述查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序这一步骤之前还包括: 判断系统当前的可用内存量是否大于等于第二预设阈值;若小于所述第二预设阈值, 则执行所述查找与指定应用程序无依赖关系且符合预定算法的应用程序作为待交换的应用程序步骤;否则不作处理。 6. If a method according to any one of claims 1-5, wherein said at least one step to find this application as the application to be exchanged with the specified application no dependencies and meets further predetermined algorithm comprising: determining a current amount of memory available is greater than the system equal to a second predetermined threshold; if less than the second predetermined threshold value, the lookup is performed and the specified application no dependencies predetermined algorithm and in accordance with the application to be exchanged as the application step; otherwise not be processed.
  7. 7. 如权利要求1-6任一项所述的方法,其特征在于,所述符合预定算法的应用程序包括最近最少使用CPU的应用程序。 7. The method of any one of claims 1-6, characterized in that, in line with the application comprises application of a predetermined algorithm a least recently used CPU.
  8. 8. 如权利要求1-7任一项所述的方法,其特征在于,根据待交换的应用程序执行内存交换管理处理这一步骤之后还包括:执行正常的应用程序启动流程启动所述指定应用程序; 当所述指定应用程序为系统当前正待启动的新的应用程序时,所述根据待交换的应用程序执行内存交换管理处理这一步骤之后还包括:执行正常的应用程序启动流程启动所述新的应用程序。 8. The method according to any of claims 1-7, characterized in that, after performing the swapping management process further comprising the step of the application to be exchanged: performing normal application start process to start the specified application program; after said specified application program when the system is currently awaiting a new start of an application, according to the application execution memory to be exchanged to exchange management process further comprises the step of: performing a normal application is started the process starts said new applications.
  9. 9. 一种移动设备内存管理装置,其特征在于,包括: 应用管理与控制模块,用于查找与指定应用程序无依赖关系且符合预定算法的至少一个应用程序作为待交换的应用程序; 内存交换模块,用十很做所边奴用管理与控制模块的指示,将所述待交换的应用程序所对应的进程所属的内存页交换到外存中,其中,所述执行内存交换处理在启动所述指定应用程序之前完成。 A mobile device memory management apparatus, characterized by comprising: an application management and control module, configured to search a specified application no dependencies and meet at least one predetermined algorithm for application as the application to be exchanged; memory swapping module, it is made with ten indicating the used slave side management and control module, said application memory page to be exchanged corresponding process belongs to the exchange of the external memory, wherein the memory is performed at start of the exchange process completed before said specified application.
  10. 10.如权利要求9所述的装置,其特征在于,所述符合预定算法的应用程序包括最近最少使用CPU的应用程序。 10. The apparatus according to claim 9, wherein the predetermined algorithm in line with the application comprises application of a least recently used CPU.
CN 201710026421 2011-05-23 2011-05-23 Mobile device memory management method and device CN106843758A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN 201110135149 CN102226894A (en) 2011-05-23 2011-05-23 Mobile device memory management method and device
CN 201710026421 CN106843758A (en) 2011-05-23 2011-05-23 Mobile device memory management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201710026421 CN106843758A (en) 2011-05-23 2011-05-23 Mobile device memory management method and device

Publications (1)

Publication Number Publication Date
CN106843758A true true CN106843758A (en) 2017-06-13

Family

ID=44807862

Family Applications (2)

Application Number Title Priority Date Filing Date
CN 201710026421 CN106843758A (en) 2011-05-23 2011-05-23 Mobile device memory management method and device
CN 201110135149 CN102226894A (en) 2011-05-23 2011-05-23 Mobile device memory management method and device

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN 201110135149 CN102226894A (en) 2011-05-23 2011-05-23 Mobile device memory management method and device

Country Status (2)

Country Link
CN (2) CN106843758A (en)
WO (1) WO2012159394A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103838620A (en) * 2012-11-20 2014-06-04 中兴通讯股份有限公司 Method and device for processing application programs
CN103117923B (en) * 2013-01-18 2016-06-29 杭州华三通信技术有限公司 A process whereby management method and apparatus
CN103106093A (en) * 2013-02-21 2013-05-15 北京奇虎科技有限公司 System operation quickening method and device
CN104156226A (en) * 2013-05-15 2014-11-19 索尼公司 Pending or shutdown method for hybrid memory device
CN104461737B (en) * 2014-12-10 2018-01-16 广东欧珀移动通信有限公司 A memory-management method and apparatus
CN105988842A (en) * 2015-02-12 2016-10-05 广东欧珀移动通信有限公司 Method for transferring application program, and terminal
CN105988875A (en) * 2015-03-04 2016-10-05 华为技术有限公司 Method and device for running process
CN106873664A (en) * 2017-02-28 2017-06-20 努比亚技术有限公司 Temperature control method and mobile terminal

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6877081B2 (en) * 2001-02-13 2005-04-05 International Business Machines Corporation System and method for managing memory compression transparent to an operating system
EP1505506A1 (en) * 2003-08-05 2005-02-09 SAP Aktiengesellschaft A method of data caching
CN100555222C (en) * 2007-02-15 2009-10-28 凌阳科技股份有限公司;北京北阳电子技术有限公司 Method for relocated loading application program and address relocation device
CN101686340A (en) * 2008-09-26 2010-03-31 深圳市朗科科技股份有限公司 Method and system for expanding function of image communication equipment
CN101847127B (en) * 2010-06-18 2012-01-25 福建星网锐捷网络有限公司 Memory management method and device
CN101882160B (en) * 2010-06-29 2012-09-12 宇龙计算机通信科技(深圳)有限公司 Web page management method and mobile terminal

Also Published As

Publication number Publication date Type
CN102226894A (en) 2011-10-26 application
WO2012159394A1 (en) 2012-11-29 application

Similar Documents

Publication Publication Date Title
US7191349B2 (en) Mechanism for processor power state aware distribution of lowest priority interrupt
US20110271126A1 (en) Data processing system
US20100146513A1 (en) Software-based Thread Remapping for power Savings
US20060136915A1 (en) Method and apparatus for scheduling multiple threads for execution in a shared microprocessor pipeline
US20060136919A1 (en) System and method for controlling thread suspension in a multithreaded processor
US20060150184A1 (en) Mechanism to schedule threads on OS-sequestered sequencers without operating system intervention
US7152170B2 (en) Simultaneous multi-threading processor circuits and computer program products configured to operate at different performance levels based on a number of operating threads and methods of operating
US20100185833A1 (en) Multiprocessor control apparatus, multiprocessor control method, and multiprocessor control circuit
US20140129808A1 (en) Migrating tasks between asymmetric computing elements of a multi-core processor
US7389403B1 (en) Adaptive computing ensemble microprocessor architecture
US7698540B2 (en) Dynamic hardware multithreading and partitioned hardware multithreading
US20130086365A1 (en) Exploiting an Architected List-Use Operand Indication in a Computer System Operand Resource Pool
US20070150895A1 (en) Methods and apparatus for multi-core processing with dedicated thread management
US7590774B2 (en) Method and system for efficient context swapping
US20140089635A1 (en) Processor having multiple cores, shared core extension logic, and shared core extension utilization instructions
US20100153761A1 (en) Multiprocessor control unit, control method performed by the same, and integrated circuit
US20130159664A1 (en) Infrastructure Support for Accelerated Processing Device Memory Paging Without Operating System Integration
US20110078412A1 (en) Processor Core Stacking for Efficient Collaboration
CN101387952A (en) Single-chip multi-processor task scheduling and managing method
US20110113426A1 (en) Apparatuses for switching the running of a virtual machine between multiple computer devices belonging to the same computer platform and the associated switching methods
US20110107007A1 (en) Asynchronous page faults for virtual machines
US20120147021A1 (en) Graphics compute process scheduling
JP2010538371A (en) Dynamic core switching
US20090216958A1 (en) Hardware accelerator interface
US20120239904A1 (en) Seamless interface for multi-threaded core accelerators

Legal Events

Date Code Title Description
PB01
SE01