CN1393780A - Adaptive dynamic memory management method - Google Patents

Adaptive dynamic memory management method Download PDF

Info

Publication number
CN1393780A
CN1393780A CN 01118873 CN01118873A CN1393780A CN 1393780 A CN1393780 A CN 1393780A CN 01118873 CN01118873 CN 01118873 CN 01118873 A CN01118873 A CN 01118873A CN 1393780 A CN1393780 A CN 1393780A
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.)
Granted
Application number
CN 01118873
Other languages
Chinese (zh)
Other versions
CN1181434C (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 CNB011188731A priority Critical patent/CN1181434C/en
Publication of CN1393780A publication Critical patent/CN1393780A/en
Application granted granted Critical
Publication of CN1181434C publication Critical patent/CN1181434C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

A self-adaptive dynamic memory management method is disclosed. The idle space in memory is divided into page clusters to be requested. Each page cluster contains pages. The length of each page can contain a fragment with maximal number of bytes. For the same type of page cluster. The number of bytes are the same for the fragments in all pages. When all the fragments in a page cluster are idle, the page cluster can be relocated.

Description

Adaptive dynamic memory management method
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.
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.
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, the length of each page can be held the burst of a byte number maximum, 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 the length of each page can be held the burst of a byte number maximum, 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 the length of each page can be held the burst of a byte number maximum, 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.
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 unit as the division memory headroom, at least comprise a page in each page bunch, the length of each page can be held the burst of a byte number maximum, 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, the length of each page can be held the burst of a byte number maximum, 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.
CNB011188731A 2001-06-28 2001-06-28 Adaptive dynamic memory management method Expired - Fee Related CN1181434C (en)

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 true CN1393780A (en) 2003-01-29
CN1181434C 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)

Cited By (13)

* Cited by examiner, † Cited by third party
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
CN100359489C (en) * 2004-07-13 2008-01-02 中兴通讯股份有限公司 Method for internal memory allocation in the embedded real-time operation 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
CN100365593C (en) * 2003-06-16 2008-01-30 华为技术有限公司 Internal memory managerial approach for computer system
CN100452761C (en) * 2004-04-27 2009-01-14 华为技术有限公司 Method of data packet storage in communication equipment
CN101281491B (en) * 2008-05-12 2010-04-14 北京邮电大学 Internal memory module of space robot central processing unit based on VxWorks and management method thereof
CN1652616B (en) * 2004-02-07 2010-04-14 华为技术有限公司 Adaptive system managing method
CN101286177B (en) * 2008-05-30 2010-06-02 中兴通讯股份有限公司 Method and device for allocating space to file in file allocation table
CN1606092B (en) * 2004-11-11 2010-07-28 威盛电子股份有限公司 Method for intercrossed memory space disposition
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
CN107209716A (en) * 2015-02-09 2017-09-26 华为技术有限公司 Memory management apparatus and method
CN111562983A (en) * 2020-04-30 2020-08-21 Oppo(重庆)智能科技有限公司 Memory optimization method and device, electronic equipment and storage medium

Cited By (17)

* Cited by examiner, † Cited by third party
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
CN100386745C (en) * 2003-09-30 2008-05-07 三星电子株式会社 Method and apparatus for dynamic memory management within an object-oriented program
US7624247B2 (en) 2003-09-30 2009-11-24 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
CN107209716A (en) * 2015-02-09 2017-09-26 华为技术有限公司 Memory management apparatus and method
CN107209716B (en) * 2015-02-09 2020-04-21 华为技术有限公司 Memory management device and method
CN111562983A (en) * 2020-04-30 2020-08-21 Oppo(重庆)智能科技有限公司 Memory optimization method and device, electronic equipment and storage medium
CN111562983B (en) * 2020-04-30 2023-01-06 Oppo(重庆)智能科技有限公司 Memory optimization method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN1181434C (en) 2004-12-22

Similar Documents

Publication Publication Date Title
CN1181434C (en) Adaptive dynamic memory management method
US6757802B2 (en) Method for memory heap and buddy system management for service aware networks
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
CN100466602C (en) Method for dynamically sharing space of memory
CN102880705B (en) Database key generating apparatus and database key generation method
DE102006019839A1 (en) Time-conscious systems
CN101414281A (en) Internal memory management method and system
CN102968378A (en) Method, device and system for allocating and releasing memory
US6131150A (en) Scaled memory allocation system
CN102006226A (en) Message cache management method and device as well as network equipment
CN102075425A (en) Business allocation method and load balancer
KR880002099B1 (en) Memory control system
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
CA2419749C (en) Bandwidth allocation method in point-to-multipoint communication system
CN1307558C (en) Virtual internal storage allocating and managing method of subsystem in communication system
US6851027B2 (en) Memory system organized into blocks of different sizes and allocation method therefor
CN1135749C (en) Bandwidth allocation method for passive optical network based on ATM
CN105373337A (en) Method for managing internal memories in data communication equipment
CN1315303C (en) Dynamic distribution method for slot blandwidth in exchanger
CN103929378A (en) Method and system for allocating communication link for transmitting cross-domain data and method and system for transmitting cross-domain data
CN113568891A (en) Distributed ID generation method, device, server and readable storage medium
CN101515833B (en) Method and device for realizing protection rearrangement
CA2622843A1 (en) System and method for dynamic memory allocation

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