CN100417077C - Method for storage area management with static and dynamic joint - Google Patents

Method for storage area management with static and dynamic joint Download PDF

Info

Publication number
CN100417077C
CN100417077C CNB021374244A CN02137424A CN100417077C CN 100417077 C CN100417077 C CN 100417077C CN B021374244 A CNB021374244 A CN B021374244A CN 02137424 A CN02137424 A CN 02137424A CN 100417077 C CN100417077 C CN 100417077C
Authority
CN
China
Prior art keywords
memory block
dynamic
size
static
idle queues
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 - Lifetime
Application number
CNB021374244A
Other languages
Chinese (zh)
Other versions
CN1489334A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNB021374244A priority Critical patent/CN100417077C/en
Publication of CN1489334A publication Critical patent/CN1489334A/en
Application granted granted Critical
Publication of CN100417077C publication Critical patent/CN100417077C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Memory System (AREA)

Abstract

The present invention discloses a method for storage area management with static and dynamic joint. A storage area is divide into two large divisions, wherein one division is divided into static storage blocks which are preliminarily defined into several kinds of dimensions, and certain number of storage blocks are configured for each kind of dimension; splitting and merging the storage blocks can not be carried out during operation; the other division is a shared dynamic memory area and is used for allocating the dynamic state. The storage blocks ensuring various dimensions have definite minimal number, which ensures the basic application and simultaneously can make full use of limited resources of the storage area. The present invention ensures the service efficiency and the utilization ratio of the storage area, relieves the contradiction of the strained storage area and low service efficiency and avoids complicated use and maintenance. The present invention can be applied to the management of various memories, data sheets and periphery storage areas and can simultaneously manage various and/or a plurality of storage areas.

Description

