CN101923511B - Memory management method and memory management system - Google Patents

Memory management method and memory management system Download PDF

Info

Publication number
CN101923511B
CN101923511B CN2009101473336A CN200910147333A CN101923511B CN 101923511 B CN101923511 B CN 101923511B CN 2009101473336 A CN2009101473336 A CN 2009101473336A CN 200910147333 A CN200910147333 A CN 200910147333A CN 101923511 B CN101923511 B CN 101923511B
Authority
CN
China
Prior art keywords
memory
region
memory block
length
page
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.)
Expired - Fee Related
Application number
CN2009101473336A
Other languages
Chinese (zh)
Other versions
CN101923511A (en
Inventor
钱俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN2009101473336A priority Critical patent/CN101923511B/en
Publication of CN101923511A publication Critical patent/CN101923511A/en
Application granted granted Critical
Publication of CN101923511B publication Critical patent/CN101923511B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a memory management method and a memory management system, relating to the technical filed of information. The method is as follows: dividing a memory into a first memory area and a second memory area; using a local compression algorithm to manage the first memory area; and when the first memory area is in an unstable state, using the data stored in a second memory block to fill a hole causing the first memory area to be unstable, wherein the second memory block is positioned in the second memory area. The system comprises a division module, a management module and a filling module. A filling mode is used to greatly reduce the movement quantity of the memory to enable the memory to recover to a stable state, further improving the memory management performance of the local compression algorithm under the condition of ensuring higher use ratio of the memory, thereby ensuring that the local compression algorithm can better consider both the memory use ratio and the memory management performance.

Description

A kind of EMS memory management process and internal storage management system
Technical field
The present invention relates to areas of information technology, particularly a kind of EMS memory management process and internal storage management system.
Background technology
The variety of protocol and the algorithm that move on the network are more and more abundanter; These all need dispose and manage a large amount of internal memories and support; There are two parameters important in the memory management; Be memory usage and memory management performance, memory usage is meant the shared ratio in space that internal memory is used, and the memory management performance is meant the performance of application internal memory or releasing memory.Memory usage is high more, applies for that then internal memory or releasing memory will move more internal memory, and promptly the management of performance of internal memory will be low more, so if will reach high memory usage, will inevitably reduce the management of performance of internal memory.
Present many memory management algorithms that is used for managing internal memory, some memory management algorithm can be realized higher memory management performance; Some memory management algorithm can be realized higher memory usage, can select different memory management algorithms according to different application scenarios.
The partial compression algorithm can be realized memory usage and memory management performance are regulated through regulatory factor, and usually, the value of regulatory factor is big more, and memory usage is high more, and corresponding, the memory management performance is low more; On the contrary, the value of regulatory factor is more little, and the memory management performance is high more, and corresponding, memory usage is low more.Can be according to different application scenarios; For regulatory factor suitable value is set in advance; To satisfy the different demands of different application scenarios, because this dirigibility makes the partial compression algorithm in memory management, obtain more and more wider application to memory management performance and memory usage.
The partial compression algorithm is different big or small memory blocks to be mixed put together; When mixing length that the memory block put satisfies data segment more than or equal to KW; Or the empty length of data segment back is during more than or equal to W, and internal memory is in steady state (SS), and wherein K is a regulatory factor; Integer for >=1, W are the maximum length in predefined single application or single releasing memory zone.And when having internal memory application or internal memory to discharge, if the length of data segment is less than KW, and the empty length behind the data segment is during also less than W, and internal memory just can play pendulum, and need move through internal memory this moment to make internal memory recover stable again.The memory headroom that wherein is not used is the cavity, data segment be between adjacent two cavities with the zone of data, should can constitute by at least one continuous memory block with zone of data.
In the embodiment of the present invention process; The inventor finds to exist at least in the prior art following problem, and present increasing application scenario needs to take into account memory management performance and memory usage simultaneously, in operation route querying algorithm application occasion on router; Need guarantee under the memory usage condition with higher; The memory management performance can be too not poor yet, and the partial compression algorithm is guaranteeing under the memory usage condition with higher; The memory management performance is relatively poor relatively, can not well take into account memory usage and memory management performance simultaneously.
Summary of the invention
The embodiment of the invention provides a kind of EMS memory management process and internal storage management system, can not well take into account the problem of memory usage and memory management performance simultaneously to solve the partial compression algorithm.
On the one hand, a kind of EMS memory management process is provided, internal memory is divided into first region of memory and second region of memory, adopted partial compression algorithm management first region of memory, said method comprises:
When said first region of memory plays pendulum, cause the unsettled cavity of said first region of memory with the filling of the data in second memory block, said second memory block is arranged in said second region of memory.
On the other hand, a kind of internal storage management system is provided, has comprised:
Divide module, be used for internal memory is divided into first region of memory and second region of memory;
Administration module is used to adopt partial compression algorithm management first region of memory;
Packing module when being used for said first region of memory and playing pendulum, is filled with the data in second memory block and to be caused the unsettled cavity of said first region of memory, and said second memory block is arranged in said second region of memory.
A kind of EMS memory management process and internal storage management system that the embodiment of the invention provides; Beneficial effect is: through dividing second region of memory as auxiliary area; When utilizing partial compression algorithm management first region of memory; When first region of memory played pendulum, the data of second memory block that taking-up is of convenient length from second region of memory were filled and are caused the unsettled cavity of first region of memory, owing to only need move the memory headroom that causes the unsettled cavity of first region of memory size; This empty length is less usually; Thereby significantly reduce the amount of moving of internal memory, make the region of memory of winning to return to steady state (SS) fast, and then guaranteeing under the memory usage condition with higher; Further improve the memory management performance of partial compression algorithm, thereby make the partial compression algorithm can take into account memory usage and memory management performance preferably simultaneously.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art; To do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below; Obviously, the accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills; Under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1-1 is for being in the region of memory of steady state (SS) in the prior art partial compression algorithm;
The region of memory of Fig. 1-2 for playing pendulum in the prior art partial compression algorithm;
Fig. 1-3 is the region of memory that is in steady state (SS) after prior art partial compression algorithm is moved;
The region of memory of Fig. 1-4 for playing pendulum in the prior art partial compression algorithm;
A kind of EMS memory management process process flow diagram that Fig. 2 provides for the embodiment of the invention;
The another kind of EMS memory management process process flow diagram that Fig. 3 provides for the embodiment of the invention;
The another kind of EMS memory management process process flow diagram that Fig. 4 provides for the embodiment of the invention;
Fig. 5 is first region of memory and the second region of memory synoptic diagram in the embodiment of the invention;
Fig. 5-1 is at the first region of memory releasing memory synoptic diagram in the embodiment of the invention;
Fig. 5-2 is at the first region of memory releasing memory synoptic diagram in the embodiment of the invention;
Fig. 5-3 is at the first region of memory releasing memory synoptic diagram in the embodiment of the invention;
Fig. 5-4 is at the first region of memory storage allocation synoptic diagram in the embodiment of the invention;
Fig. 5-5 is at the first region of memory storage allocation synoptic diagram in the embodiment of the invention;
Fig. 5-6 is at the first region of memory storage allocation synoptic diagram in the embodiment of the invention;
Fig. 6 is the synoptic diagram of filling cavity during the internal memory application in the embodiment of the invention;
Fig. 7 is the synoptic diagram of filling cavity when internal memory discharges in the embodiment of the invention;
The another kind of EMS memory management process process flow diagram that Fig. 8 provides for the embodiment of the invention;
Another EMS memory management process process flow diagram that Fig. 9 provides for the embodiment of the invention;
A kind of internal storage management system block diagram that Figure 10 provides for the embodiment of the invention;
The another kind of internal storage management system block diagram that Figure 11 provides for the embodiment of the invention;
The another kind of internal storage management system block diagram that Figure 12 provides for the embodiment of the invention;
Another internal storage management system block diagram that Figure 13 provides for the embodiment of the invention.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
For making the object of the invention, technical scheme and advantage clearer, will combine accompanying drawing that embodiment of the present invention is done to describe in detail further below.
The partial compression algorithm is a kind of memory management algorithm of in memory management, being used widely, and this algorithm application is more flexible, can satisfy the different demands of different application occasion to memory usage and memory management performance through regulatory factor.
The method of utilizing the partial compression algorithm to carry out memory management is specially: different big or small memory blocks are mixed put together, generally when the internal memory application, can supply to use by one section memory headroom of Random assignment, promptly generate a new memory block; Gradually; Along with internal memory by increasing use; Will in internal memory, form memory block that data are arranged one by one and the cavity that is not assigned with use one by one; Zone with data between adjacent two cavities is exactly a data segment, should can be made up of at least one continuous memory block with the zone of data.When the mixed memory block of putting satisfied one of following two conditions, internal memory was in steady state (SS):
1, the length of data segment is more than or equal to KW; K is a regulatory factor;
2, the empty length behind the data segment is more than or equal to W;
Above-mentioned W is the maximum length in predefined single application/releasing memory zone, and this maximum length can preestablish according to concrete application scenario.
Adopt partial compression algorithm management internal memory, when its memory management performance was mainly reflected in application internal memory or releasing memory, internal memory returned to the management of performance of steady state (SS) from non-steady state.
To Fig. 1-4, in the region of memory shown in Fig. 1-1, the length of data segment 1 is more than or equal to KW referring to Fig. 1-1; The length of data segment 2 all satisfies first condition also more than or equal to KW, and the length of data segment 3 is less than KW; Do not satisfy first condition, and the length in cavity 3 thereafter satisfies second condition greater than W; At this moment, this region of memory is in steady state (SS).
Referring to Fig. 1-2, when the internal memory application is arranged, distribute one section memory headroom to supply to use; This moment can form new data segment A, promptly new memory block a, and generate new cavity 1 ' with the cavity 1 "; if the length of data segment A less than KW, and cavity 1 thereafter " length also less than W, then the region of memory shown in Fig. 1-2 plays pendulum; Need move this moment through internal memory, satisfies one of above-mentioned two conditions again to this region of memory, returns to steady state (SS) again.Usually the internal memory moving method that adopts is the adjacent data segment of moving data section A (can be the adjacent data segment in its front, also can be the data segment of its rear adjacent), and A couples together with data segment; Form new data segment; Make the length of new data segment more than or equal to KW, or make the length of moving the new cavity that the back forms, all can not satisfy above-mentioned two conditions if this time move more than or equal to W; Then need carry out internal memory once more and move, return to steady state (SS) again until internal memory.Such as, referring to Fig. 1-3, data segment 1 length is less than KW, and the length in cavity 1 is greater than W; When the internal memory application, the front end distribute data section A in cavity 1 supplies to use, and at this moment, the data segment 1 that data segment A is adjacent merges; Form new data segment a, empty 1a, through the length of judgment data section a less than KW; The length of cavity 1a is then moved data segment a back with data segment 2 monoblocks, so that internal memory is in steady state (SS) less than W.It is thus clear that, need move whole data segment 2 memory headroom of length so this moment, could make internal memory recover stable, the amount of ram that therefore need move is bigger, and is more to the management of performance consumption of internal memory, so the management of performance of internal memory is lower.
Referring to Fig. 1-4, when internal memory discharges, memory block b is discharged, at this moment; Can form new data segment 1 ' with data segment 1 " and new empty B is because W is the maximum length in predefined single application or single releasing memory zone; then the length of empty B is less than W, if data segment 1 ' length less than KW, then the region of memory shown in Fig. 1-4 plays pendulum; need move this moment through internal memory, makes this region of memory satisfy one of above-mentioned two conditions again, returns to steady state (SS).Usually the internal memory moving method that adopts is that moving data section 1 ' adjacent data segment (can be the adjacent data segment in its front; Also can be the data segment of its rear adjacent); With data segment 1 ' couple together, form new data segment, make the length of new data segment more than or equal to KW; Or the length in the new cavity that forms after feasible the moving is more than or equal to W; All can not satisfy above-mentioned two conditions if this time move, then need carry out internal memory once more and move, return to steady state (SS) again until internal memory.
When region of memory plays pendulum; Tend to cause moving a large amount of memory headrooms and could make internal memory return to steady state (SS) again, especially the free space in the internal memory more after a little while, the memory headroom that need move can sharply increase; Promptly can cause the memory management performance sharply to descend; Will occur when list item is a lot of, can causing the list item refresh performance sharply to descend in the route querying algorithm such as being applied in, wherein the list item refresh performance is meant the performance of increase list item in the unit interval or the performance of interior remove entries of unit interval, and is visible; If the list item refresh performance sharply descends, will make the realization of route querying algorithm become very difficult.And a large amount of internal memories to move be exactly the main bottleneck that the memory management performance can't improve; So; The embodiment of the invention is guaranteeing under the memory usage condition with higher, through reducing the internal memory amount of moving, improves the memory management performance of partial compression algorithm; Thereby make the partial compression algorithm can take into account memory usage and memory management performance preferably simultaneously, so that make it possible to be applied in more application scenarios that need to take into account simultaneously memory management performance and memory usage more.
Referring to Fig. 2, the embodiment of the invention provides a kind of EMS memory management process, comprises the steps:
S201: internal memory is divided into first region of memory and second region of memory, adopts partial compression algorithm management first region of memory;
S202: when said first region of memory plays pendulum, cause the unsettled cavity of said first region of memory with the filling of the data in second memory block, said second memory block is arranged in said second region of memory.
The EMS memory management process that the embodiment of the invention provides; Through dividing second region of memory, when utilizing partial compression algorithm management first region of memory, when first region of memory plays pendulum as auxiliary area; The data of second memory block that taking-up is of convenient length from second region of memory are filled and are caused the unsettled cavity of first region of memory; Because only need move the memory headroom that causes the unsettled cavity of first region of memory size, this empty length is less usually, thereby significantly reduces the amount of moving of internal memory; Make the region of memory of winning to return to steady state (SS) fast; And then under assurance memory usage condition with higher, further improve the memory management performance of partial compression algorithm, thereby make the partial compression algorithm can take into account memory usage and memory management performance preferably simultaneously.
Referring to Fig. 3, the embodiment of the invention provides another kind of EMS memory management process, comprises the steps:
S301: internal memory is divided into first region of memory and second region of memory, adopts partial compression algorithm management first region of memory;
Wherein, divide second region of memory, be used for assisting first region of memory to return to steady state (SS) by non-steady state as soon as possible as auxiliary area.Relative first region of memory, very little usually as the space of second region of memory of auxiliary area, can be about 1% of first region of memory such as the length of second region of memory.
S302: when receiving the internal memory application, preferentially in second region of memory, distribute;
When receiving the internal memory application; Can in first region of memory and second region of memory, distribute at random; Preferential; Present embodiment preferentially distributes in second region of memory, is not limited in the concrete means of carrying out Memory Allocation in second region of memory in the present embodiment, and known Memory Allocation means all can be used.
S303: when said first region of memory plays pendulum, cause the unsettled cavity of said first region of memory with the filling of the data in second memory block, this second memory block is arranged in said second region of memory.
Wherein, judgement causes the method in the unsettled cavity of first region of memory to comprise:
If judge the product of the length of data segment in first region of memory less than regulatory factor and preset value, and the empty length behind this data segment is less than preset value, then should the cavity for causing the unsettled cavity of first region of memory; Above-mentioned preset value is the maximum length value of predefined single application internal memory or single releasing memory.
After with the data filling cavity in second memory block; Also comprise and judge once more whether first region of memory recovers steady state (SS); Fill and cause the unsettled cavity of first region of memory otherwise in second region of memory, take out data in second memory block of appropriate length once more, till first region of memory is in steady state (SS).
After data in taking out second memory block were filled and caused the unsettled cavity of first region of memory, the state that is removed second memory block of data just can return to unused state, at this moment, when the internal memory application is arranged once more, can be redistributed.
It is thus clear that the EMS memory management process that the embodiment of the invention provides is through dividing second region of memory as auxiliary area; When utilizing partial compression algorithm management first region of memory; When first region of memory played pendulum, the data of second memory block that taking-up is of convenient length from second region of memory were filled and are caused the unsettled cavity of first region of memory, owing to only need move the memory headroom that causes the unsettled cavity of first region of memory size; This empty length is less usually; Thereby significantly reduce the amount of moving of internal memory, make the region of memory of winning to return to steady state (SS) fast, and then guaranteeing under the memory usage condition with higher; Further improve the memory management performance of partial compression algorithm, thereby make the partial compression algorithm can take into account memory usage and memory management performance preferably simultaneously.
In addition, when the internal memory application, preferentially in second region of memory, distribute; When the second region of memory space is not enough, in first region of memory, distribute again; Like this, can improve the memory management performance greatly so that second region of memory can have more data to be used for filling.
Referring to Fig. 4, the embodiment of the invention provides another kind of EMS memory management process, comprises the steps:
S401: internal memory is divided into first region of memory and second region of memory, adopts partial compression algorithm management first region of memory;
Wherein, divide second region of memory, be used for assisting first region of memory to return to steady state (SS) by non-steady state as soon as possible as auxiliary area.Relative first region of memory is very little usually as the space of second region of memory of auxiliary area.
S402: in second region of memory, create one page at least, and manage the page information of said page or leaf; Wherein every page of at least one second memory block by equal in length rearranges continuously, and the length of second memory block is less than or equal to preset value W;
Wherein, preset value W is the maximum length of predefined single application internal memory or single releasing memory, can preestablish according to concrete application scenario.
In conjunction with referring to Fig. 5, first memory block that will differ in size in first region of memory mixes and puts together, utilizes partial compression algorithm management first region of memory, and satisfy when mixing first region of memory of putting: the length of data segment is more than or equal to KW; Or the empty length behind the data segment is during more than or equal to W, and first region of memory is in steady state (SS), and wherein K is a regulatory factor, the integer for >=1.Wherein be not assigned with the space of using in first region of memory and be the cavity; The space that has been assigned with use between adjacent two cavities is exactly a data segment with the zone of data promptly, should can be made up of at least one continuous first memory block with the zone of data.
Dividing a part of space in the region of memory outside first region of memory in addition, is second region of memory, creates the n page or leaf therein; Wherein n is integer and n >=1; Choose n in the present embodiment greater than 1, arrange at least one second memory block and the second memory block equal in length in every page in every page continuously; But the length of second memory block of same page can be not unequal.As comprising second memory block 1 of d1 equal in length in the page or leaf 1, length is L1, comprises dm the second memory block m among the page or leaf m; Length is Lm; Page or leaf comprises dn the equal-sized second memory block n among the n, and length is Ln, and wherein m is greater than 1 integer less than n; L1, Lm and Ln can equate, also can be unequal; D1, dm, dn can be one, also can be a plurality of, and the number of second memory block in choosing every page in the present embodiment is a plurality of.
Manage every page page information, comprise every page address, beginning of the page and the corresponding relation of the second memory block length and the status information (idle condition or busy state) of second memory block etc.
S403: when receiving the internal memory application, judging whether and the second memory block length of this application application heap equal in length, is execution in step S406 then; Otherwise execution in step S404;
S404: judging whether the second memory block length greater than this application application heap length, is execution in step S406 then, otherwise execution in step S405;
S405: in first region of memory, distribute execution in step S407.
S406: according to the corresponding relation of the address, said beginning of the page and the second memory block length; Obtain the corresponding address, beginning of the page of this second memory block length; And the status information of said second memory block of foundation, in the corresponding page or leaf in the address, beginning of the page that obtains, distribute second memory block that is in idle condition.
Such as, suppose in second region of memory of dividing, to create 3 pages; Be arranged with 5 length continuously in the page or leaf 1 and be 1 second memory block, be arranged with 4 length continuously in the page or leaf 2 and be 2 second memory block, be arranged with 6 length continuously in the page or leaf 3 and be 4 second memory block; When application length is 2 application heap; Equal 2 the second memory block length through judging to have,, get access to the beginning of the page address of the corresponding address, beginning of the page of this second memory block length for page or leaf 2 according to the address, beginning of the page of management and the corresponding relation of the second memory block length; According to the status information of said second memory block, in page or leaf 2, distribute second memory block that is in idle condition to supply to use; When if application length is 3 application heap; Do not equal 3 the second internal memory length through judging, then to go to judge whether the second memory block length again, through judging that it is 4 the second memory block length that length is arranged greater than 3; According to the address, beginning of the page of management and the corresponding relation of the second memory block length; Get access to the beginning of the page address of the corresponding address, beginning of the page of this second memory block length,, in page or leaf 3, distribute second memory block that is in idle condition to supply to use according to the status information of said second memory block for page or leaf 3; When application length is 5 application heap, be not equal to or greater than 5 the second internal memory length through judging, then in first region of memory, distribute.
After distributing certain second memory block to supply to use, need to revise corresponding page information, the status information of second memory block that is assigned with is revised as busy state, so that realize effective management of page information.
What above-mentioned steps S403~S406 realized is when receiving the internal memory application; Preferential method of in second region of memory, distributing second memory block; In practical application, be not limited only to above-mentioned distribution method, all can as long as can realize the method for preferentially in second region of memory, distributing.
S407: when first region of memory plays pendulum, cause the unsettled cavity of said first region of memory with the filling of the data in second memory block.
Put because first memory block that differs in size in first region of memory all mixes, and because first region of memory is generally all very big, be difficult to usually to realize information such as the address of each first memory block and length are are effectively administered and maintained; And second region of memory is as the auxiliary area of first region of memory; Usually its space is less, therefore, realizes that than being easier to the relevant information in second region of memory effectively administers and maintains; Such as maintenance and management of page information etc.; Like this, just can in second region of memory, find second memory block of suitable size fast, be used for filling and cause the unsettled cavity of first region of memory; Make the region of memory of winning to return to steady state (SS) fast, and then improve the memory management performance of partial compression algorithm.
Wherein, judge that the method whether first region of memory plays pendulum can be:
If judge the product of the length of data segment in first region of memory less than regulatory factor K and preset value W, and the empty length behind this data segment is less than preset value W, and then first region of memory plays pendulum.
Particularly; When Memory Allocation being arranged or have internal memory to discharge in first region of memory; Can produce new data segment and new cavity in first region of memory, when the length of the new data segment product less than regulatory factor K and preset value W, and the empty length behind this new data segment is also less than preset value W; Then this moment, first region of memory played pendulum, this length less than the cavity of preset value W for causing the unsettled cavity of first region of memory.
Wherein, judgement causes the method in the unsettled cavity of first region of memory to comprise:
If judge the product of the length of data segment in first region of memory less than regulatory factor and preset value, and the empty length behind this data segment is less than preset value, then should the cavity for causing the unsettled cavity of first region of memory; Above-mentioned preset value is the maximum length value of predefined single application internal memory or single releasing memory.In practical application; If there are two cavities; Wherein any one all can be so that first region of memory recovers steady state (SS) when filling; Preferably can select the little cavity of length as causing the unsettled cavity of first region of memory,, further improve the memory management performance of partial compression algorithm so that further reduce the internal memory amount of moving.
Such as; Referring to Fig. 5-1,, produce new data segment 1a and data segment 1b this moment at releasing memory space, the middle part k of the data segment 1 of first region of memory; And new cavity 0; If the length of then judging cavity 0 is less than W, and the length of data segment 1a is less than KW, and then cavity 0 is for causing the unsettled cavity of first region of memory;
Perhaps; If the length of judging data segment 1b is less than KW; And the length in cavity 1 is less than W (length of tentation data section 1a is greater than KW); Then cavity 0 or cavity 1 preferably, can select the little cavity of length as causing the unsettled cavity of first region of memory for causing the unsettled cavity of first region of memory.
Referring to Fig. 5-2, at the front end releasing memory space u of the data segment 2 of first region of memory, at this moment; The cavity 1 that space u is adjacent merges the new empty 1a of formation, and new data segment 2a, if the length of judgement data segment 2a is less than KW; And the length in cavity 2 is less than W; Then cavity 2 or space u be for causing the unsettled cavity of first region of memory, preferably, can select that the less conduct of length causes the unsettled cavity of first region of memory among both.
Referring to Fig. 5-3, in the rear end releasing memory space E of the data segment 1 of first region of memory, at this moment; The cavity 1 that space E is adjacent merges new empty 1a of formation and new data segment 1a, if the length of judgement data segment 1a is less than KW; And the length of empty 1a is less than W; Then empty 1a or space E are for causing the unsettled cavity of first region of memory, and be preferred, can select the conduct that length is little among both to cause the unsettled cavity of first region of memory.
Referring to Fig. 5-4, the 1 middle part allocation space m in the cavity of first region of memory forms new data segment M this moment; Cavity 1a and empty 1b; If the length of judging empty 1a is less than W, and the length of data segment 1 is less than KW, and then empty 1a is for causing the unsettled cavity of first region of memory;
If the length sum of data segment 1, empty 1a and data segment M is less than KW; And empty 1b is also less than the words of W; Then empty 1b causes the unsettled cavity of first region of memory; If promptly also less than W, then empty 1a and empty 1b cause the unsettled cavity of first region of memory to the length sum of data segment 1, empty 1a and data segment M less than KW and empty 1b, need empty 1a and empty 1b be filled this moment and just can make the region of memory of winning return to steady state (SS).
Referring to Fig. 5-5; Front end allocation space n in the cavity 1 of first region of memory; The data segment 1 that this time space n is adjacent merges new data segment 1a of formation and new empty 1a, if the length of judgement data segment 1a is less than KW; And the length of empty 1a is less than W, and then empty 1a is for causing the unsettled cavity of first region of memory.
Referring to Fig. 5-6; Rear end allocation space h in the cavity 1 of first region of memory; The data segment 2 that this time space h is adjacent merges new data segment 2a of formation and new empty 1a, if the length of judgement data segment 1 is less than KW; And the length of empty 1a is less than W, and then empty 1a is for causing the unsettled cavity of first region of memory.
Preferably, cause the method in the unsettled cavity of first region of memory to be with the filling of the data in second memory block:
Judging whether and cause the second memory block length of the unsettled empty equal in length of first region of memory, is then according to the corresponding relation of address, said beginning of the page with the second memory block length, obtains the address, beginning of the page of this second memory block length correspondence; According to the status information of said second memory block, in the corresponding page or leaf in address, said beginning of the page, take out the data in second memory block that is in busy state, filling causes the unsettled cavity of said first region of memory; Or
Judged whether that a plurality of second memory block length sums equal to cause the unsettled empty length of first region of memory; Be then according to equaling the second required memory block length of said empty length and the rule of correspondence of number; With the corresponding relation of the address, said beginning of the page and the second memory block length, obtain at least one corresponding respectively address, beginning of the page of these a plurality of second memory block length; According to the status information of said second memory block, in the corresponding page or leaf in this at least one address, beginning of the page, the data in second memory block that is in busy state of taking-up respective length and number, filling causes the unsettled cavity of said first region of memory.
In conjunction with referring to Fig. 6, when the internal memory application, suppose in cavity 1, to distribute the first memory block F to supply to use, produce new data segment 0 and new cavity 10, cavity 11 this moment.Through judging; The length of the data segment 1 of 10 fronts, cavity is greater than KW; And if the length of the data segment 0 of empty 11 fronts is less than KW (maximum length of applying for internal memory is W, K is generally >=1 integer) at every turn, if the length in cavity 11 is less than W; Then cavity 11 is for causing the unsettled cavity of first region of memory, and promptly this moment, first region of memory played pendulum.Suppose; Through judging; The second memory block length L m with cause unsettled empty 11 the equal in length of first internal memory, then according to the corresponding relation of address, said beginning of the page, obtain the beginning of the page address of the corresponding address, beginning of the page of this second memory block length L m for page m with the second memory block length; According to the status information of said second memory block, in the corresponding page or leaf m in this address, beginning of the page, take out the data in second memory block that is in busy state, filling cavity 11.Certainly, also can there be a plurality of second memory block length sums to equal at empty 11 o'clock, come filling cavity 11 with the data in these a plurality of second memory blocks.
In conjunction with referring to Fig. 7, when internal memory discharges, Free up Memory Z in data segment 1; This space Z comprises at least one first memory block, generates new empty C this moment, data segment 10 and data segment 11; If the length of data segment 10 is less than KW, and the length of empty C then can be known through judging less than W; Cavity C is for causing the unsettled cavity of first region of memory, and promptly this moment, first region of memory played pendulum.Suppose; Through judging; 2 second memory block length L 1 and 1 second memory block length L m sum; Equal to cause the length of the unsettled empty C of first region of memory, then according to the corresponding relation of the address, said beginning of the page and the second memory block length, obtain the corresponding respectively address, beginning of the page of these 3 second memory block length: the address, beginning of the page of the address, beginning of the page of page or leaf 1 and page or leaf m; Status information according to said second memory block; In the corresponding page or leaf 1 in the address, beginning of the page of page or leaf 1 and the address, beginning of the page of page or leaf m and page or leaf m; According to the above-mentioned rule of correspondence (be that length L 1 is corresponding with quantity 2, and Lm corresponding with quantity 1), 2 of taking-ups are in the data in second memory block of busy state in page or leaf 1; With in page or leaf m, take out 1 data in second memory block that is in expense idle condition, filling causes among the empty C in the lump.Certainly, when the second memory block length with empty C equal in length also can be arranged, come filling cavity C with the data in this one second memory block.
In the prior art; When first region of memory plays pendulum, can't from existing first region of memory, find the memory headroom of suitable size to move fast, can not make the region of memory of winning reach stable and often once move; Usually be just can make the region of memory of winning reach stable again through moving repeatedly; For the high more situation of memory usage, this number of times of moving can increase accordingly, so the management of performance of internal memory is low relatively more.
And this filling mode that adopts the embodiment of the invention to provide; Can reduce the amount of moving of internal memory; And make the region of memory of winning to return to steady state (SS) fast, thereby can under the situation of not losing memory usage, improve the management of performance of internal memory greatly.
After with the data filling cavity at least one said second memory block; Also comprise and judge once more whether first region of memory recovers steady state (SS); Fill and cause the unsettled cavity of first region of memory otherwise in second region of memory, take out data in second memory block of appropriate length once more, till first region of memory is in steady state (SS).
Wherein, judge that the method whether first region of memory recovers steady state (SS) comprises:
Whether the length of judgment data section multiply by preset value more than or equal to regulatory factor, is that then internal memory recovers steady state (SS);
Otherwise whether judging empty length behind this data segment more than or equal to said preset value, is that then internal memory recovers steady state (SS).
After data in taking out second memory block are filled and are caused the unsettled cavity of first region of memory; The state that is removed second memory block of data just can recover idle condition; At this moment, needing to revise corresponding page information, is idle condition with its status modifier; When the internal memory application is arranged once more, just can be redistributed.
Wherein, the step S403~S406 that preferentially distributes at second region of memory, and do not have strict order to limit between the step S407 that fills; When receiving the internal memory application; Just execution in step S403~S406, when first region of memory plays pendulum, just execution in step S407; The step and the step of filling of preferentially distributing at second region of memory, its order does not here limit with the execution number of times.
The EMS memory management process that the embodiment of the invention provides; Through dividing second region of memory, when utilizing partial compression algorithm management first region of memory, when first region of memory plays pendulum as auxiliary area; Data are filled and are caused the unsettled cavity of first region of memory in second memory block that taking-up is of convenient length from second region of memory; Because only need move the memory headroom that causes the unsettled cavity of first region of memory size, this empty length is less usually, thereby significantly reduces the amount of moving of internal memory; Make the region of memory of winning to return to steady state (SS) fast; And then under assurance memory usage condition with higher, further improve the memory management performance of partial compression algorithm, thereby make the partial compression algorithm can take into account memory usage and memory management performance preferably simultaneously.
In addition, in the embodiment of the present invention process, the inventor also finds also to exist in addition in the prior art following problem: when adopting the partial compression algorithm to carry out memory management; Generally also can there be application space and the inconsistent problem of Free up Memory performance; Particularly, Free up Memory can cause more internal memory to move than the application space in the partial compression algorithm, and promptly the performance of Free up Memory is far below the performance in application space; Such as; For operation route querying algorithm application occasion on router, when adopting the partial compression algorithm to carry out memory management, the performance that remove entries can occur is far below the performance of adding list item.The EMS memory management process that adopts the embodiment of the invention to provide; When Free up Memory; The data filling that can directly take out in second memory block that is of convenient length causes the unsettled cavity of first region of memory; Thereby internal memories a large amount of when having significantly reduced releasing memory are moved, and have further solved application space and the inconsistent problem of Free up Memory performance in the partial compression algorithm.
Referring to Fig. 8, the embodiment of the invention provides another kind of EMS memory management process, comprises the steps:
S801: internal memory is divided into first region of memory and second region of memory, adopts partial compression algorithm management first region of memory.
Wherein, divide second region of memory, be used for assisting first region of memory to return to steady state (SS) by non-steady state as soon as possible as auxiliary area.Relative first region of memory is very little usually as the space of second region of memory of auxiliary area.
S802: in this second region of memory, create the W page or leaf; Every page of at least one second memory block by equal in length rearranges continuously; Wherein the length of second memory block 1 in the page or leaf 1 is 1; The length of second memory block 2 in the page or leaf 2 is 2, and the like, the length of the second memory block W among the page or leaf W is W (W is the integer greater than 2 in the present embodiment); Wherein W is the maximum length in predefined single application/releasing memory zone, and this maximum length can preestablish according to concrete application scenario.
And manage every page page information, comprise the status information (idle condition or busy state) of the corresponding relation and second memory block of the address, beginning of the page and the second memory block length etc.
S803: when receiving the internal memory application; The application heap length of supposing this application is L; Whether then judge has second memory block (wherein the length of second memory block among the page or leaf L equals L) that is in idle condition, if having, then divide second memory block of arbitrary free time among the L that gathers leaves of a book to supply to use among the page or leaf L; And the status information of revising this second memory block is busy state, if not then distribute at first region of memory.
S804: when first region of memory plays pendulum; Suppose that causing the length in the unsettled cavity of first region of memory is R; Then judge according to above-mentioned page information whether second memory block (wherein the length of second memory block among the page or leaf R equals R) that is in busy state is arranged among the page or leaf R; If have, then filling with the data in the second arbitrary busy memory block among the page or leaf R should the cavity.
After with the data filling cavity in second memory block; Also comprise and judge once more whether first region of memory recovers steady state (SS); Fill and cause the unsettled cavity of first region of memory otherwise in second region of memory, take out data in second memory block of appropriate length once more, till first region of memory is in steady state (SS).
After data in taking out second memory block are filled and are caused the unsettled cavity of first region of memory; The state that is removed second memory block of data just can recover idle condition; At this moment, needing to revise corresponding page information, is idle condition with its status modifier; When the internal memory application is arranged once more, just can be redistributed.
The EMS memory management process that the embodiment of the invention provides; Comprise second region of memory of W page or leaf through division, second memory block of corresponding length in this W page or leaf of priority allocation when the application internal memory is when first region of memory plays pendulum; From page or leaf with second memory block that is of convenient length; Take out the data in arbitrary second memory block, filling causes the unsettled cavity of first region of memory, owing to only need move the memory headroom that causes the unsettled cavity of first region of memory size; This empty length is less usually; Thereby significantly reduce the amount of moving of internal memory, make internal memory can return to steady state (SS) fast, and then guaranteeing under the memory usage condition with higher; Further improve the memory management performance of partial compression algorithm, thereby make the partial compression algorithm can take into account memory usage and memory management performance preferably simultaneously; Simultaneously, in the embodiment of the invention, when Memory Allocation being arranged and fill, all be directly to distribute in the page or leaf or fetch data and fill with appropriate length second memory block, this mode makes that the maintenance and management of second region of memory is very simple and convenient.
Referring to Fig. 9, the embodiment of the invention provides another EMS memory management process, comprises the steps:
S901: internal memory is divided into first region of memory and second region of memory, adopts partial compression algorithm management first region of memory.
Wherein, divide second region of memory, be used for assisting first region of memory to return to steady state (SS) by non-steady state as soon as possible as auxiliary area.Relative first region of memory is very little usually as the space of second region of memory of auxiliary area.
S902: when receiving the internal memory application; Judge the cavity that whether has in said second region of memory more than or equal to this application application heap length; Be then in said cavity, to distribute, generate the second new memory block, and manage the corresponding relation of said second memory block length and address;
Dividing second region of memory whole zone when initial of coming out is a big cavity; Whole zone all is in the state that is not used; When the internal memory application, preferentially in second region of memory, distribute, whether divide timing to judge earlier has the cavity more than or equal to this application application heap length in this second region of memory; Be then in satisfying arbitrary cavity of length, to carry out and can distribute, the zone that is assigned with forms second a new memory block.
Because second region of memory is an auxiliary area; Relative first region of memory in its space is very little usually; Therefore; Can realize the length and the address information of second memory block are are effectively administered and maintained, can realize effectively that promptly the corresponding relation etc. to the second memory block length and address is managed.
S903: when first region of memory plays pendulum, cause the unsettled cavity of said first region of memory with the filling of the data in second memory block that is of convenient length.
Wherein, judgement causes the method in the unsettled cavity of first region of memory to comprise:
If judge the product of the length of data segment in first region of memory less than regulatory factor and preset value, and the empty length behind this data segment is less than preset value, then should the cavity for causing the unsettled cavity of first region of memory; Above-mentioned preset value is the maximum length value of predefined single application internal memory or single releasing memory.
Preferably, cause the method in the unsettled cavity of said first region of memory to be with the filling of the data in second memory block that is of convenient length:
Judge whether and the second memory block length that causes the unsettled empty equal in length of first region of memory; Be then according to the corresponding relation of the said second memory block length and address; Obtain this second memory block length corresponding address; Take out the data in the second corresponding memory block of said address, filling causes the unsettled cavity of said first region of memory; Or
Judging whether that a plurality of second memory block length sums equal to cause the length in the unsettled cavity of first region of memory, is then according to the corresponding relation of the said second memory block length and address, obtains this a plurality of second memory block length a plurality of addresses of correspondence respectively; Take out the data in the second corresponding memory block of these a plurality of addresses, filling causes the unsettled cavity of said first region of memory.
After with the data filling cavity in second memory block; Also comprise and judge once more whether first region of memory recovers steady state (SS); Fill and cause the unsettled cavity of first region of memory otherwise in second region of memory, take out data in second memory block of appropriate length once more, till first region of memory is in steady state (SS).
After data in taking out second memory block were filled and caused the unsettled cavity of first region of memory, second memory block that is removed data just became the cavity again, promptly is in the state of not being used again, at this moment, when the internal memory application is arranged once more, can be redistributed.
Wherein, There is not strict order to limit between step S902 and the step S903; When receiving the internal memory application, just execution in step S902 is when judging that first region of memory plays pendulum; Just execution in step S903, its order of step S902 and step S903 does not here limit with the number of times of carrying out.
The EMS memory management process that the embodiment of the invention provides; Through dividing second region of memory, when utilizing partial compression algorithm management first region of memory, when first region of memory plays pendulum as auxiliary area; The data of second memory block that taking-up is of convenient length from second region of memory are filled and are caused the unsettled cavity of first region of memory; Because only need move the memory headroom that causes the unsettled cavity of first region of memory size, this empty length is less usually, thereby significantly reduces the amount of moving of internal memory; Make the region of memory of winning to return to steady state (SS) fast; And then under assurance memory usage condition with higher, further improve the memory management performance of partial compression algorithm, thereby make the partial compression algorithm can take into account memory usage and memory management performance preferably simultaneously.
In addition, in the embodiment of the present invention process, the inventor also finds also to exist in addition in the prior art following problem: when adopting the partial compression algorithm to carry out memory management; Generally also can there be application space and the inconsistent problem of Free up Memory performance; Particularly, Free up Memory can cause more internal memory to move than the application space in the partial compression algorithm, and promptly the performance of Free up Memory is far below the performance in application space; Such as; For operation route querying algorithm application occasion on router, when adopting the partial compression algorithm to carry out memory management, the performance that remove entries can occur is far below the performance of adding list item.The EMS memory management process that adopts the embodiment of the invention to provide; When Free up Memory; The data filling that can directly take out in second memory block that is of convenient length causes the unsettled cavity of first region of memory; Thereby internal memories a large amount of when having significantly reduced releasing memory are moved, and have further solved application space and the inconsistent problem of Free up Memory performance in the partial compression algorithm.
Referring to Figure 10, the embodiment of the invention provides a kind of internal storage management system, comprising:
Divide module 1001, be used for internal memory is divided into first region of memory and second region of memory;
Administration module 1002 is used to adopt partial compression algorithm management first region of memory;
Packing module 1003 when being used for said first region of memory and playing pendulum, is filled with the data in second memory block and to be caused the unsettled cavity of said first region of memory, and said second memory block is arranged in said second region of memory.
Wherein, divide second region of memory, be used for assisting first region of memory to return to steady state (SS) by non-steady state as soon as possible as auxiliary area.Relative first region of memory is very little usually as the space of second region of memory of auxiliary area.
The internal storage management system that the embodiment of the invention provides; Through dividing second region of memory that module 1001 divides as auxiliary area; When packing module 1003 played pendulum at first region of memory, the data of second memory block that taking-up is of convenient length from second region of memory were filled and are caused the unsettled cavity of first region of memory, owing to only need move the memory headroom that causes the unsettled cavity of first region of memory size; This empty length is less usually; Thereby significantly reduce the amount of moving of internal memory, make the region of memory of winning to return to steady state (SS) fast, and then guaranteeing under the memory usage condition with higher; Further improve the memory management performance of partial compression algorithm, thereby make the partial compression algorithm can take into account memory usage and memory management performance preferably simultaneously.
Referring to Figure 11, in another embodiment of the present invention, said system also comprises priority allocation module 1101, is used for when receiving the internal memory application, preferentially in said second region of memory, distributes.
In the present embodiment; Preferentially in second region of memory, distribute during the internal memory application, when the second region of memory space is not enough, in first region of memory, distribute again, like this; Second region of memory can improve the memory management performance greatly so that can have more data to be used for filling.
Referring to Figure 12, in another embodiment of the present invention, divide module 1001 and further comprise:
Page or leaf is created the unit; Be used for creating one page at least at said second region of memory; Wherein every page of at least one second memory block by equal in length rearranges continuously, and the length of said second memory block is less than or equal to the maximum length of predefined single application internal memory or single releasing memory;
The page management unit is used to manage the page information that said page or leaf is created the page or leaf of creating the unit, comprises every page address, beginning of the page and the corresponding relation of the second memory block length and the status information (idle condition or busy state) of second memory block etc.
Priority allocation module 1101 specifically comprises:
First judging unit 1201 is used to judge whether and the second memory block length of this application application heap equal in length, is then according to the corresponding relation of address, said beginning of the page with the second memory block length, obtains the address, beginning of the page of this second memory block length correspondence;
Second judging unit 1202; Be used in the judged result of said first judging unit 1201 for not the time; Judge whether the second memory block length greater than this application application heap length; Be then according to the corresponding relation of address, said beginning of the page and the second memory block length, obtain the address, beginning of the page of this second memory block length correspondence;
Page or leaf allocation units 1203 are used for the status information according to said second memory block, in the corresponding page or leaf in the address, beginning of the page that said first judging unit 1201 or second judging unit 1202 obtain, distribute second memory block that is in idle condition.
Accordingly, said packing module 1003 comprises:
First filler cells; Be used to judge whether and the second memory block length that causes the unsettled empty equal in length of first region of memory; Be then according to the corresponding relation of address, said beginning of the page and the second memory block length, obtain the address, beginning of the page of this second memory block length correspondence; According to the status information of said second memory block, in the corresponding page or leaf in address, said beginning of the page, take out the data in second memory block that is in busy state, filling causes the unsettled cavity of said first region of memory; Or
Second filler cells; Be used to judge whether that a plurality of second memory block length sums equal to cause the unsettled empty length of first region of memory; Be then according to the rule of correspondence that equals the second required memory block length of said empty length and this second memory block number; With the corresponding relation of the address, said beginning of the page and the second memory block length, obtain at least one corresponding respectively address, beginning of the page of these a plurality of second memory block length; According to the status information of said second memory block, in the corresponding page or leaf in this at least one address, beginning of the page, the data in second memory block that is in busy state of taking-up respective length and number, filling causes the unsettled cavity of said first region of memory.
In the distribution module 1001 that provides among this embodiment, come maintenance and management second region of memory, this mode to make that the maintenance and management of second region of memory is very simple and convenient through creating page or leaf.
Referring to Figure 13, in another embodiment of the present invention, said priority allocation module 1101 specifically comprises:
Mix and to put allocation units 1301, be used for judging when said second region of memory has more than or equal to this application application heap length empty, in said cavity, distribute, generate the second new memory block;
Piece administrative unit 1302 is used to manage the corresponding relation of said second memory block length and address.
Accordingly, said packing module 1003 specifically comprises:
The 3rd filler cells; Be used to judge whether and the second memory block length that causes the unsettled empty equal in length of first region of memory; Be then according to the corresponding relation of the said second memory block length and address; Obtain this second memory block length corresponding address, take out the data in the second corresponding memory block of said address, filling causes the unsettled cavity of said first region of memory; Or
The 4th filler cells; Be used to judge whether that a plurality of second memory block length sums equal to cause the length in the unsettled cavity of first region of memory; Be then according to the corresponding relation of the said second memory block length and address, obtain this a plurality of second memory block length a plurality of addresses of correspondence respectively; Take out the data in the second corresponding memory block of these a plurality of addresses, filling causes the unsettled cavity of said first region of memory.
Second region of memory adopts second memory block mixed and puts among this embodiment, and the length and the address information of managing second memory block manage, and this mode is for second region of memory, and memory usage is higher relatively.
The concrete implementation method of said system embodiment repeats no more please with reference to preceding method embodiment here.
Further, in the embodiment of the present invention process, the inventor also finds also to exist in addition in the prior art following problem: when adopting the partial compression algorithm to carry out memory management; Generally also can there be application space and the inconsistent problem of Free up Memory performance; Particularly, Free up Memory can cause more internal memory to move than the application space in the partial compression algorithm, and promptly the performance of Free up Memory is far below the performance in application space; Such as; For operation route querying algorithm application occasion on router, when adopting the partial compression algorithm to carry out memory management, the performance that remove entries can occur is far below the performance of adding list item.The internal storage management system that adopts the embodiment of the invention to provide; When Free up Memory; The data filling that packing module 1003 can directly take out in second memory block that is of convenient length causes the unsettled cavity of first region of memory; Thereby internal memories a large amount of when having significantly reduced releasing memory are moved, and have further solved application space and the inconsistent problem of Free up Memory performance in the partial compression algorithm.
Need to prove; In this article; Relational terms such as first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint relation or the order that has any this reality between these entities or the operation.And; Term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability; Thereby make and comprise that process, method, article or the equipment of a series of key elements not only comprise those key elements; But also comprise other key elements of clearly not listing, or also be included as this process, method, article or equipment intrinsic key element.Under the situation that do not having much more more restrictions, the key element that limits by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises said key element and also have other identical element.
One of ordinary skill in the art will appreciate that; Realize that all or part of step in the foregoing description method is to instruct relevant hardware to accomplish through program; Described program can be stored in the computer read/write memory medium; This program comprises that some instructions are in order to carry out the described method of each embodiment of the present invention when carrying out.Storage medium described here, as: ROM/RAM, magnetic disc, CD etc.
The above is merely preferred embodiment of the present invention, is not to be used to limit protection scope of the present invention.All any modifications of within spirit of the present invention and principle, being done, be equal to replacement, improvement etc., all be included in protection scope of the present invention.

Claims (7)

1. an EMS memory management process is characterized in that, internal memory is divided into first region of memory and second region of memory, adopts partial compression algorithm management first region of memory, and said method comprises:
When said first region of memory plays pendulum, cause the unsettled cavity of said first region of memory with the filling of the data in second memory block, said second memory block is arranged in said second region of memory;
When receiving the internal memory application, preferentially in said second region of memory, distribute;
In said second region of memory, create one page at least, and manage the page information of said page or leaf; Wherein every page of at least one second memory block by equal in length rearranges continuously, and the length of said second memory block is less than or equal to the maximum length of predefined single application internal memory or single releasing memory;
Said page information comprises the status information of the corresponding relation and second memory block of the address, beginning of the page and the second memory block length;
Then preferentially in said second region of memory, distribute and comprise:
Judging whether and the second memory block length of this application application heap equal in length, is then according to the corresponding relation of address, said beginning of the page with the second memory block length, obtains the address, beginning of the page of this second memory block length correspondence;
Otherwise judging whether the second memory block length greater than this application application heap length, is then according to the corresponding relation of address, said beginning of the page with the second memory block length, obtains the address, beginning of the page of this second memory block length correspondence;
According to the status information of said second memory block, in the corresponding page or leaf in address, said beginning of the page, distribute second memory block that is in idle condition;
Cause the unsettled cavity of said first region of memory to comprise with the filling of the data in second memory block:
Judging whether and cause the second memory block length of said empty equal in length, is then according to the corresponding relation of address, said beginning of the page with the second memory block length, obtains the address, beginning of the page of this second memory block length correspondence; According to the status information of said second memory block, in the corresponding page or leaf in address, said beginning of the page, take out the data in second memory block that is in busy state, filling causes the unsettled cavity of said first region of memory; Or
Judged whether that a plurality of second memory block length sums equal said empty length; Be then according to equaling the second required memory block length of said empty length and the rule of correspondence of number; With the corresponding relation of the address, said beginning of the page and the second memory block length, obtain at least one corresponding respectively address, beginning of the page of these a plurality of second memory block length; According to the status information of said second memory block, in the corresponding page or leaf in this at least one address, beginning of the page, the data in second memory block that is in busy state of taking-up respective length and number, filling causes the unsettled cavity of said first region of memory.
2. according to the said method of claim 1, it is characterized in that, preferentially in said second region of memory, distribute to comprise:
Judging the cavity that whether has in said second region of memory more than or equal to this application application heap length, is then in said cavity, to distribute, and generates the second new memory block, and manages the corresponding relation of said second memory block length and address.
3. according to the said method of claim 2, it is characterized in that, cause the unsettled cavity of said first region of memory to comprise with the filling of the data in second memory block:
Judge whether and the second memory block length that causes the unsettled empty equal in length of first region of memory; Be then according to the corresponding relation of the said second memory block length and address; Obtain this second memory block length corresponding address; Take out the data in the second corresponding memory block of said address, filling causes the unsettled cavity of said first region of memory; Or
Judging whether that a plurality of second memory block length sums equal to cause the length in the unsettled cavity of first region of memory, is then according to the corresponding relation of the said second memory block length and address, obtains this a plurality of second memory block length a plurality of addresses of correspondence respectively; Take out the data in the second corresponding memory block of these a plurality of addresses, filling causes the unsettled cavity of said first region of memory.
4. according to the said method of claim 1, it is characterized in that, judge to cause the method in the unsettled cavity of said first region of memory to comprise:
If judge the product of the length of data segment in said first region of memory less than regulatory factor and preset value, and the empty length behind this data segment is less than preset value, then should the cavity for causing the unsettled cavity of said first region of memory; Said preset value is the maximum length value of predefined single application internal memory or single releasing memory.
5. an internal storage management system is characterized in that, comprising:
Divide module, be used for internal memory is divided into first region of memory and second region of memory;
Administration module is used to adopt partial compression algorithm management first region of memory;
Packing module when being used for said first region of memory and playing pendulum, is filled with the data in second memory block and to be caused the unsettled cavity of said first region of memory, and said second memory block is arranged in said second region of memory;
Said system also comprises the priority allocation module, is used for when receiving the internal memory application, preferentially in said second region of memory, distributes;
Said division module also comprises:
Page or leaf is created the unit; Be used for creating one page at least at said second region of memory; Wherein every page of at least one second memory block by equal in length rearranges continuously, and the length of said second memory block is less than or equal to the maximum length of predefined single application internal memory or single releasing memory;
The page management unit is used to manage the page information that said page or leaf is created the page or leaf of creating the unit;
Said page information comprises the status information of the corresponding relation and second memory block of the address, beginning of the page and the second memory block length;
Said priority allocation module comprises:
First judging unit is used to judge whether and the second memory block length of this application application heap equal in length, is then according to the corresponding relation of address, said beginning of the page with the second memory block length, obtains the address, beginning of the page of this second memory block length correspondence;
Second judging unit; Be used in the judged result of said first judging unit for not the time; Judge whether the second memory block length greater than this application application heap length; Be then according to the corresponding relation of address, said beginning of the page and the second memory block length, obtain the address, beginning of the page of this second memory block length correspondence;
The page or leaf allocation units are used for the status information according to said second memory block, in the corresponding page or leaf in the address, beginning of the page that said first judging unit or second judging unit obtain, distribute second memory block that is in idle condition;
Said packing module comprises:
First filler cells; Be used to judge whether and the second memory block length that causes the unsettled empty equal in length of first region of memory; Be then according to the corresponding relation of address, said beginning of the page and the second memory block length, obtain the address, beginning of the page of this second memory block length correspondence; According to the status information of said second memory block, in the corresponding page or leaf in address, said beginning of the page, take out the data in second memory block that is in busy state, filling causes the unsettled cavity of said first region of memory; Or
Second filler cells; Be used to judge whether that a plurality of second memory block length sums equal to cause the unsettled empty length of first region of memory; Be then according to equaling the second required memory block length of said empty length and the rule of correspondence of number; With the corresponding relation of the address, said beginning of the page and the second memory block length, obtain at least one corresponding respectively address, beginning of the page of these a plurality of second memory block length; According to the status information of said second memory block, in the corresponding page or leaf in this at least one address, beginning of the page, the data in second memory block that is in busy state of taking-up respective length and number, filling causes the unsettled cavity of said first region of memory.
6. according to the said system of claim 5, it is characterized in that said priority allocation module comprises:
Mix and to put allocation units, be used for judging when said second region of memory has more than or equal to this application application heap length empty, in said cavity, distribute, generate the second new memory block;
The piece administrative unit is used to manage the corresponding relation of said second memory block length and address.
7. according to the said system of claim 6, it is characterized in that said packing module comprises:
The 3rd filler cells; Be used to judge whether and the second memory block length that causes the unsettled empty equal in length of first region of memory; Be then according to the corresponding relation of the said second memory block length and address; Obtain this second memory block length corresponding address, take out the data in the second corresponding memory block of said address, filling causes the unsettled cavity of said first region of memory; Or
The 4th filler cells; Be used to judge whether that a plurality of second memory block length sums equal to cause the length in the unsettled cavity of first region of memory; Be then according to the corresponding relation of the said second memory block length and address, obtain this a plurality of second memory block length a plurality of addresses of correspondence respectively; Take out the data in the second corresponding memory block of these a plurality of addresses, filling causes the unsettled cavity of said first region of memory.
CN2009101473336A 2009-06-11 2009-06-11 Memory management method and memory management system Expired - Fee Related CN101923511B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101473336A CN101923511B (en) 2009-06-11 2009-06-11 Memory management method and memory management system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101473336A CN101923511B (en) 2009-06-11 2009-06-11 Memory management method and memory management system

Publications (2)

Publication Number Publication Date
CN101923511A CN101923511A (en) 2010-12-22
CN101923511B true CN101923511B (en) 2012-08-08

Family

ID=43338462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101473336A Expired - Fee Related CN101923511B (en) 2009-06-11 2009-06-11 Memory management method and memory management system

Country Status (1)

Country Link
CN (1) CN101923511B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844046B (en) * 2016-12-31 2021-06-11 北京市腾河智慧能源科技有限公司 Broadband carrier memory management method
CN107203477A (en) 2017-06-16 2017-09-26 深圳市万普拉斯科技有限公司 Memory allocation method, device, electronic equipment and readable storage medium storing program for executing
BR112021024426A2 (en) * 2019-07-02 2022-01-18 Microsoft Technology Licensing Llc Hardware-based memory compression

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6725326B1 (en) * 2000-08-15 2004-04-20 Cisco Technology, Inc. Techniques for efficient memory management for longest prefix match problems
US7287145B1 (en) * 2004-12-13 2007-10-23 Nvidia Corporation System, apparatus and method for reclaiming memory holes in memory composed of identically-sized memory devices
CN101189583A (en) * 2005-03-23 2008-05-28 安泰科技有限公司 Variable partitioned blocks in shared memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6725326B1 (en) * 2000-08-15 2004-04-20 Cisco Technology, Inc. Techniques for efficient memory management for longest prefix match problems
US7287145B1 (en) * 2004-12-13 2007-10-23 Nvidia Corporation System, apparatus and method for reclaiming memory holes in memory composed of identically-sized memory devices
CN101189583A (en) * 2005-03-23 2008-05-28 安泰科技有限公司 Variable partitioned blocks in shared memory

Also Published As

Publication number Publication date
CN101923511A (en) 2010-12-22

Similar Documents

Publication Publication Date Title
CN100382048C (en) A managing method for EMS memory
CN101226553A (en) Method and device for storing length-various field of embedded database
CN102377682B (en) Queue management method and device based on variable-length packets stored in fixed-size location
CN101605100B (en) Method and apparatus for managing queue storage space
CN101923511B (en) Memory management method and memory management system
Wald On fast construction of SAH-based bounding volume hierarchies
CN101221536A (en) Internal memory managing method and device of embedded system
US7664905B2 (en) Page stream sorter for poor locality access patterns
CN108038002A (en) A kind of embedded software EMS memory management process
CN105843748A (en) Method and device for processing memory page in memory
CN106354890A (en) Implementation method of random access file system based on N-ary tree structure
CN102495806A (en) Periodic wear balancing method and memory management method of phase change memory
CN102819494B (en) Optimization method when a kind of flash memory is sequentially written in
CN103793332B (en) Date storage method based on internal memory, device, processor and electronic equipment
CN109960471A (en) Date storage method, device, equipment and storage medium
CN102262512A (en) System, device and method for realizing disk array cache partition management
CN100403280C (en) Method and apparatus for updating data
CN110032549A (en) Subregion splitting method, device, electronic equipment and readable storage medium storing program for executing
CN108701024A (en) Method for distributing virtual register storehouse in stack machine
CN108984280A (en) A kind of management method and device, computer readable storage medium of chip external memory
CN101292227B (en) Cache with high access store bandwidth
CN102255818B (en) Method and device for driving message receiving
CN1331060C (en) Data processing system with delamination storage system structure and method for operating the same
CN106406764A (en) A high-efficiency data access system and method for distributed SAN block storage
CN103226520A (en) Self-adaptive cluster memory management method and server clustering system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120808

Termination date: 20190611