CN1181434C - Adaptive dynamic memory management method - Google Patents
Adaptive dynamic memory management method Download PDFInfo
- Publication number
- CN1181434C CN1181434C CNB011188731A CN01118873A CN1181434C CN 1181434 C CN1181434 C CN 1181434C CN B011188731 A CNB011188731 A CN B011188731A CN 01118873 A CN01118873 A CN 01118873A CN 1181434 C CN1181434 C CN 1181434C
- Authority
- CN
- China
- Prior art keywords
- page
- burst
- bunch
- idle
- memory management
- 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
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention discloses a self-adaptive dynamic memory management method which takes page clusters as units to allocate memory from an idle memory region for application. Pages are contained in the page clusters; the length of each page can accommodate a segment with maximal byte number. In the page clusters of the same type, the byte numbers of segments in all pages are same. When all of the segments in the page clusters are idle, the page clusters can be converted into page clusters of required type to be applied. The present invention realizes the dynamic management of memory spaces and fully utilizes memory resources.
Description
Technical field
The present invention relates to a kind of EMS memory management process, relate in particular to the EMS memory management process in the data communications equipment.
Background technology
In various data communications equipment, memory headroom is divided into multiple burst by different byte numbers, and the length of various bursts is that byte number comprises types such as 32 bytes, 64 bytes, 128 bytes, 256 bytes, 512 bytes, 1024 bytes, 2048 bytes, 4096 bytes.Demand to various types of internal memories in the equipment operation constantly changes.For operations such as the application of carrying out internal memory at high speed, releases, for the mode of taking usually with a kind of application of internal memory to apply in batch, promptly when the compiling of system, determine the number of various bursts, enter operational process after, this number can't dynamically be adjusted according to actual needs.For example, we estimate that by rule of thumb certain equipment generally gets final product for 50,000 of the about needs of the internal fragmentation of 32 bytes, so when system initialization, the memory field that disposable application can be deposited 50,000 32 bytes is used for access.In system's operational process, when needs are applied for the internal memory of 32 bytes, just from then on getting the 32 byte of memory bursts of a slice free time in the memory field uses, if there has not been idle internal fragmentation in the memory field, then system will return application failure prompting, even also have a lot of idle memory headrooms in the memory field of other kind at this moment.Though the EMS memory management process of this fixed allocation realizes easily, in use, can't make full use of the memory source of free time, cause waste.
Summary of the invention
The objective of the invention is to: at deficiency of the prior art, provide a kind of adaptive dynamic memory management method, to the internal memory of various burst types, dynamic assignment according to actual needs in operational process makes full use of memory source.
For achieving the above object, the technical solution used in the present invention is: a kind of adaptive dynamic memory management method, memory headroom is divided the page bunch of different types according to the byte number of various bursts, with the page bunch is that unit distributes from account for a certain proportion of free core of whole memory headroom for application, at least comprise a page in each page bunch, each page energy and can only hold a burst, in same type the page bunch, the byte number of the burst in all pages is identical, when applying for the internal memory of certain byte number, comprise the steps:
A, check in the page bunch of this kind byte number burst type whether idle burst is arranged,, change step e if having; If do not have, continue step B;
B, judge that whether ratio that free core accounts for whole memory headroom is smaller or equal to setting value, if change step D; If not, execution in step C;
C, from free core, mark off the page bunch of a respective type, change step e;
D, from the page of other types bunch, find out all bursts and all be in the idle page bunch, it is changed into the page bunch of required type; Continue step e;
E, from the page bunch, distribute burst.
Because the present invention has adopted above technical scheme, bunch is that unit distributes for application with memory headroom with the page, comprise the page in the page bunch, and each page energy and can only hold a burst, in the actual motion, all bursts in certain type the page bunch are all occupied, and the user is when applying for such burst, just can solve by two kinds of approach: (1) marks off the page bunch of required type, reallocation burst wherein from the memory headroom of free time; (2) from the page of other types bunch, find out wherein each burst and all be in the idle page bunch, change its type, be about to wherein the length of burst and change into required type, distribute again.Because bigger branch leaf length is a integral multiple than its various minutes little leaf length, and each page energy and can only hold a burst, the page bunch is made up of the page again, so various types of page bunch all can be changed mutually.By to the division of the page bunch and conversion mutually, realized the dynamic management of memory headroom, idlely just do not refuse an application as long as have, memory source is fully utilized.
Embodiment
Below in conjunction with embodiment technical scheme of the present invention is described further.
The core of technical solution of the present invention is exactly that memory headroom is made new division, carry out in interval after making the application that the user internally deposits and being released in division, and this new division can be changed dissimilar intervals mutually, so, just needn't reserve fixing quantity to various types of internal memories, be in operation according to the application dynamic assignment.
When applying for the internal memory of certain byte number, comprise the steps:
A, check in the page bunch of this kind byte number burst type whether idle burst is arranged,, change step e if having; If do not have, continue step B;
B, judge that whether ratio that free core accounts for whole memory headroom is smaller or equal to setting value, if change step D; If not, execution in step C;
C, from free core, mark off the page bunch of a respective type, change step e;
D, from the page of other types bunch, find out all bursts and all be in the idle page bunch, it is changed into the page bunch of required type; Continue step e;
E, from the page bunch, distribute burst.
Getting stand-by internal memory and be with the page from free core bunch is unit, and the application internal memory is to be unit with the burst, and whether the effect of steps A is exactly to check when applying for to have burst of the same type not to be applied as yet in respective page bunch at every turn.If have, directly distribute burst; If do not have, just need get such page bunch again.
Get a new page two kinds of approach bunch are arranged, first kind is the page bunch that marks off a respective type from free core, second kind is to find out free page bunch from the page of other types bunch, again it is changed into the page bunch of required type, the so-called type that changes the page bunch, change the type of burst in the page bunch exactly, as a page that comprises 24 512 byte bursts bunch being converted to the page that comprises 6 2048 byte bursts bunch, also can convert thereof into the page that comprises 96 128 byte bursts bunch.In order to reduce the concussion that the page bunch type conversion may cause, in step B, stipulated a condition,, judged that promptly whether free core accounts for the ratio of whole memory headroom smaller or equal to the minimum value of setting as the foundation of selecting above-mentioned two kinds of approach, if select second kind; If not, select first kind.If this ratio is too high, the operation that system carries out the page bunch type conversion can increase, and ratio is too low, then is unfavorable for handling the heavy demand for certain type of burst.According to relatively, the minimum value that free core accounts for whole memory headroom ratio can be set at greater than 10% less than arbitrary numerical value of 15%.
The present invention introduces the page bunch as the unit that divides memory headroom, comprises a page at least in each page bunch, each page energy and can only hold a burst, and in same type the page bunch, the byte number of the burst in all pages is identical.Page quantity in each page bunch can be set arbitrarily, in the practical application, is advisable with 2 to 4.Suppose in the practical application that maximum branch leaf length is 4096 bytes, the page quantity in each page bunch is 3, and the page bunch just can be the type etc. that comprises the type of 6 2048 byte bursts or comprise 12 1024 byte bursts so, and the rest may be inferred.
In use, form that can chained list bunch manages the page, bunch a page bunch head is set for each page and writes down following information:
(1) page bunch type---this page bunch burst type that comprises is as 32 bytes, 64 bytes, 128 bytes etc.;
(2) page number---this page bunch page quantity that comprises;
(3) free pointer---when this page is bunch idle, point to the page bunch head of the next free page bunch of same type.
Can also carry the information that other are used for algorithm controls in the page bunch head.
In enforcement of the present invention, also can adopt the chained list mode manage to the idle burst of same type, idle slice header pointer is set is used in reference to first-in-chain(FIC) to this idle burst chain.Idle burst in the chain belongs to a plurality of different pages bunch, for the ease of free page bunch being reclaimed conversion process, we need do certain restriction to the order of connection of idle burst, promptly to make the idle burst that is arranged in the same page bunch be connected in the section that above chained list links to each other, so can the burst that belong to the same page bunch be identified, be used for when burst is released, with its page under being included into bunch.Again each page bunch is provided for pointing to the head pointer of first burst in this page bunch and is used in reference to the tail pointer of last burst in this page bunch, be used for when burst is released, if the page at this burst place bunch has idle burst, then this burst is added after the tail pointer, and then adjust tail pointer and point to the burst that has just discharged; If no idle burst in the burst place page bunch, then head pointer and the tail pointer with the place page bunch all points to this burst, again with the first-in-chain(FIC) of this burst adding by the idle burst chain of head pointer this kind length pointed.If burst is through after discharging, all bursts all become idle burst in the page at this burst place bunch, and then this page bunch becomes free page bunch.
When carrying out the burst application from the page of a certain type bunch, if idle slice header pointer be empty, burst then that it is pointed is distributed to this application, and with the idle burst of the idle slice header pointed next one; If idle slice header pointer be empty, the page of expression this type bunch is all used, and carries out the distribution of burst in then page of the same type of distribution bunch earlier, and then the from then on new page bunch.
System also can reserve the memory headroom that a part is not used the inventive method, is used for the internal memory application greater than maximum burst is distributed.
Claims (6)
1, a kind of adaptive dynamic memory management method, it is characterized in that: the page bunch of memory headroom being divided different types according to the byte number of various bursts, with the page bunch is that unit distributes from account for a certain proportion of free core of whole memory headroom for application, at least comprise a page in each page bunch, each page energy and can only hold a burst, in same type the page bunch, the byte number of the burst in all pages is identical, when applying for the internal memory of certain byte number, comprise the steps:
A, check in the page bunch of this kind byte number burst type whether idle burst is arranged,, change step e if having; If do not have, continue step B;
B, judge that whether ratio that free core accounts for whole memory headroom is smaller or equal to setting value, if change step D; If not, execution in step C;
C, from free core, mark off the page bunch of a respective type, change step e;
D, from the page of other types bunch, find out all bursts and all be in the idle page bunch, it is changed into the page bunch of required type; Continue step e;
E, from the page bunch, distribute burst.
2, adaptive dynamic memory management method as claimed in claim 1 is characterized in that: the page number that comprises in the described page bunch is 2,3 or 4.
3, adaptive dynamic memory management method as claimed in claim 1 is characterized in that: the setting value that described free core is accounted for whole memory headroom minimum scale is made as greater than 10% less than arbitrary numerical value of 15%.
4, as claim 1,2 or 3 described adaptive dynamic memory management methods, it is characterized in that: the burst that belongs to the same page bunch is identified, be used for when burst is released, the page under it is included into bunch.
5, adaptive dynamic memory management method as claimed in claim 4 is characterized in that: each page bunch is provided for pointing to the head pointer of first burst in this page bunch and is used in reference to the tail pointer of last burst in this page bunch.
6, adaptive dynamic memory management method as claimed in claim 5, it is characterized in that: when burst is released, if the page at this burst place bunch has idle burst, then this burst is added after the described tail pointer, and then adjust tail pointer and point to the burst that has just discharged; If no idle burst in the burst place page bunch, then head pointer and the tail pointer with the place page bunch all points to this burst, again with the first-in-chain(FIC) of this burst adding by the idle burst chain of head pointer this kind length pointed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB011188731A CN1181434C (en) | 2001-06-28 | 2001-06-28 | Adaptive dynamic memory management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB011188731A CN1181434C (en) | 2001-06-28 | 2001-06-28 | Adaptive dynamic memory management method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1393780A CN1393780A (en) | 2003-01-29 |
CN1181434C true CN1181434C (en) | 2004-12-22 |
Family
ID=4663473
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB011188731A Expired - Fee Related CN1181434C (en) | 2001-06-28 | 2001-06-28 | Adaptive dynamic memory management method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1181434C (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1303534C (en) * | 2003-03-03 | 2007-03-07 | 华为技术有限公司 | Memory pool managing method |
CN100343826C (en) * | 2003-04-29 | 2007-10-17 | 华为技术有限公司 | Method for implementing memory management |
CN100365593C (en) * | 2003-06-16 | 2008-01-30 | 华为技术有限公司 | Internal memory managerial approach for computer system |
US7325118B2 (en) * | 2003-09-30 | 2008-01-29 | Samsung Electronics, Co., Ltd. | Method and apparatus for executing dynamic memory management with object-oriented program |
CN1652616B (en) * | 2004-02-07 | 2010-04-14 | 华为技术有限公司 | Adaptive system managing method |
CN100452761C (en) * | 2004-04-27 | 2009-01-14 | 华为技术有限公司 | Method of data packet storage in communication equipment |
CN100359489C (en) * | 2004-07-13 | 2008-01-02 | 中兴通讯股份有限公司 | Method for internal memory allocation in the embedded real-time operation system |
CN1606092B (en) * | 2004-11-11 | 2010-07-28 | 威盛电子股份有限公司 | Method for intercrossed memory space disposition |
CN101281491B (en) * | 2008-05-12 | 2010-04-14 | 北京邮电大学 | Internal memory module of space robot central processing unit based on VxWorks and management method thereof |
CN101286177B (en) * | 2008-05-30 | 2010-06-02 | 中兴通讯股份有限公司 | Method and device for allocating space to file in file allocation table |
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 |
WO2016127291A1 (en) * | 2015-02-09 | 2016-08-18 | 华为技术有限公司 | Memory management device and method |
CN111562983B (en) * | 2020-04-30 | 2023-01-06 | Oppo(重庆)智能科技有限公司 | Memory optimization method and device, electronic equipment and storage medium |
-
2001
- 2001-06-28 CN CNB011188731A patent/CN1181434C/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN1393780A (en) | 2003-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1181434C (en) | Adaptive dynamic memory management method | |
US5864867A (en) | Memory management system of a computer system | |
CN1183453C (en) | Internal storage management system and its distribution method | |
CA2196483C (en) | Method and apparatus for providing enhanced pay per view in a video server | |
US5889956A (en) | Hierarchical resource management with maximum allowable allocation boundaries | |
CN100466602C (en) | Method for dynamically sharing space of memory | |
CA2212316C (en) | A method of recognizing fixed and variable sized data objects in memory | |
US20090006502A1 (en) | Application-Specific Heap Management | |
EP2222004A3 (en) | Dynamic bandwidth allocation circuit, dynamic bandwidth allocation method, dynamic bandwidth allocation program and recording medium | |
CN101320351A (en) | Internal memory distribution, cleaning and releasing method, and internal memory management apparatus | |
CN102193814A (en) | Method and system for dynamically distributing embedded virtual memory | |
CN102455974A (en) | High-speed internal memory application and release management system with controllable internal memory consumption and high-speed internal memory application release management method | |
CN102006226A (en) | Message cache management method and device as well as network equipment | |
CN1303534C (en) | Memory pool managing method | |
CN102968378A (en) | Method, device and system for allocating and releasing memory | |
CN107844372B (en) | Memory allocation method and system | |
US6747990B1 (en) | Packet communication system, network-side apparatus to be used therein, and time slot allocation control method | |
CN110166857A (en) | A kind of implementation method of fibre channel media dynamic configuration | |
CN1751481A (en) | Method for allocating transmission bandwidth in a packet-oriented communications facility | |
CN1307558C (en) | Virtual internal storage allocating and managing method of subsystem in communication system | |
CN1570883A (en) | Dynamic allocation method for non-buffering memory in embedded real-time operating system | |
CN1135749C (en) | Bandwidth allocation method for passive optical network based on ATM | |
CN103929378A (en) | Method and system for allocating communication link for transmitting cross-domain data and method and system for transmitting cross-domain data | |
CN105373337A (en) | Method for managing internal memories in data communication equipment | |
CN1315303C (en) | Dynamic distribution method for slot blandwidth in exchanger |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
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 | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20041222 Termination date: 20110628 |