The method of the storage area management of the dynamic combination of a kind of static state
Technical field:
The present invention relates to a kind of management method of memory block, relate in particular in the embedded real time system, be specially adapted to that the space, memory block is limited, improve the efficiency of management and the memory block utilance of memory block in the demanding system of real-time the management of various memory blocks.
Background technology:
Dynamic management approach is adopted in the memory management of computer system usually, splits out the memory block that needs size during storage allocation from the memory field, if adjacent space also is the idle merge memory piece of wanting when giving back, and is multistage fractionation and merging of needs often.This method is used flexibly, and can have more needs to obtain the memory block of size arbitrarily, the memory usage height, but owing to need to split and the merge memory piece continually, efficient is lower, may cause the internal memory shake, and cause memory fragmentation easily, reduces its utilance.
Other has a kind of internal fragmentation management method, the memory block number of pre-configured several sizes, during system initialization according to configuration, the various sizes internal memory that distributes specific quantity, be placed on respectively in the idle queues of size separately, from respective queue, get a use during use, be returned in the former formation after using up.This method simple and stable, efficient height.But it exists some significantly not enough:
One, memory usage is very low, can only be allocated in the internal memory of several sizes of existing configuration, if when application corresponding size internal memory used up then returned failure, even the memory block of other size also has a lot of idle also applying for less than required internal memory.
Two, need appropriately to configure in advance the number of various sizes internal memory, and the different configuration of product, different applied environments, Installed System Memory user demand situation is widely different, need carefully to investigate in advance, analyze user demand, otherwise the unreasonable mistake that just causes the Memory Allocation failure easily of the data of configuration, traffic affecting normally moves.
Three, usually cause providing different editions to the different configuration parameter of different user, be not easy to O﹠M.
Memory management needs stability and high efficiency in the embedded real time system, needs high utilance.First method, more obvious for its poor efficiency of embedded real time system, be not suitable for using demand to efficient.Memory fragmentation be created in the utilance that can reduce internal memory in the embedded system greatly, the internal memory that causes applying for large-size is failed easily.Simultaneously, some abnormal application also may occur the memory block is exhausted, cause some other basic application can't be assigned to essential memory block, cause system to turn round.
The poor efficiency of second method is obvious especially in the limited embedded system of memory headroom, and configuration has the improper memory failure that causes easily applying for slightly, causes the system configuration complexity, uses, safeguards inconvenient.
These two kinds of methods are applicable to DRAM (dynamic random access memory) and so on read-write memory block all at the management of heap memory, are not suitable for the management in other type stores district, such as the data form of non-internal memory, the management of memory space.
Summary of the invention:
The present invention proposes the method for the storage area management of the dynamic combination of a kind of static state, overcome the shortcoming of utilance and efficient contradiction in the prior art, realized not only guaranteed efficiency but also increase operation rate, and the memory area management method of stable and reliable operation.
The method of the storage area management of the dynamic combination of static state of the present invention is as follows:
The first step is registered the memory block that needs management, comprises initial address, memory block size, registers and successfully then provides a numbering;
In second step, configuration management system is used the memory block size category possibly when configuration-system uses the memory block, give every kind of dimensional configurations reserved block of storage number, as the static storage piece of every kind of size reservation;
In the 3rd step, memory block is divided to various sizes respectively according to the static storage piece number of above-mentioned every kind of size in the initialization static storage area, the memory block that marks off is placed in the static idle queues of corresponding size;
The 4th step, the initialization dynamic area, remaining memory block is divided according to full-size, put into the dynamic idle queues of corresponding size, the remaining remnant is divided according to a less size, have and odd divide according to littler size again, finish or not enough minimum dimension and abandoning until whole divisions, the memory block that marks off is put into the dynamic idle queues of corresponding size;
In the 5th step, application is during memory block, earlier in the static storage area application, if there is not the suitable dynamic area application memory block that arrive again, if there is not the free memory blocks of corresponding size this moment, need split the back use to the memory block of large-size;
The 6th step, when giving back memory block, if from the static zones application then be returned to static zones, if from the dynamic area application then be returned to dynamic area, if the adjacent or right adjacent memory block in its left side is dynamically arranged in the idle queues this moment then will merge memory block.
Adopt the method for the invention, owing to taked the static technical measures that combine with dynamic management approach, compared with prior art, guaranteed service efficiency and memory block utilance, alleviate memory block anxiety, contradiction that service efficiency is low, avoided complicated working service.The present invention has adopted static and the way to manage that dynamically combines, and with administration overhead and distinguished by managed storage, expands the scope of application to various internal memories, data form, Peripheral storage district management, can manage multiple and/or a plurality of memory blocks simultaneously.
The present invention is divided into the two large divisions with the memory block, and a part is divided into static memory block, also is pre-defined some kinds of sizes, and each size all disposes some, is in operation can not split and merge.Another part is the dynamic area of sharing, and is used for distributing dynamically.The memory block that guarantees various sizes so all has certain minimum number, to guarantee the most basic application, can make full use of limited memory block resource simultaneously again.
Description of drawings:
Fig. 1 is the initialization flowchart of static management part of the present invention.
Fig. 2 is a dynamic management partially-initialized flow chart of the present invention.
Fig. 3 is an allocate storage flow chart of the present invention.
Fig. 4 is that the present invention gives back the memory block flow chart.
Embodiment:
Introduce the memory area management method of the dynamic combination of static state of the present invention in detail below in conjunction with accompanying drawing.
One, memory block registration can the pre-configured maximum number of management storage region simultaneously, only need provide during registration by the initial address of management storage region and size, register and successfully return a numbering, need provide this numbering when needing later on this memory block managed.
The memory area management method of different registration numbers is identical, still with different administration queue and resource.
Two, configuration management system will be used the memory block size category when using for this memory area configuration, gives every kind of dimensional configurations reserved block of storage number, as the static storage piece of each size reservation.
Three, the initialization of static management part, as flow process as shown in Figure 1, mark off the memory block that specifies number for successively every kind of size according to configuration earlier, be placed in the static idle queues of corresponding size, the corresponding idle queues of every kind of size is used for depositing the static part free memory blocks of this size.
Four, the initialization of dynamic management part, shown in Figure 2 as flow process, remaining memory block is divided according to full-size earlier, the memory block that marks off is put into the dynamic idle queues of full-size correspondence, and the remaining remnant is divided according to a less size, is divided according to littler size by the remnant more again, finish or not enough minimum dimension and abandoning until whole divisions, the memory block that marks off is put into the dynamic idle queues of corresponding size.
Every kind of size all comprises static idle queues, dynamic idle queues, and a static use formation and dynamically use formation are arranged in addition.
Five, the application memory block as shown in Figure 3, comprises following a few step:
Whether 1, checking earlier has idle memory block in the static idle queues of corresponding size, just takes out the static state that adds corresponding size and uses formation to return if having, otherwise carry out next step.
2, whether idle memory block is arranged in the dynamic idle queues of corresponding size, if there is the dynamic use formation of just taking out the adding corresponding size to return, otherwise carry out next step.
Whether 3, searching larger sized dynamic idle queues has free memory blocks, does not search more a larger size dynamic idle queues if just proceed to, and enters next step until finding just to take out, if do not find then return the not enough mistake in space, memory block.
4, the memory block of taking out is split, if split the size that does not once obtain needs, one that then will newly split out is continued to split, the idle dynamic queue that puts into corresponding size in addition, up to the memory block that splits out appropriate size, taking-up is returned, and remaining then joins in the dynamic idle queues of corresponding size.Split consolidation strategy and can adopt buddy (partner) system.
Six, give back memory block, as shown in Figure 4, comprise following a few step:
1, check earlier and whether use in the formation, be then to take out, join in the static idle queues of corresponding size, return, otherwise enter next step in static state.
2, check whether dynamically using in the formation, be then to take out, checking whether dynamic idle queues exists the left side neighbour and/or the right neighbour of this memory block, is then to take out the memory block that is merged into large-size, checks in dynamic idle queues that the left side neighbour and/or the right side that more whether have the merging memory block are adjacent, be then to take out merging, until there not being a left side adjacent and right adjacent, the memory block that merges is joined in the dynamic idle queues of corresponding size, return.If the memory block of giving back neither belongs to the static formation of using, do not belong to dynamic use formation yet, then return mistake.
For adapt to needs only use the static management method or only needs use the situation of dynamic management approach, provide two predefined grand, expression is used the static management mode and is used the dynamic management mode respectively, if only define one of them, corresponding a kind of management method is only used in expression, if two grand has all defined, then use the static management method that dynamically combines.
Above step be to describe at the method for the dynamic combination of static state, only need define grandly accordingly when using single management method if desired, the content of another management method can compilation run.

