CN105302737A - Memory allocation management method and memory allocation management system - Google Patents
Memory allocation management method and memory allocation management system Download PDFInfo
- Publication number
- CN105302737A CN105302737A CN201510824722.3A CN201510824722A CN105302737A CN 105302737 A CN105302737 A CN 105302737A CN 201510824722 A CN201510824722 A CN 201510824722A CN 105302737 A CN105302737 A CN 105302737A
- Authority
- CN
- China
- Prior art keywords
- memory
- node
- chained list
- memory block
- size
- 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
Landscapes
- Memory System (AREA)
Abstract
The invention discloses a memory allocation management method and a memory allocation management system. The method comprises the following steps: receiving the memory allocation request carried with memory size from an application program; seeking a memory block chain table with node memory size adaptive to needed memory size in a memory block chain table set aiming at the application program; in the sought memory block chain table, when the residual memory size of the node memory relative to the needed memory size is not lower than the preset lower limiting value of the node memory, allocating the memory equal to the needed memory in the node memory of one memory block to the application program, and classifying the residual memory into the target memory block chain table. According to the invention, the residual memory is classified into the target memory block chain table in which the node memory size is equal to the residual memory size, so that the memory fragments generated in the memory allocation process can be reasonably managed, and the memory utilization rate can be effectively increased.
Description
Technical field
The present invention relates to calculator memory administrative skill field, particularly relate to a kind of Memory Allocation management method and system.
Background technology
As everyone knows, in the operational process of application program, usually need to be its storage allocation when it needs internal memory, particularly, Memory Allocation refers in the process performed in program the method for the storage allocation distributing or reclaim storage space.Common memory allocation method has static memory to distribute and dynamic memory distribution two kinds.So-called dynamic memory distribution (DynamicMemoryAllocation) just refers in the process performed in program the method for the storage allocation dynamically distributing or reclaim storage space.Dynamic memory distribution needs to allocate in advance storage space unlike the static memory distribution methods such as array, but is immediately distributed by the needs of system according to program, and the size of distributing is exactly the size that program requires.
But, in actual applications, for above-mentioned two kinds of memory allocate ways, when Memory Allocation management system will be applied for frequently and releasing memory in application program operational process, prior art is distributed by system call and is easily occurred memory fragmentation with the mode of releasing memory, and then causes memory usage low, if long-time running can cause system unstable, and working time is longer, system more easily goes wrong, even can be more and more slower.
Summary of the invention
In view of this, the invention provides a kind of Memory Allocation management method and system, with the memory fragmentation produced in reasonable management Memory Allocation process, and then improve memory usage.
For solving the problems of the technologies described above, the invention provides a kind of Memory Allocation management method, comprising:
Receive the Memory Allocation request of carrying required memory size from application program;
Concentrate at the memory block chained list for described application program, search the memory block chained list that node memory size and described required memory size adapt;
Wherein, the node memory size adapted with described required memory size is greater than described required memory size and minimum with described required memory magnitude difference; Described memory block chained list collection comprises at least one memory block chained list, and described memory block chained list comprises at least one memory block node and the node memory equal and opposite in direction of each memory block node at least one memory block node described;
In the memory block chained list found, when the size that its node memory compares the free memory of required memory is not less than default node memory lower limit, give described application program by the internal memory of a wherein memory block node with the equal-sized Memory Allocation of described required memory, and described free memory is included into object memory block chained list;
Wherein, the described node memory size of object memory block chained list and the equal and opposite in direction of described free memory.
In said method, preferably, give described application program by the internal memory of a wherein memory block node with the equal-sized Memory Allocation of described required memory described, and after described free memory is included into object memory block chained list, also comprise:
When the releasing memory of described application program being detected, described releasing memory is included into the memory block chained list that node memory size is equal with it.
In said method, preferably, described search the memory block chained list that node memory size and described required memory size adapt after, also comprise:
In the described memory block chained list found, when the size that its node memory compares the free memory of described required memory is lower than described node memory lower limit, the internal memory of a wherein memory block node is all distributed to described application program.
In said method, preferably, in described memory block chained list, each memory block node linearly sorts by its memory address, and memory address between each described memory block node is discrete;
After described free memory being included into described object memory block chained list, when the memory address consecutive hours of certain memory block node in the memory address and described object memory block chained list of described free memory, also comprise:
Merge described free memory and with its memory address continuous print memory block node;
The node memory size memory block chained list that memory size is equal is with it included into by merging the memory block node obtained.
In said method, preferably, described in search the memory block chained list that node memory size and described required memory size adapt, comprising:
In gauge outfit chained list, search the memory block chained list that described node memory size and described required memory size adapt and identify; Wherein, described gauge outfit chained list comprises described memory block chained list mark and identifies the node memory size of corresponding memory block chained list with described memory block chained list;
By the memory block chained list mark found, determine the memory block chained list that described node memory size and described required memory size adapt.
Present invention also offers a kind of Memory Allocation management system, comprising:
Receiving element, for receiving the Memory Allocation request of carrying required memory size from application program;
Searching unit, for concentrating at the memory block chained list for described application program, searching the memory block chained list that node memory size and described required memory size adapt;
Wherein, the node memory size adapted with described required memory size is greater than described required memory size and minimum with described required memory magnitude difference; Described memory block chained list collection comprises at least one memory block chained list, and described memory block chained list comprises at least one memory block node and the node memory equal and opposite in direction of each memory block node at least one memory block node described;
Allocation units, for in the memory block chained list found, when the size that its node memory compares the free memory of required memory is not less than default node memory lower limit, give described application program by the internal memory of a wherein memory block node with the equal-sized Memory Allocation of described required memory, and described free memory is included into object memory block chained list;
Wherein, the described node memory size of object memory block chained list and the equal and opposite in direction of described free memory.
In said system, preferably, also comprise:
Be included into unit, for giving described application program by the internal memory of a wherein memory block node with the equal-sized Memory Allocation of described required memory described, and after described free memory is included into object memory block chained list, when the releasing memory of described application program being detected, described releasing memory is included into the memory block chained list that node memory size is equal with it.
In said system, preferably, described allocation units also for:
Described search the memory block chained list that node memory size and described required memory size adapt after, in the described memory block chained list found, when the size that its node memory compares the free memory of described required memory is lower than described node memory lower limit, the internal memory of a wherein memory block node is all distributed to described application program.
In said system, preferably, in described memory block chained list, each memory block node linearly sorts by its memory address, and memory address between each described memory block node is discrete;
This system also comprises:
Merge cells, for after described free memory being included into described object memory block chained list, when the memory address consecutive hours of certain memory block node in the memory address and described object memory block chained list of described free memory, merge described free memory and with its memory address continuous print memory block node;
And described in be included into unit also for being included into the node memory size memory block chained list that memory size is equal with it by merging the memory block node that obtains.
In said system, preferably, search unit described in comprise:
Search subelement, in gauge outfit chained list, search the memory block chained list that described node memory size and described required memory size adapt and identify; Wherein, described gauge outfit chained list comprises described memory block chained list mark and identifies the node memory size of corresponding memory block chained list with described memory block chained list;
Determine subelement, for the memory block chained list mark that will find, determine the memory block chained list that described node memory size and described required memory size adapt.
Above in a kind of Memory Allocation management method provided by the invention and system, when application program initially applies for internal memory, the size enough large for its distribution piece is N internal memory and utilizes this block internal memory to set up a memory block chained list, rear extended meeting is due to the frequent application releasing memory of application program, form the chained list that a lot of size is less than the memory block composition of N, all chained lists form memory block chained list collection above, this memory block chained list collection comprises at least one memory block chained list, and each memory block chained list comprises at least one memory block node and the node memory equal and opposite in direction of each memory block node.Based on this, when receiving the Memory Allocation request of above-mentioned application program, first, concentrating at the memory block chained list for this application program, searching the memory block chained list that node memory size and required memory size adapt; The present invention is greater than required memory size and the situation minimum with required memory magnitude difference (can produce the situation of memory fragmentation) mainly for the node memory size adapted with required memory size.Secondly, by the internal memory of a memory block node in the memory block chained list that finds with the equal-sized Memory Allocation of required memory to application program, and free memory is included into the equal and opposite in direction object memory block chained list of node memory size and free memory.As can be seen here, the memory fragmentation that the present invention produces in Memory Allocation process by achieving reasonable management in the equal and opposite in direction object memory block chained list that free memory is included into node memory size and free memory, effectively improves memory usage.
Simultaneously, when the size comparing the free memory of required memory when the node memory of the memory block chained list found is not less than default node memory lower limit in the present invention, by the internal memory of a memory block node in the memory block chained list that finds with the equal-sized Memory Allocation of described required memory to described application program.By the node memory lower limit of reasonable definition memory block chained list, free memory can be avoided to be included into operation frequently, further reasonable management memory fragmentation, and then improve memory usage.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to the accompanying drawing provided.
The process flow diagram of a kind of Memory Allocation management method that Fig. 1 provides for the embodiment of the present invention;
A kind of practical application overview flow chart based on Fig. 1 that Fig. 2 provides for the embodiment of the present invention;
A kind of Memory Allocation management structure figure that Fig. 3 provides for the embodiment of the present invention;
The structured flowchart schematic diagram of a kind of Memory Allocation management system that Fig. 4 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Core of the present invention is to provide a kind of Memory Allocation management method and system, with the memory fragmentation produced in reasonable management Memory Allocation process, and then improves memory usage.
In order to make those skilled in the art person understand the present invention program better, below in conjunction with the drawings and specific embodiments, the present invention is described in further detail.
Show the process flow diagram of a kind of Memory Allocation management method that the embodiment of the present invention provides with reference to figure 1, Fig. 1, the method specifically can comprise the steps:
Step S100, receive the Memory Allocation request of carrying required memory size from application program.
When application program initially applies for internal memory, according to the actual requirements, first for it distributes one piece of enough large internal memory, this memory block size is N (the integer powers of 2), then this block internal memory is utilized to set up a memory block chained list, rear extended meeting is due to the frequent application releasing memory of application program, form the chained list that a lot of size is less than the memory block composition of N, all chained lists form memory block chained list collection above, be understandable that this memory block chained list collection comprises at least one memory block chained list, and in the present invention, each memory block chained list comprises at least one memory block node and the node memory equal and opposite in direction of each memory block node.
In actual applications, if the failure when original allocation internal memory, then corresponding information is fed back to application program.To reallocate when this memory block is used up time one piece of onesize memory block, and by the mode of chained list, newly assigned memory block is coupled together.When detecting that application program exits, the memory block that unified release is applied for.
For each memory block chained list, wherein each memory block node linearly sorts by its memory address, and memory address between each memory block node is discrete.When the memory address consecutive hours of adjacent two nodes, both are merged, and is included in the memory block chained list of corresponding size.In the present invention, the size of memory block chained list represents the memory size that wherein memory block node is corresponding.
Step S101, to concentrate at the memory block chained list for application program, search the memory block chained list that node memory size and required memory size adapt.
Be understandable that, when the node memory size adapted with required memory size equals required memory size, directly by the Memory Allocation of first node in the memory block chained list that finds to application program; In fact, the present invention mainly for be the situation that can produce memory fragmentation, namely the node memory size adapted with required memory size is greater than required memory size, and to be greater than in the node memory size of this required memory size the minimum situation of itself and required memory magnitude difference all.In addition, if the integral multiple that required memory size is less than 2, then storage allocation is carried out by the integral multiple of immediate with it 2.
The time is searched in order to reduce when traveling through and finding suitable memory block chained list, and then raising search efficiency, the present invention is incorporated herein gauge outfit chained list, particularly, concentrated by memory block chained list the gauge outfit of all chained lists to get up to obtain gauge outfit chained list by the link of memory size order, this gauge outfit chained list comprises memory block chained list mark and identifies the node memory size of corresponding memory block chained list with memory block chained list.Based on this, above-mentioned detailed process of searching the memory block chained list that node memory size and required memory size adapt is as follows:
First, in gauge outfit chained list, search the memory block chained list that node memory size and required memory size adapt and identify; Secondly, by the memory block chained list mark found, the memory block chained list that node memory size and required memory size adapt is determined.
Step S102, in the memory block chained list found, judge that whether its node memory compares the size of the free memory of required memory lower than default node memory lower limit, if so, then enter step S103, otherwise, enter step S104.
Step S103, the internal memory of a memory block node in the memory block chained list found all is distributed to application program.
Particularly, respective nodes in memory block chained list need be returned to user when distributing to user memory, internal storage management system just need not be concerned about the memory block distributed, and when detecting that application program requires releasing memory, this memory block chained list node of direct control is just passable.
Step S104, by the internal memory of a memory block node in the memory block chained list that finds with the equal-sized Memory Allocation of required memory to application program, and free memory is included into object memory block chained list.
Wherein, the node memory size of object memory block chained list and the equal and opposite in direction of free memory.
In actual applications, if do not find corresponding memory block chained list, then create new memory block chained list and free memory is added, then this memory block chained list being inserted into gauge outfit chained list by size.After free memory being included into object memory block chained list, when the memory address consecutive hours of certain memory block node in the memory address and object memory block chained list of free memory, discrete for ensureing the memory address of each memory block node in each memory block chained list (corresponding memory block), also need to merge free memory and with its memory address continuous print memory block node (corresponding memory block); Then the node memory size memory block chained list that memory size is equal is with it included into by merging the memory block node obtained.
With being included into of free memory, if do not find corresponding memory block chained list, then creating new memory block chained list and by this memory block node city, then this memory block chained list be inserted into gauge outfit chained list by size.In fact, as long as there is new memory block node to add in corresponding memory block chained list, if there is memory address continuous print situation, all need to perform above-mentioned node union operation; Be understandable that according to foregoing, new memory block node here for free memory or can previously merge the memory block node obtained.In actual applications, when needs time, above-mentioned merging process is iteration, until the memory address of each memory block node is discrete in memory block chained list.Be understandable that, above-mentioned mention memory block chained list is sorted according to linear address, be conducive to being lifted at efficiency time memory block node merges.
No matter be step S103, or step S104, first, in order to ensure the order of memory block list, in the above-mentioned memory block chained list found a memory block node preferably headed by node; Secondly, by Memory Allocation to application program after, memory fragmentation can be produced equally due to during application program releasing memory, now, in order to further reasonable management memory fragmentation, also needing releasing memory to be included into corresponding memory block chained list, particularly: when the releasing memory of application program being detected, releasing memory being included into the memory block chained list that node memory size is equal with it; Finally, by Memory Allocation to application program after, deleted from the memory block chained list belonging to it by the memory block node of participating in the distribution (i.e. first node), subsequent node is supplemented up.If this memory block chained list is empty after deleting, then the gauge outfit of this memory block chained list is deleted from gauge outfit chained list.
For technique scheme overall implementation procedure in actual applications, can a kind of practical application overview flow chart based on Fig. 1 shown in reference diagram 2.Wherein, that this process flow diagram is conducive to is clear, put technique scheme of the present invention overall implementation procedure in actual applications in order briefly, exactly because also like this, in figure text description content relatively brief, summarize, can consult relevant position in the text for particular content.
To sum up, the present invention is based on memory block chained list, by free memory being included into object memory block chained list and releasing memory being included into memory block chained list, achieve the reasonable management to the memory fragmentation produced in Memory Allocation process, and then effectively improve memory usage, and then effectively prevent following problem of the prior art: if long-time running can cause system unstable, and working time is longer, system more easily goes wrong, even can be more and more slower.
Simultaneously, those skilled in the art can define the node memory lower limit of memory block chained list according to actual conditions, the corresponding minimum memory block of node memory lower limit, if this is because the too little free memory block that will cause of minimum memory block inserts and union operation frequently, if minimum memory block is too large, will too has more than needed because of the internal memory distributing to user and cause memory usage to reduce.Be understandable that, by reasonable definition node memory lower limit, free memory can be avoided to be included into operation frequently, further reasonable management memory fragmentation, and then improve memory usage.
Based on the technical scheme disclosed in the invention described above embodiment, in the present embodiment, based on practical application, technique scheme can be realized with reference to following programming code:
(1) data structure of the large memory block of memory block chained list, gauge outfit chained list and original allocation is as follows:
1. memory block chained list:
2. gauge outfit chained list:
3. the large memory block of original allocation:
(2) based on the data result in (1) point, be the memory block of N in allocated size, and initialisation structures body Mempool, setup code is as follows:
Mempool*mempool;
Headlist*headlist;
Memlist*memlist;
Void*memptr=(void*)malloc(N);
If(memptr==NULL)
Return0;
// initialization memlist (memory block chained list)
Memlist->memptr=*memptr;
Memlist->next=NULL;
// initialization headlist (gauge outfit chained list)
Headlist->size=N;
Headlist->num=1;
Headlist->list=memlist;
Headlist->next=NULL;
// initialization mempool (allocated size is the memory block of N)
Mempool->size=N;
Mempool->memptr=memptr;
Mempool->next=NULL;
Mempool->list=headlist;
(3) search suitable gauge outfit chained list, find the memory block chained list being greater than or equal to the memory block that will apply for, code is as follows:
(4) merge address continuous print memory block, code is as follows:
(5) internal memory of release application
Based on above-mentioned functions code, give an example in conjunction with practical application scene:
With reference to a kind of Memory Allocation management structure figure shown in figure 3, particularly, when application program initially applies for internal memory, according to the actual requirements, first for it distributes the memory block of one piece of 10M, when this 10M memory block is used up, reallocate one piece and be similarly the memory block of 10M, the memory block of these two 10M couples together with chain sheet form.
In the use procedure of the memory block of first piece of 10M, due to the frequent application releasing memory of application program, form the chained list that a lot of size is less than the memory block composition of 10M, such as 2K, 8K and 64K etc., the memory block node that memory size is equal forms corresponding memory block chained list, the memory block node being such as all 2K forms the memory block chained list that node memory size is 2K, and the gauge outfit of the memory block chained list of different node memory size forms gauge outfit chained list, the node memory size by memory block chained list in gauge outfit chained list sorts from small to large.
It should be noted that, above-mentioned specific code and concrete numerical value be all understand technical scheme provided by the present invention for the ease of those skilled in the art and for example, those skilled in the art can adjust according to actual conditions, and the present invention is not strictly confined to this.
Based on the Memory Allocation management method that the invention described above embodiment provides, the embodiment of the present invention additionally provides a kind of Memory Allocation management system, and with reference to figure 4, this system 400 can comprise following content:
Receiving element 401, for receiving the Memory Allocation request of carrying required memory size from application program;
Searching unit 402, for concentrating at the memory block chained list for application program, searching the memory block chained list that node memory size and required memory size adapt;
Wherein, the node memory size adapted with required memory size is greater than required memory size and minimum with required memory magnitude difference; Memory block chained list collection comprises at least one memory block chained list, and memory block chained list comprises at least one memory block node and the node memory equal and opposite in direction of each memory block node at least one memory block node;
Allocation units 403, for in the memory block chained list found, when the size that its node memory compares the free memory of required memory is not less than default node memory lower limit, by in the internal memory of a wherein memory block node with the equal-sized Memory Allocation of required memory to application program, and free memory is included into object memory block chained list;
Wherein, the node memory size of object memory block chained list and the equal and opposite in direction of free memory.
In the present invention, said system 400 can also comprise and is included into unit, for by the internal memory of a wherein memory block node with the equal-sized Memory Allocation of required memory to application program, and after free memory being included into object memory block chained list, when the releasing memory of application program being detected, releasing memory is included into the memory block chained list that node memory size is equal with it.
In the present invention, above-mentioned allocation units 403 can also be used for: after searching the memory block chained list that node memory size and required memory size adapt, in the memory block chained list found, when the size that its node memory compares the free memory of required memory is lower than node memory lower limit, the internal memory of a wherein memory block node is all distributed to application program.
In the present invention, in above-mentioned memory block chained list, each memory block node linearly sorts by its memory address, and memory address between each memory block node is discrete;
This system 400 can also comprise merge cells, for after free memory being included into object memory block chained list, when the memory address consecutive hours of certain memory block node in the memory address and object memory block chained list of free memory, merge free memory and with its memory address continuous print memory block node;
And be included into unit also for being included into the node memory size memory block chained list that memory size is equal with it by merging the memory block node obtained.
In the present invention, above-mentioned unit of searching can comprise following content:
Search subelement, in gauge outfit chained list, search the memory block chained list that node memory size and required memory size adapt and identify; Wherein, gauge outfit chained list comprises memory block chained list mark and identifies the node memory size of corresponding memory block chained list with memory block chained list;
Determine subelement, for the memory block chained list mark that will find, determine the memory block chained list that node memory size and required memory size adapt.
It should be noted that, each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiment, between each embodiment identical similar part mutually see.For system class embodiment, due to itself and embodiment of the method basic simlarity, so describe fairly simple, relevant part illustrates see the part of embodiment of the method.
Above a kind of Memory Allocation management method provided by the present invention and system are described in detail.Apply specific case herein to set forth principle of the present invention and embodiment, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping.It should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention, can also carry out some improvement and modification to the present invention, these improve and modify and also fall in the protection domain of the claims in the present invention.
Claims (10)
1. a Memory Allocation management method, is characterized in that, comprising:
Receive the Memory Allocation request of carrying required memory size from application program;
Concentrate at the memory block chained list for described application program, search the memory block chained list that node memory size and described required memory size adapt;
Wherein, the node memory size adapted with described required memory size is greater than described required memory size and minimum with described required memory magnitude difference; Described memory block chained list collection comprises at least one memory block chained list, and described memory block chained list comprises at least one memory block node and the node memory equal and opposite in direction of each memory block node at least one memory block node described;
In the memory block chained list found, when the size that its node memory compares the free memory of required memory is not less than default node memory lower limit, give described application program by the internal memory of a wherein memory block node with the equal-sized Memory Allocation of described required memory, and described free memory is included into object memory block chained list;
Wherein, the described node memory size of object memory block chained list and the equal and opposite in direction of described free memory.
2. the method for claim 1, it is characterized in that, give described application program by the internal memory of a wherein memory block node with the equal-sized Memory Allocation of described required memory described, and after described free memory is included into object memory block chained list, also comprise:
When the releasing memory of described application program being detected, described releasing memory is included into the memory block chained list that node memory size is equal with it.
3. the method for claim 1, is characterized in that, described search the memory block chained list that node memory size and described required memory size adapt after, also comprise:
In the described memory block chained list found, when the size that its node memory compares the free memory of described required memory is lower than described node memory lower limit, the internal memory of a wherein memory block node is all distributed to described application program.
4. method as described in claims 1 to 3 any one, is characterized in that, in described memory block chained list, each memory block node linearly sorts by its memory address, and memory address between each described memory block node is discrete;
After described free memory being included into described object memory block chained list, when the memory address consecutive hours of certain memory block node in the memory address and described object memory block chained list of described free memory, also comprise:
Merge described free memory and with its memory address continuous print memory block node;
The node memory size memory block chained list that memory size is equal is with it included into by merging the memory block node obtained.
5. method as claimed in claim 4, is characterized in that, described in search the memory block chained list that node memory size and described required memory size adapt, comprising:
In gauge outfit chained list, search the memory block chained list that described node memory size and described required memory size adapt and identify; Wherein, described gauge outfit chained list comprises described memory block chained list mark and identifies the node memory size of corresponding memory block chained list with described memory block chained list;
By the memory block chained list mark found, determine the memory block chained list that described node memory size and described required memory size adapt.
6. a Memory Allocation management system, is characterized in that, comprising:
Receiving element, for receiving the Memory Allocation request of carrying required memory size from application program;
Searching unit, for concentrating at the memory block chained list for described application program, searching the memory block chained list that node memory size and described required memory size adapt;
Wherein, the node memory size adapted with described required memory size is greater than described required memory size and minimum with described required memory magnitude difference; Described memory block chained list collection comprises at least one memory block chained list, and described memory block chained list comprises at least one memory block node and the node memory equal and opposite in direction of each memory block node at least one memory block node described;
Allocation units, for in the memory block chained list found, when the size that its node memory compares the free memory of required memory is not less than default node memory lower limit, give described application program by the internal memory of a wherein memory block node with the equal-sized Memory Allocation of described required memory, and described free memory is included into object memory block chained list;
Wherein, the described node memory size of object memory block chained list and the equal and opposite in direction of described free memory.
7. system as claimed in claim 6, is characterized in that, also comprise:
Be included into unit, for giving described application program by the internal memory of a wherein memory block node with the equal-sized Memory Allocation of described required memory described, and after described free memory is included into object memory block chained list, when the releasing memory of described application program being detected, described releasing memory is included into the memory block chained list that node memory size is equal with it.
8. system as claimed in claim 6, is characterized in that, described allocation units also for:
Described search the memory block chained list that node memory size and described required memory size adapt after, in the described memory block chained list found, when the size that its node memory compares the free memory of described required memory is lower than described node memory lower limit, the internal memory of a wherein memory block node is all distributed to described application program.
9. system as described in claim 6 to 8 any one, is characterized in that, in described memory block chained list, each memory block node linearly sorts by its memory address, and memory address between each described memory block node is discrete;
This system also comprises:
Merge cells, for after described free memory being included into described object memory block chained list, when the memory address consecutive hours of certain memory block node in the memory address and described object memory block chained list of described free memory, merge described free memory and with its memory address continuous print memory block node;
And described in be included into unit also for being included into the node memory size memory block chained list that memory size is equal with it by merging the memory block node that obtains.
10. system as claimed in claim 9, is characterized in that, described in search unit and comprise:
Search subelement, in gauge outfit chained list, search the memory block chained list that described node memory size and described required memory size adapt and identify; Wherein, described gauge outfit chained list comprises described memory block chained list mark and identifies the node memory size of corresponding memory block chained list with described memory block chained list;
Determine subelement, for the memory block chained list mark that will find, determine the memory block chained list that described node memory size and described required memory size adapt.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510824722.3A CN105302737A (en) | 2015-11-24 | 2015-11-24 | Memory allocation management method and memory allocation management system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510824722.3A CN105302737A (en) | 2015-11-24 | 2015-11-24 | Memory allocation management method and memory allocation management system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105302737A true CN105302737A (en) | 2016-02-03 |
Family
ID=55200025
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510824722.3A Pending CN105302737A (en) | 2015-11-24 | 2015-11-24 | Memory allocation management method and memory allocation management system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105302737A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106294198A (en) * | 2016-08-05 | 2017-01-04 | 浪潮(北京)电子信息产业有限公司 | The memory allocation method of a kind of (SuSE) Linux OS and method for releasing |
CN106844046A (en) * | 2016-12-31 | 2017-06-13 | 昊宏广泰(北京)科技有限公司 | Bandwidth carrier memory management algorithm |
CN108038062A (en) * | 2017-11-27 | 2018-05-15 | 北京锦鸿希电信息技术股份有限公司 | The EMS memory management process and device of embedded system |
CN108874532A (en) * | 2017-06-01 | 2018-11-23 | 北京旷视科技有限公司 | Memory allocation method and equipment |
CN108920276A (en) * | 2018-06-27 | 2018-11-30 | 郑州云海信息技术有限公司 | Linux system memory allocation method, system and equipment and storage medium |
CN109144890A (en) * | 2018-07-02 | 2019-01-04 | 珠海格力电器股份有限公司 | Data storage method and device |
CN110955496A (en) * | 2019-11-26 | 2020-04-03 | 浙江大华技术股份有限公司 | Memory processing method and device, storage medium and electronic device |
CN112269665A (en) * | 2020-12-22 | 2021-01-26 | 北京金山云网络技术有限公司 | Memory processing method and device, electronic equipment and storage medium |
CN114096953A (en) * | 2019-10-17 | 2022-02-25 | 深圳市欢太科技有限公司 | Memory management method and device, electronic equipment and computer readable medium |
CN116360788A (en) * | 2023-02-17 | 2023-06-30 | 深圳市亿维自动化技术有限公司 | Compiling method, compiler and electronic device for structured text programming language |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1031927A2 (en) * | 1999-02-04 | 2000-08-30 | Sun Microsystems Inc. | Protocol for coordinating the distribution of shared memory. |
CN1963788A (en) * | 2005-11-08 | 2007-05-16 | 中兴通讯股份有限公司 | A managing method for EMS memory |
CN101221536A (en) * | 2008-01-25 | 2008-07-16 | 中兴通讯股份有限公司 | Internal memory managing method and device of embedded system |
CN101382916A (en) * | 2007-09-06 | 2009-03-11 | 大唐移动通信设备有限公司 | Method for managing embedded system memory |
CN102063385A (en) * | 2010-12-23 | 2011-05-18 | 深圳市金宏威实业发展有限公司 | Memory management method and system |
CN102446139A (en) * | 2011-11-14 | 2012-05-09 | 奇智软件(北京)有限公司 | Method and device for data storage |
CN102455974A (en) * | 2010-10-21 | 2012-05-16 | 上海宝信软件股份有限公司 | High-speed internal memory application and release management system with controllable internal memory consumption and high-speed internal memory application release management method |
CN103106147A (en) * | 2013-03-08 | 2013-05-15 | 中国科学院上海微系统与信息技术研究所 | Memory allocation method and system |
-
2015
- 2015-11-24 CN CN201510824722.3A patent/CN105302737A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1031927A2 (en) * | 1999-02-04 | 2000-08-30 | Sun Microsystems Inc. | Protocol for coordinating the distribution of shared memory. |
CN1963788A (en) * | 2005-11-08 | 2007-05-16 | 中兴通讯股份有限公司 | A managing method for EMS memory |
CN101382916A (en) * | 2007-09-06 | 2009-03-11 | 大唐移动通信设备有限公司 | Method for managing embedded system memory |
CN101221536A (en) * | 2008-01-25 | 2008-07-16 | 中兴通讯股份有限公司 | Internal memory managing method and device of embedded system |
CN102455974A (en) * | 2010-10-21 | 2012-05-16 | 上海宝信软件股份有限公司 | High-speed internal memory application and release management system with controllable internal memory consumption and high-speed internal memory application release management method |
CN102063385A (en) * | 2010-12-23 | 2011-05-18 | 深圳市金宏威实业发展有限公司 | Memory management method and system |
CN102446139A (en) * | 2011-11-14 | 2012-05-09 | 奇智软件(北京)有限公司 | Method and device for data storage |
CN103106147A (en) * | 2013-03-08 | 2013-05-15 | 中国科学院上海微系统与信息技术研究所 | Memory allocation method and system |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106294198B (en) * | 2016-08-05 | 2018-12-07 | 浪潮(北京)电子信息产业有限公司 | A kind of memory allocation method and method for releasing of (SuSE) Linux OS |
CN106294198A (en) * | 2016-08-05 | 2017-01-04 | 浪潮(北京)电子信息产业有限公司 | The memory allocation method of a kind of (SuSE) Linux OS and method for releasing |
CN106844046A (en) * | 2016-12-31 | 2017-06-13 | 昊宏广泰(北京)科技有限公司 | Bandwidth carrier memory management algorithm |
CN106844046B (en) * | 2016-12-31 | 2021-06-11 | 北京市腾河智慧能源科技有限公司 | Broadband carrier memory management method |
CN108874532B (en) * | 2017-06-01 | 2020-11-06 | 北京旷视科技有限公司 | Memory allocation method and device |
CN108874532A (en) * | 2017-06-01 | 2018-11-23 | 北京旷视科技有限公司 | Memory allocation method and equipment |
CN108038062A (en) * | 2017-11-27 | 2018-05-15 | 北京锦鸿希电信息技术股份有限公司 | The EMS memory management process and device of embedded system |
CN108920276A (en) * | 2018-06-27 | 2018-11-30 | 郑州云海信息技术有限公司 | Linux system memory allocation method, system and equipment and storage medium |
CN109144890A (en) * | 2018-07-02 | 2019-01-04 | 珠海格力电器股份有限公司 | Data storage method and device |
CN109144890B (en) * | 2018-07-02 | 2021-02-05 | 珠海格力电器股份有限公司 | Data storage method and device |
CN114096953A (en) * | 2019-10-17 | 2022-02-25 | 深圳市欢太科技有限公司 | Memory management method and device, electronic equipment and computer readable medium |
CN110955496A (en) * | 2019-11-26 | 2020-04-03 | 浙江大华技术股份有限公司 | Memory processing method and device, storage medium and electronic device |
CN112269665A (en) * | 2020-12-22 | 2021-01-26 | 北京金山云网络技术有限公司 | Memory processing method and device, electronic equipment and storage medium |
CN112269665B (en) * | 2020-12-22 | 2021-05-11 | 北京金山云网络技术有限公司 | Memory processing method and device, electronic equipment and storage medium |
CN116360788A (en) * | 2023-02-17 | 2023-06-30 | 深圳市亿维自动化技术有限公司 | Compiling method, compiler and electronic device for structured text programming language |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105302737A (en) | Memory allocation management method and memory allocation management system | |
CN100530140C (en) | Memory management method for application program | |
CN103034544B (en) | The management method of a kind of User space and kernel state shared drive and device | |
CN101470665B (en) | Method and system for internal memory management of application system without MMU platform | |
WO2017219848A1 (en) | Id processing method in distributed database, management system, and server | |
CN108038002A (en) | A kind of embedded software EMS memory management process | |
CN106294190A (en) | A kind of memory space management and device | |
US20050071597A1 (en) | Method and apparatus for executing dynamic memory management with object-oriented program | |
CN107844372B (en) | Memory allocation method and system | |
CN105183561A (en) | Resource distribution method and resource distribution system | |
CN105468542A (en) | Address distribution method and device | |
CN104731799A (en) | Memory database management device | |
CN105701019A (en) | Memory management method and memory management device | |
CN101984417A (en) | Memory management method and device | |
CN105138326A (en) | Method and system for achieving structured query language (sql) dynamic configuration based on ibatis | |
CN105718319A (en) | Memory pool layout analysis method and memory pool device | |
CN103106147B (en) | Memory allocation method and system | |
CN105094751A (en) | Memory management method used for parallel processing of streaming data | |
CN102479198B (en) | Data paging method, device and system | |
CN103455433A (en) | Memory management method and system | |
CN105681346A (en) | Method for realizing message analysis based on factory class | |
CN103778120A (en) | Global file identification generation method, generation device and corresponding distributed file system | |
CN103294799B (en) | A kind of data parallel batch imports the method and system of read-only inquiry system | |
CN100395712C (en) | Source management method for software system | |
CN104572498A (en) | Cache management method for message and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20160203 |