CN108897617A - The method, apparatus and terminal device of memory management - Google Patents
The method, apparatus and terminal device of memory management Download PDFInfo
- Publication number
- CN108897617A CN108897617A CN201810628682.9A CN201810628682A CN108897617A CN 108897617 A CN108897617 A CN 108897617A CN 201810628682 A CN201810628682 A CN 201810628682A CN 108897617 A CN108897617 A CN 108897617A
- Authority
- CN
- China
- Prior art keywords
- memory
- application program
- application
- request
- headroom
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation 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/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
The embodiment of the present application provides the method, apparatus and terminal device of a kind of memory management.This method includes:When detecting memory headroom application request, determine the application program said system for sending the request, it is then based on the application program said system for sending the request, it determines the corresponding memory headroom of the system, is then the application assigned memory from the corresponding memory headroom of the system determined.The embodiment of the present application, which realizes, avoids data from leaking to another system from a system, improves the safety of memory management.
Description
Technical field
This application involves memory management technology fields, specifically, the present invention relates to a kind of method, apparatus of memory management
And terminal device.
Background technique
Memory is one of the ost important components in computer, for temporarily storing central processing unit (CPU, Central
Processing Unit) in operational data, and data exchanged with external memories such as hard disks, since computer is all
Application program run in memory, whether memory stable also to determine that can computer steadily run, therefore how right
Memory is managed the problem important as one.
Internally depositing the method being managed in the prior art, to be that all application program of setting internally deposits into row shared, when
When a certain application program operation application occupies partial memory space, idle memory headroom is distributed into the application program, and
When the application program end of run, corresponding memory headroom is discharged.
However, when internally deposited by mode in the prior art be managed when, it is directly that idle memory in memory is empty
Between distribution to the application program, and distribute to the free space of the application program there may be last using the memory headroom
The data information of application program in other systems, therefore after free space is distributed to the application program, it may cause
By the leaking data in a certain system to another system, so as to cause system data leakage, and then cause internally to deposit into capable pipe
The safety of reason is lower.
Summary of the invention
The purpose of the application is intended at least can solve above-mentioned one of technological deficiency, especially internally deposits the peace being managed
The lower technological deficiency of full property.
In a first aspect, providing a kind of method of memory management, this method includes:
When detecting memory headroom application request, the application program said system for sending the request is determined;
Based on the application program said system for sending the request, the corresponding memory headroom of the system is determined;
It is the application assigned memory from the corresponding memory headroom of the system determined.
Second aspect provides a kind of device of memory management, which includes:
Determining module, for determining belonging to the application program for sending the request when detecting memory headroom application request
System;
The determining module is also used to determine the system pair based on the application program said system for sending the request
The memory headroom answered;
Distribution module, for being the application program from the corresponding memory headroom of the system that the determining module is determined
Storage allocation.
The third aspect provides a kind of terminal device, which includes:
One or more processors;
Memory;
One or more application program, wherein one or more of application programs are stored in the memory and quilt
It is configured to be executed by one or more of processors, one or more of programs are configured to:It executes according to first aspect
Shown in memory management method.
Fourth aspect provides a kind of computer readable storage medium, is stored thereon with computer program, which is located
Manage the method for realizing memory management shown in first aspect when device executes.
The embodiment of the present application provides method, apparatus, terminal device and the computer-readable storage of a kind of memory management
Medium, compared with being directly in the prior art application assigned memory from shared drive, when detecting in the embodiment of the present application
When memory headroom application is requested, the application program said system for sending the request is determined, be then based on the application for sending the request
Program said system determines the corresponding memory headroom of the system, and being from the corresponding memory headroom of the system determined should
Application assigned memory, i.e., the corresponding memory headroom of each system in the embodiment of the present application, in for application assigned
It is the application assigned memory from the corresponding memory headroom of application program said system, so as to keep away when depositing space
Exempt from the leaking data in a system to other systems, and then can be improved and internally deposit the safety being managed.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, institute in being described below to the embodiment of the present application
Attached drawing to be used is needed to be briefly described.
Fig. 1 is a kind of method flow schematic diagram of memory management provided by the embodiments of the present application;
Fig. 2 is a kind of apparatus structure schematic diagram of memory management provided by the embodiments of the present application;
Fig. 3 is the apparatus structure schematic diagram of another memory management provided by the embodiments of the present application;
Fig. 4 is a kind of structural schematic diagram of the terminal device of memory management provided by the embodiments of the present application.
Specific embodiment
Embodiments herein is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end
Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached
The embodiment of figure description is exemplary, and is only used for explaining the application, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singular " one " used herein, " one
It is a ", " described " and "the" may also comprise plural form.It is to be further understood that being arranged used in the description of the present application
Diction " comprising " refer to that there are the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition
Other one or more features, integer, step, operation, element, component and/or their group.It should be understood that when we claim member
Part is " connected " or when " coupled " to another element, it can be directly connected or coupled to other elements, or there may also be
Intermediary element.In addition, " connection " used herein or " coupling " may include being wirelessly connected or wirelessly coupling.It is used herein to arrange
Diction "and/or" includes one or more associated wholes for listing item or any cell and all combinations.
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party
Formula is described in further detail.
First to this application involves several nouns be introduced and explain:
Container technique is a kind of very useful kernel virtualization technology, can provide the virtualization of lightweight, so as to every
From process and resource.By container technique and by means of Namespace technology and cgroup technology along with some additional
System interval may be implemented on the same device from technology while provide the run time infrastructure of multiple systems, to support
A variety of different types of system applications.
Container technique is by using Namespace mechanism by the process between different vessels, network, message, file system
System, UTS and user isolation come.For the system in each container, they think it is that independent operating and one are special themselves
On cell phone platform.
Namespaces:Linux Namespaces mechanism provides a kind of resource isolation scheme, PID, interprocess communication
The system resources such as (Inter-Process Communication, IPC), Network are no longer of overall importance, but belong to certain
A specific namespace;Resource inside each namespace is transparent to other namespace.
Cgroup technology:Full name is control group, i.e., the behaviour control of one group process;For example, if limiting process/
It is 20% that the CPU of bin/sh, which is used, then can build a CPU to occupy the cgroup for being 20%, then general/bin/sh process is added
Into this cgroup.
How the technical solution of the application and the technical solution of the application are solved with specifically embodiment below above-mentioned
Technical problem is described in detail.These specific embodiments can be combined with each other below, for the same or similar concept
Or process may repeat no more in certain embodiments.Below in conjunction with attached drawing, embodiments herein is described.
Following embodiment provides a kind of method of memory management, is applied to multisystem terminal device, the multisystem terminal
Equipment includes at least two operating systems.Wherein, which can be container handling system, and container handling system is to pass through
Container technique carries out isolation of system.
Embodiment one
The embodiment of the present application provides a kind of method of memory management, as shown in Figure 1, this method includes:
Step S101, when detecting memory headroom application request, the application program said system for sending the request is determined.
The application program is determined when the operation of a certain application program needs committed memory space for the embodiment of the present application
Affiliated operating system.
For example, being equipped with application program 1 and application program 2 in operating system 1, it is equipped in operating system 2 using journey
Sequence 3, application program 4 and application program 5 determine the application program 1 when the operation of application program 1 needs committed memory space
Corresponding operating system is operating system 1.
Step S102, based on the application program said system for sending the request, the corresponding memory headroom of the system is determined.
For the embodiment of the present application, each operating system may correspond to different memory headrooms;Or each operating system
Shared drive determines each operating system currently corresponding memory headroom according to preset rules.
For example, preset rules can be to determine each operating system based on each piece of memory last time occupied operating system
Current corresponding memory headroom.
It step S103, is the application assigned memory from the corresponding memory headroom of the system determined.
For the embodiment of the present application, based on the application program said system pair for sending the request determined in step S102
In the memory headroom answered, the memory headroom of size is preset for the application assigned;Or based on determining in step S102
It sends in the corresponding memory headroom of application program said system of the request, and applies occupying according in memory headroom application request
The size of memory headroom is suitble to the memory headroom of size for the application assigned.
The embodiment of the present application provides a kind of method of memory management, and from shared drive is directly in the prior art application
Program storage allocation is compared, and in the embodiment of the present application when detecting memory headroom application request, is determined and is sent answering for the request
With program said system, it is then based on the application program said system for sending the request, determines the corresponding memory headroom of the system,
It and is the application assigned memory, i.e., each system in the embodiment of the present application from the corresponding memory headroom of the system determined
It unites and corresponds to a memory headroom, when for application assigned memory headroom, from the corresponding memory of application program said system
It is the application assigned memory in space, so as to avoid by the leaking data in a system to other systems, in turn
It can be improved and internally deposit the safety being managed.
Embodiment two
The alternatively possible implementation of the embodiment of the present invention further includes two institute of embodiment on the basis of example 1
The operation shown, wherein
Step S102 includes step S1021, and step S103 includes step S1031, wherein
Step S1021, based on the application program said system for sending the request, the affiliated memory pool of the system is determined.
Further include before step S1021:Corresponding memory pool is distributed for each system.
For the embodiment of the present application, by be arranged in terminal device memory pool according to operating system in terminal device
Number is split, so that the corresponding memory pool of each operating system in terminal device.
For example, currently operation has 2 operating systems, operating system 1 and operating system 2 in terminal device, then by terminal
An original memory pool is split as 2 in equipment, and memory pool 1 and memory pool 2, operating system 1 can correspond to memory pool 1,
Operating system 2 can correspond to memory pool 2.
For the embodiment of the present application, the size of the memory headroom of each memory pool after dynamic setting fractionation.In the application
In embodiment, the size of the memory headroom of each memory pool after fractionation can also be set by user setting by terminal device
It sets.In the embodiment of the present application without limitation.
For example, the memory headroom for the memory pool that original multisystem is shared can be 4G, then the memory pool is split as two
A memory pool, the size of the corresponding memory headroom of memory pool 1 can be 1G, and the size of the corresponding memory headroom of memory pool 2 can be with
For 3G.
For the embodiment of the present application, the memory headroom of specified size is distributed by malloc ().
It step S1031, is the application assigned memory from the affiliated memory pool of the system.
For example, the application program said system of application memory headroom is system 2, then it is the application program from memory pool 2
Storage allocation.
For the embodiment of the present application, by determining belonging to the system based on the application program said system for sending the request
Memory pool, and be the application assigned memory from the affiliated memory pool of the system, i.e., each corresponding memory of operating system
Pond, be application assigned memory when, distributed from the corresponding memory pool of the operating system, thus avoid by other systems it
Before account for used memory headroom and distribute to application program in the system, cause system data to leak to another by a system
System, and then can be further improved the safety of memory management.
Embodiment three
The alternatively possible implementation of the embodiment of the present invention further includes three institute of embodiment on the basis of example 2
The operation shown, wherein
Further include after step S1021:It is corresponding from other systems when memory headroom deficiency in the affiliated memory pool of the system
Memory pool in determine the memory headroom to be allocated to the application program;The memory headroom to be allocated to the application program is emptied,
And the memory headroom after emptying is distributed into the application program.
For the embodiment of the present application, when a certain application program calls memory, and the application program said system pair
It is the application assigned memory from the corresponding memory pool of other systems, but work as when the memory headroom deficiency for the memory pool answered
Before the memory headroom in the corresponding memory pool of the other systems distributes to the application program, it is to be allocated interior to need to empty this
The dirty data in space is deposited, the memory headroom for emptying dirty data is then distributed into the application program.
For example, when memory, and the corresponding memory pool 1 of operating system 1 belonging to the application program 1 are called in the application of application program 1
Low memory when, from memory pool 2 be 1 storage allocation of application program, before storage allocation, empty in memory pool 2 to
Dirty data into the memory headroom of application program 1 is distributed, the memory headroom after dirty data then will be emptied and distributes to the application
Program 1.
It, can be from other operations when the memory headroom deficiency of the corresponding memory pool of certain system for the embodiment of the present application
It is the application assigned memory in the corresponding memory pool of system, so that application program normal operation, avoids application program
The case where deferred run;Furthermore after memory headroom to be allocated is emptied dirty data, it is redistributed to the application program, it can
It avoids the leaking data in a system to another system, so as to avoid system data from leaking, and then can be into one
Improve the safety of memory management in step ground.
Example IV
The alternatively possible implementation of the embodiment of the present invention further includes on the basis of embodiment two or embodiment three
It is operated shown in example IV, wherein
This method further includes:When detecting that a certain application program is out of service, by the occupied memory of the application program
Space is released to the corresponding memory pool of application program said system.
For the embodiment of the present application, when detecting that a certain application program is out of service, i.e., the application program does not need to adjust
With memory headroom, then the memory headroom is released to the memory pool of the application program said system.In embodiments of the present invention, lead to
It crosses free () function and comes releasing memory space.
For the embodiment of the present application, when detecting that a certain application program is out of service, which can be occupied
Memory headroom be directly released in the corresponding memory pool of application program said system, without being emptied, then discharge,
To while avoiding data from being leaked to another system by a system, reduce the expense of Installed System Memory cleaning.
Embodiment five
The alternatively possible implementation of the embodiment of the present invention further includes five institute of embodiment on the basis of example 1
The operation shown, wherein
Step S102 includes that step S1022, step S103 include step S1023, wherein
Step S1022, based on each memory page marker in the application program said system and memory for sending the request
System banner determines at least one corresponding page of the system.
Wherein, the system banner marked on page is the last corresponding system banner of system for occupying the page.
In the embodiment of the present application, which can be container identification.
For the embodiment of the present application, page is divided into file page and calculates page.File page in memory is file cache
Area, the i.e. page of file type, for storing the page (also referred to as permanent page) of file data, the calculating page in memory is also referred to as
The page of calculation type is mainly used for the data storing program code and temporarily using.
For the embodiment of the present application, the minimum memory unit of page is a byte (1B), and minimum management unit is one
Page (4KB), virtual memory address consecutive hours physical memory addresses can be discontinuous, even if 6000 byte of primary distribution is (less than two
Page also distributes page two), two page physical address may not be close to.
For the embodiment of the present application, multiple systems can share a memory pool.In the embodiment of the present application, when in detection
Deposit application occupy request when, the last time marked from each page occupy is determined in the system banner of this page with send should
Memory application occupies the identical page of system banner of the application program said system of request, and the page is distributed to this and answered
Use program.
For the embodiment of the present application, the mapping relations between each page and each operating system are preset, therefore can be with
According to the mapping relations between preset each page and each operating system, for the application assigned for applying for committed memory
Page;Or the system identification information marked on page based on memory is the application assigned page for applying for committed memory.
Step S1023, corresponding for the application assigned from least one the corresponding page of the system determined
Page.
The embodiment of the present invention is answered by marking last time to occupy the system banner of the page on page for this
Corresponding page is distributed with program, i.e., is the application assigned from the last time application program said system committed memory page
Page.
For example, the application program said system for sending memory application request is system 1, from label by the page of system 1
In be the application assigned page.
For the embodiment of the present application, by based on each interior in the application program said system and memory for sending the request
The system banner for depositing page marker, determines at least one corresponding page of the system, and from the system determined it is corresponding to
In a few page, for the corresponding page of the application assigned, i.e., it is somebody's turn to do from the page that the system last time occupies
Application assigned page in system, so that the dirty data by systems other in memory is avoided to leak to other systems, into
And the safety of memory management can be further improved.
Embodiment six
The alternatively possible implementation of the embodiment of the present invention further includes embodiment on the basis of shown in the embodiment five
It is operated shown in six, wherein
This method further includes:When detecting a certain application program releasing memory, based on the application program said system
Page to be released is marked in system banner.
For the embodiment of the present application, when detecting that a certain application program is out of service, when releasing memory, determine this using journey
Sequence said system, and by the system banner for the application program said system determined label on the page of release.
For the embodiment of the present application, when detecting that application program 1 is out of service, when releasing memory, the application program is determined
Said system is system 1, and by the system banner of system 1 label on the page that application program 1 discharges.
For the embodiment of the present application, when detecting a certain application program releasing memory, based on system belonging to the application program
Page to be released is marked in the system banner of system, enables to according to the system banner marked on page be application
The application assigned page of committed memory leaks to another system by a system to avoid system data, so as to
To promote the safety of memory management.
Embodiment seven
The embodiment of the present application provides a kind of memory management device, as shown in Fig. 2, the memory management device 20 can wrap
It includes:Determining module 201, distribution module 202, wherein
Determining module 201, for determining the application program institute for sending the request when detecting memory headroom application request
Category system.
Determining module 201 is also used to determine that the system is corresponding interior based on the application program said system for sending the request
Deposit space.
Distribution module 202, for being that this applies journey from the corresponding memory headroom of the system that determining module 201 is determined
Sequence storage allocation.
The embodiment of the present application provides a kind of device of memory management, and from shared drive is directly in the prior art application
Program storage allocation is compared, and in the embodiment of the present application when detecting memory headroom application request, is determined and is sent answering for the request
With program said system, it is then based on the application program said system for sending the request, determines the corresponding memory headroom of the system,
It and is the application assigned memory, i.e., each system in the embodiment of the present application from the corresponding memory headroom of the system determined
It unites and corresponds to a memory headroom, when for application assigned memory headroom, from the corresponding memory of application program said system
It is the application assigned memory in space, so as to avoid by the leaking data in a system to other systems, in turn
It can be improved and internally deposit the safety being managed.
Embodiment eight
The embodiment of the present application provides a kind of memory management device, as shown in figure 3, the memory management device 30 can wrap
It includes:Determining module 301, distribution module 302, wherein
Further, it is determined that module 301, specifically for based on the application program said system for sending the request, determining should
The affiliated memory pool of system.
Wherein, the function of the determining module 201 in determining module 301 and Fig. 2 in Fig. 3 is same or similar.
Distribution module 302 is specifically used for being the application assigned memory from the affiliated memory pool of the system.
Wherein, the distribution module 302 in Fig. 3 is same or similar with the function of distribution module 202 in Fig. 2.
Distribution module 302 is also used to distribute corresponding memory pool for each system.
For the embodiment of the present application by determining in belonging to the system based on the application program said system for sending the request
It deposits pond, and is the application assigned memory from the affiliated memory pool of the system, i.e., each corresponding memory pool of operating system,
When for application assigned memory, distributed from the corresponding memory pool of the operating system, so that avoiding will be before other system
It accounts for used memory headroom and distributes to application program in the system, cause system data to leak to another by a system to be
System, and then can be further improved the safety of memory management.
Determining module 301 is also used to when memory headroom deficiency in the affiliated memory pool of the system, corresponding from other systems
The memory headroom to be allocated to the application program is determined in memory pool.
Further, as shown in figure 3, the device further includes:Empty module 303.
Module 303 is emptied, the memory headroom to be allocated to the application program determined for emptying determining module 301.
Distribution module 302 is also used to empty the memory headroom after module 303 empties and distributes to the application program.
It, can be from other operations when the memory headroom deficiency of the corresponding memory pool of certain system for the embodiment of the present application
It is the application assigned memory in the corresponding memory pool of system, so that application program normal operation, avoids application program
The case where deferred run;Furthermore after memory headroom to be allocated is emptied dirty data, it is redistributed to the application program, it can
It avoids the leaking data in a system to another system, so as to avoid system data from leaking, and then can be into one
Improve the safety of memory management in step ground.
Further, as shown in figure 3, the device further includes:Release module 304.
Release module 304, for when detecting that a certain application program is out of service, by the application program it is occupied in
It deposits space and is released to the corresponding memory pool of application program said system.
For the embodiment of the present application, when detecting that a certain application program is out of service, which can be occupied
Memory headroom be directly released in the corresponding memory pool of application program said system, without being emptied, then discharge,
To while avoiding data from being leaked to another system by a system, reduce the expense of Installed System Memory cleaning.
Determining module 301, specifically for based on each interior in the application program said system and memory for sending the request
The system banner for depositing page marker determines at least one corresponding page of the system.
Wherein, the system banner marked on page is the last corresponding system banner of system for occupying the page.
Distribution module 302, specifically for applying journey for this from least one the corresponding page of the system determined
Sequence distributes corresponding page.
For the embodiment of the present application, by based on each interior in the application program said system and memory for sending the request
The system banner for depositing page marker, determines at least one corresponding page of the system, and from the system determined it is corresponding to
In a few page, for the corresponding page of the application assigned, i.e., it is somebody's turn to do from the page that the system last time occupies
Application assigned page in system, so that the dirty data by systems other in memory is avoided to leak to other systems, into
And the safety of memory management can be further improved.
Further, as shown in figure 3, the device further includes:Mark module 305.
Mark module 305, for being based on the application program said system when detecting a certain application program releasing memory
System banner page to be released is marked.
For the embodiment of the present application, when detecting a certain application program releasing memory, based on system belonging to the application program
Page to be released is marked in the system banner of system, enables to according to the system banner marked on page be application
The application assigned page of committed memory leaks to another system by a system to avoid system data, so as to
To promote the safety of memory management.
The embodiment of the present application provides a kind of device of memory management, and from shared drive is directly in the prior art application
Program storage allocation is compared, and in the embodiment of the present application when detecting memory headroom application request, is determined and is sent answering for the request
With program said system, it is then based on the application program said system for sending the request, determines the corresponding memory headroom of the system,
It and is the application assigned memory, i.e., each system in the embodiment of the present application from the corresponding memory headroom of the system determined
It unites and corresponds to a memory headroom, when for application assigned memory headroom, from the corresponding memory of application program said system
It is the application assigned memory in space, so as to avoid by the leaking data in a system to other systems, in turn
It can be improved and internally deposit the safety being managed.
The embodiment of the present application provides a kind of device of memory management, and it is any to embodiment six to be suitable for above-described embodiment one
Method shown in embodiment, details are not described herein.
Embodiment nine
The embodiment of the present application provides a kind of terminal device, as shown in figure 4, terminal device shown in Fig. 4 4000 includes:Place
Manage device 4001 and memory 4003.Wherein, processor 4001 is connected with memory 4003, is such as connected by bus 4002.It is optional
Ground, terminal device 4000 can also include transceiver 4004.It should be noted that transceiver 4004 is not limited to one in practical application
A, the structure of the terminal device 4000 does not constitute the restriction to the embodiment of the present application.
Wherein, processor 4001 is applied in the embodiment of the present application, for realizing Fig. 2 or determining module shown in Fig. 3, divides
With module, empty module, release module, the function of mark module.Transceiver 4004 includes Receiver And Transmitter.
Processor 4001 can be CPU, general processor, DSP, ASIC, FPGA or other programmable logic device, crystalline substance
Body pipe logical device, hardware component or any combination thereof.It, which may be implemented or executes, combines described by present disclosure
Various illustrative logic blocks, module and circuit.Processor 4001 is also possible to realize the combination of computing function, such as wraps
It is combined containing one or more microprocessors, DSP and the combination of microprocessor etc..
Bus 4002 may include an access, and information is transmitted between said modules.Bus 4002 can be pci bus or
Eisa bus etc..Bus 4002 can be divided into address bus, data/address bus, control bus etc..Only to be used in Fig. 4 convenient for indicating
One thick line indicates, it is not intended that an only bus or a type of bus.
Memory 4003 can be ROM or can store the other kinds of static storage device of static information and instruction, RAM
Or the other kinds of dynamic memory of information and instruction can be stored, it is also possible to EEPROM, CD-ROM or other CDs
Storage, optical disc storage (including compression optical disc, laser disc, optical disc, Digital Versatile Disc, Blu-ray Disc etc.), magnetic disk storage medium
Or other magnetic storage apparatus or can be used in carry or store have instruction or data structure form desired program generation
Code and can by any other medium of computer access, but not limited to this.
Optionally, memory 4003 is used to store the application code for executing application scheme, and by processor 4001
It is executed to control.Processor 4001 is for executing the application code stored in memory 4003, to realize Fig. 2 or Fig. 3 institute
Show the movement for the memory management device that embodiment provides.
The embodiment of the present application provides a kind of terminal device, and from shared drive is directly in the prior art application program point
It is compared with memory, in the embodiment of the present application when detecting memory headroom application request, determines the application program for sending the request
Said system is then based on the application program said system for sending the request, determines the corresponding memory headroom of the system, and from true
It is the application assigned memory in the corresponding memory headroom of the system made, i.e., each system is corresponding in the embodiment of the present application
One memory headroom, when for application assigned memory headroom, from the corresponding memory headroom of application program said system
For the application assigned memory, so as to avoid the leaking data in a system to other systems, and then can mention
It is high internally to deposit the safety being managed.
The embodiment of the present application provides a kind of terminal device, any implementation into embodiment six suitable for above-described embodiment one
Method shown in example, details are not described herein.
The embodiment of the present application provides a kind of computer readable storage medium, is stored on the computer readable storage medium
Computer program realizes method shown in embodiment one to six any embodiment of embodiment when the program is executed by processor.
The embodiment of the present application provides a kind of computer readable storage medium, and is directly from shared drive in the prior art
Application assigned memory is compared, and in the embodiment of the present application when detecting memory headroom application request, is determined and is sent the request
Application program said system, be then based on send the request application program said system, determine the corresponding memory of the system
Space, and be the application assigned memory from the corresponding memory headroom of the system determined, i.e., in the embodiment of the present application
The corresponding memory headroom of each system, it is corresponding from the application program said system when for application assigned memory headroom
Memory headroom in be the application assigned memory, so as to avoid the leaking data in a system to other systems
System, and then can be improved and internally deposit the safety being managed.
It is any to embodiment six suitable for embodiment one that the embodiment of the present application provides a kind of computer readable storage medium
Method shown in embodiment.Details are not described herein.
It should be understood that although each step in the flow chart of attached drawing is successively shown according to the instruction of arrow,
These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps
Execution there is no stringent sequences to limit, can execute in the other order.Moreover, at least one in the flow chart of attached drawing
Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps
Completion is executed, but can be executed at different times, execution sequence, which is also not necessarily, successively to be carried out, but can be with other
At least part of the sub-step or stage of step or other steps executes in turn or alternately.
The above is only some embodiments of the invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (10)
1. a kind of method of memory management, which is characterized in that including:
When detecting memory headroom application request, the application program said system for sending the request is determined;
Based on the application program said system for sending the request, the corresponding memory headroom of the system is determined;
It is the application assigned memory from the corresponding memory headroom of the system determined.
2. the method according to claim 1, wherein based on being belonging to the application program for sending the request
System, determines the corresponding memory headroom of the system;It is the application assigned from the corresponding memory headroom of the system determined
Memory, including:
Based on the application program said system for sending the request, the affiliated memory pool of the system is determined;
It is the application assigned memory from the affiliated memory pool of the system.
3. according to the method described in claim 2, it is characterized in that, based on being belonging to the application program for sending the request
System, determines the affiliated memory pool of the system, further includes before:
Corresponding memory pool is distributed for each system;
It determines the affiliated memory pool of the system, further includes later:
When memory headroom deficiency in the affiliated memory pool of the system, determining to be allocated give should from the corresponding memory pool of other systems
The memory headroom of application program;
The memory headroom to be allocated to the application program is emptied, and the memory headroom after emptying is distributed to this using journey
Sequence.
4. according to the described in any item methods of Claims 2 or 3, which is characterized in that the method also includes:
When detecting that a certain application program is out of service, the occupied memory headroom of the application program is released to this using journey
The corresponding memory pool of sequence said system.
5. the method according to claim 1, wherein based on being belonging to the application program for sending the request
System, determines the corresponding memory headroom of the system;It is the application assigned from the corresponding memory headroom of the system determined
Memory, including:
Based on the system banner of each memory page marker in the application program said system and memory for sending the request, really
Fixed at least one corresponding page of the system;
From at least one the corresponding page of the system determined, for the corresponding page of the application assigned.
6. according to the method described in claim 5, it is characterized in that, the system banner marked on page is that last occupy should
The corresponding system banner of the system of page.
7. method according to claim 5 or 6, which is characterized in that the method also includes:
When detecting a certain application program releasing memory, the system banner based on the application program said system is to be released
Page is marked.
8. a kind of device of memory management, which is characterized in that including:
Determining module, for determining the application program said system for sending the request when detecting memory headroom application request;
The determining module is also used to determine that the system is corresponding based on the application program said system for sending the request
Memory headroom;
Distribution module, for being the application assigned from the corresponding memory headroom of the system that the determining module is determined
Memory.
9. a kind of terminal device, which is characterized in that including:
One or more processors;
Memory;
One or more application program, wherein one or more of application programs are stored in the memory and are configured
To be executed by one or more of processors, one or more of programs are configured to:It executes according to claim 1~7
The method of described in any item memory managements.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor
The method of the described in any item memory managements of claim 1-7 is realized when execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810628682.9A CN108897617A (en) | 2018-06-19 | 2018-06-19 | The method, apparatus and terminal device of memory management |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810628682.9A CN108897617A (en) | 2018-06-19 | 2018-06-19 | The method, apparatus and terminal device of memory management |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108897617A true CN108897617A (en) | 2018-11-27 |
Family
ID=64345061
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810628682.9A Pending CN108897617A (en) | 2018-06-19 | 2018-06-19 | The method, apparatus and terminal device of memory management |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108897617A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109977093A (en) * | 2019-04-04 | 2019-07-05 | 中科创达(重庆)汽车科技有限公司 | More virtual systems based on LXC check the method and device of container log |
WO2020156259A1 (en) * | 2019-01-28 | 2020-08-06 | Oppo广东移动通信有限公司 | Memory management method and device, mobile terminal, and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102236603A (en) * | 2010-04-29 | 2011-11-09 | 国际商业机器公司 | Garbage recycling method and system in virtual environment |
US8578369B2 (en) * | 2010-12-23 | 2013-11-05 | International Business Machines Corporation | Managing memory in multiple virtual machines |
CN103955362A (en) * | 2014-04-03 | 2014-07-30 | 广东工业大学 | Xen-based operating system kernel monitoring method |
CN104899077A (en) * | 2015-06-30 | 2015-09-09 | 北京奇虎科技有限公司 | Process information acquiring method and device based on container technology |
CN105183565A (en) * | 2015-09-30 | 2015-12-23 | 华为技术有限公司 | Computer and service quality control method and device |
CN107038128A (en) * | 2016-02-03 | 2017-08-11 | 华为技术有限公司 | A kind of virtualization of performing environment, the access method of virtual execution environment and device |
CN107463402A (en) * | 2017-07-31 | 2017-12-12 | 腾讯科技(深圳)有限公司 | The operation method and device of virtual opetrating system |
CN107766153A (en) * | 2017-10-17 | 2018-03-06 | 华为技术有限公司 | A kind of EMS memory management process and device |
-
2018
- 2018-06-19 CN CN201810628682.9A patent/CN108897617A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102236603A (en) * | 2010-04-29 | 2011-11-09 | 国际商业机器公司 | Garbage recycling method and system in virtual environment |
US8578369B2 (en) * | 2010-12-23 | 2013-11-05 | International Business Machines Corporation | Managing memory in multiple virtual machines |
CN103955362A (en) * | 2014-04-03 | 2014-07-30 | 广东工业大学 | Xen-based operating system kernel monitoring method |
CN104899077A (en) * | 2015-06-30 | 2015-09-09 | 北京奇虎科技有限公司 | Process information acquiring method and device based on container technology |
CN105183565A (en) * | 2015-09-30 | 2015-12-23 | 华为技术有限公司 | Computer and service quality control method and device |
US20180121242A1 (en) * | 2015-09-30 | 2018-05-03 | Huawei Technologies Co., Ltd. | Computer and Quality of Service Control Method and Apparatus |
CN107038128A (en) * | 2016-02-03 | 2017-08-11 | 华为技术有限公司 | A kind of virtualization of performing environment, the access method of virtual execution environment and device |
CN107463402A (en) * | 2017-07-31 | 2017-12-12 | 腾讯科技(深圳)有限公司 | The operation method and device of virtual opetrating system |
CN107766153A (en) * | 2017-10-17 | 2018-03-06 | 华为技术有限公司 | A kind of EMS memory management process and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020156259A1 (en) * | 2019-01-28 | 2020-08-06 | Oppo广东移动通信有限公司 | Memory management method and device, mobile terminal, and storage medium |
CN109977093A (en) * | 2019-04-04 | 2019-07-05 | 中科创达(重庆)汽车科技有限公司 | More virtual systems based on LXC check the method and device of container log |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7260663B2 (en) | System and method for presenting interrupts | |
US11775421B2 (en) | Charging users for computer memory usage | |
JP5489991B2 (en) | Memory allocation mechanism | |
CN104915151A (en) | Active sharing memory excessive allocation method in multi-virtual machine system | |
US20090100249A1 (en) | Method and apparatus for allocating architectural register resources among threads in a multi-threaded microprocessor core | |
US9086920B2 (en) | Device for managing data buffers in a memory space divided into a plurality of memory elements | |
WO2009098547A1 (en) | Memory management | |
EP2151752A1 (en) | Thread ordering techniques | |
CN109976907B (en) | Task allocation method and system, electronic device and computer readable medium | |
KR102064764B1 (en) | Communication of message signalled interrupts | |
CN101853238A (en) | Message communication method and system between communication processors | |
US9361224B2 (en) | Non-intrusive storage of garbage collector-specific management data | |
US8799611B2 (en) | Managing allocation of memory pages | |
US20210311891A1 (en) | Handling an input/output store instruction | |
CN108897617A (en) | The method, apparatus and terminal device of memory management | |
US7849272B2 (en) | Dynamic memory management in an RDMA context | |
CN109800092A (en) | A kind of processing method of shared data, device and server | |
US9697047B2 (en) | Cooperation of hoarding memory allocators in a multi-process system | |
US8868876B2 (en) | Dedicated large page memory pools | |
US10896062B2 (en) | Inter-process memory management | |
US7900010B2 (en) | System and method for memory allocation management | |
CN110162395A (en) | A kind of method and device of Memory Allocation | |
CN110365780A (en) | A kind of cloud computing architecture system for Internet of Things storage | |
CN108563507A (en) | A kind of EMS memory management process, device, equipment and readable storage medium storing program for executing | |
CN108139969B (en) | Memory configuration method, device and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181127 |
|
RJ01 | Rejection of invention patent application after publication |