Claims (3)

1. the method for the storage area management of the dynamic combination of static state is characterized in that, may further comprise the steps:
The first step is registered the memory block that needs management, comprises initial address, memory block size, registers and successfully then provides a numbering;
In second step, configuration management system will be used the memory block size category when configuration-system uses the memory block, gives every kind of dimensional configurations reserved block of storage number, as the static storage piece of every kind of size reservation;
In the 3rd step, memory block is divided to various sizes respectively according to the static storage piece number of above-mentioned every kind of size in the initialization static storage area, the memory block that marks off is placed in the static idle queues of corresponding size;
The 4th step, the initialization dynamic area, remaining memory block is divided according to full-size, put into the dynamic idle queues of corresponding size, the remaining remnant is divided according to a less size, have and odd divide according to littler size again, finish or not enough minimum dimension and abandoning until whole divisions, the memory block that marks off is put into the dynamic idle queues of corresponding size;
In the 5th step, application is during memory block, earlier in the static storage area application, if there is not the suitable dynamic area application memory block that arrive again, if there is not the free memory blocks of corresponding size this moment, need split the back use to the memory block of large-size;
The 6th step, when giving back memory block, if from the static zones application then be returned to static zones, if from the dynamic area application then be returned to dynamic area, if the adjacent or right adjacent memory block in its left side is dynamically arranged in the idle queues this moment then will merge memory block.
2. the method for the storage area management of the dynamic combination of static state according to claim 1 is characterized in that, described step 5 specifically may further comprise the steps:
1) checks earlier whether idle memory block is arranged in the static idle queues of corresponding size, just take out the static state that adds corresponding size and use formation to return if having, otherwise carry out next step;
2) whether idle memory block is arranged in the dynamic idle queues of corresponding size,, otherwise carry out next step if there is the dynamic use formation of just taking out the adding corresponding size to return;
Whether have free memory blocks, do not search more a larger size dynamic idle queues if just proceed to if 3) searching larger sized dynamic idle queues, enter next step until finding just to take out, if do not find then return the not enough mistake in space, memory block;
4) memory block of taking out is split, if split the size that does not once obtain needs, one that then will newly split out is continued to split, the idle dynamic queue that puts into corresponding size in addition, up to the memory block that splits out appropriate size, taking-up is returned, and remaining then joins in the dynamic idle queues of corresponding size.
3. the method for the storage area management of the dynamic combination of static state according to claim 1 and 2 is characterized in that, described step 6 specifically may further comprise the steps:
1) checks whether use in the formation, be then to take out, join in the static idle queues of corresponding size, return, otherwise enter next step earlier in static state;
2) check whether dynamically using in the formation, be then to take out, check whether dynamic idle queues exists the left side of this memory block adjacent and/or right adjacent, be then to take out the memory block that is merged into large-size, dynamically checking that a left side that whether has the merging memory block is adjacent and/or right adjacent in the idle queues again, is then to take out merging, left adjacent and right adjacent until not having, the memory block that merges is joined in the dynamic idle queues of corresponding size, return; If the memory block of giving back neither belongs to the static formation of using, do not belong to dynamic use formation yet, then return mistake.
CNB021374244A 2002-10-11 2002-10-11 Method for storage area management with static and dynamic joint Expired - Lifetime CN100417077C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB021374244A CN100417077C (en) 2002-10-11 2002-10-11 Method for storage area management with static and dynamic joint

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB021374244A CN100417077C (en) 2002-10-11 2002-10-11 Method for storage area management with static and dynamic joint

Publications (2)

Publication Number Publication Date
CN1489334A CN1489334A (en) 2004-04-14
CN100417077C true CN100417077C (en) 2008-09-03

Family

ID=34147011

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB021374244A Expired - Lifetime CN100417077C (en) 2002-10-11 2002-10-11 Method for storage area management with static and dynamic joint

Country Status (1)

Country Link
CN (1) CN100417077C (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100412800C (en) * 2004-12-25 2008-08-20 鸿富锦精密工业(深圳)有限公司 System and method in use for managing memory of networked server
CN100461120C (en) * 2006-05-16 2009-02-11 中兴通讯股份有限公司 Method for managing field data-protection memory
CN102096638B (en) * 2010-11-25 2013-05-29 意法·爱立信半导体(北京)有限公司 Allocation method and device of static storage
CN104516929B (en) 2013-09-27 2019-07-19 伊姆西公司 Method and apparatus for file system
CN107665146B (en) * 2016-07-29 2020-07-07 华为技术有限公司 Memory management device and method
US9971510B2 (en) 2016-10-16 2018-05-15 Mediatek Inc. Method for managing memory and associated microcontroller
CN107003892B (en) * 2016-12-29 2021-10-08 深圳前海达闼云端智能科技有限公司 GPU virtualization method, device and system, electronic equipment and computer program product
CN106844046B (en) * 2016-12-31 2021-06-11 北京市腾河智慧能源科技有限公司 Broadband carrier memory management method
CN114116222A (en) * 2021-11-30 2022-03-01 翱捷智能科技(上海)有限公司 Method and device for dynamically planning memory layout during startup of embedded system
CN115858184B (en) * 2023-03-03 2023-05-02 浪潮电子信息产业股份有限公司 RDMA memory management method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1193776A (en) * 1997-03-13 1998-09-23 国际商业机器公司 Intelligent media memory statically mapped in unified memory architecture
CN1205477A (en) * 1998-07-16 1999-01-20 英业达股份有限公司 Memory substitution method and its device
US6151664A (en) * 1999-06-09 2000-11-21 International Business Machines Corporation Programmable SRAM and DRAM cache interface with preset access priorities
US6260101B1 (en) * 1997-03-07 2001-07-10 Advanced Micro Devices, Inc. Microcontroller having dedicated hardware for memory address space expansion supporting both static and dynamic memory devices

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6260101B1 (en) * 1997-03-07 2001-07-10 Advanced Micro Devices, Inc. Microcontroller having dedicated hardware for memory address space expansion supporting both static and dynamic memory devices
CN1193776A (en) * 1997-03-13 1998-09-23 国际商业机器公司 Intelligent media memory statically mapped in unified memory architecture
CN1205477A (en) * 1998-07-16 1999-01-20 英业达股份有限公司 Memory substitution method and its device
US6151664A (en) * 1999-06-09 2000-11-21 International Business Machines Corporation Programmable SRAM and DRAM cache interface with preset access priorities

Also Published As

Publication number Publication date
CN1489334A (en) 2004-04-14

Similar Documents

Publication Publication Date Title
CN101221536B (en) Internal memory managing method and device of embedded system
CN100382048C (en) A managing method for EMS memory
CN100417077C (en) Method for storage area management with static and dynamic joint
CN101799797B (en) Dynamic allocation method of user disk quota in distributed storage system
CN105677597A (en) Data writing method and device
CN102193814A (en) Method and system for dynamically distributing embedded virtual memory
CN101226553A (en) Method and device for storing length-various field of embedded database
CN102024008A (en) Limitation method of Web server concurrent number
CN103988186A (en) Memory system, memory module, memory module access method and computer system
CN105701019A (en) Memory management method and memory management device
CN102025550A (en) System and method for managing data in distributed cluster
CN1427342A (en) Internal storage management system and its distribution method
CN104731799A (en) Memory database management device
CN104850505B (en) The EMS memory management process and system stacked based on chain type
CN103412884A (en) Method for managing embedded database in isomerism storage media
CN112685333B (en) Heap memory management method and device
CN103218305A (en) Distribution method of memory space
CN103389945B (en) Memory management method and device
CN106557427A (en) The EMS memory management process and device of shared drive data base
CN103455433A (en) Memory management method and system
CN105677761A (en) Data sharding method and system
CN103425435A (en) Disk storage method and disk storage system
US5640597A (en) Method and apparatus for servicing simultaneously a plurality of requests for data streams
CN105469173A (en) Method of optimal management on static memory
CN106855845A (en) The Memory Allocation management system and embedded chip of heap space

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
CX01 Expiry of patent term

Granted publication date: 20080903

CX01 Expiry of patent term