CN1567249A - Internal memory managerial approach for computer system - Google Patents

Internal memory managerial approach for computer system Download PDF

Info

Publication number
CN1567249A
CN1567249A CN 03148892 CN03148892A CN1567249A CN 1567249 A CN1567249 A CN 1567249A CN 03148892 CN03148892 CN 03148892 CN 03148892 A CN03148892 A CN 03148892A CN 1567249 A CN1567249 A CN 1567249A
Authority
CN
China
Prior art keywords
memory
memory block
block
index
piece
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 03148892
Other languages
Chinese (zh)
Other versions
CN100365593C (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 CNB031488927A priority Critical patent/CN100365593C/en
Publication of CN1567249A publication Critical patent/CN1567249A/en
Application granted granted Critical
Publication of CN100365593C publication Critical patent/CN100365593C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

This invention discloses a kind of memory management method of computer system. It enables the application to manage its memory better, and reduces the possible bad result caused by the wrong modification of memory. The memory management method comprises: A. the application creates memory pool, which can be divided to memory pool control region that stores the control information of memory pool; memory block storing region that places data; and memory usage marking chain that labels the using state of each section memory and the index of next available memory block. B. the application applies for the memory block in memory block storing region of memory pool and changes the information in memory usage marking chain according to the control information in memory pool control region. C. the application releases the memory block of memory block storing region to the memory pool and changes the information in memory usage marking chain according to the control information in memory pool control region.

Description

The EMS memory management process of computer system
Technical field
The present invention relates to the management method of calculator memory, particularly be independent of the calculator memory management method of operating system.
Background technology
Memory management is an important process in the computer system, and generally speaking, memory management is finished by operating system, application program need internal memory the time marquis to the operating system application, discharge to operating system after using up.But in some special applications, particularly very high field to reliability requirement, for example in the real-time application system based on embedded chip, the catastrophic effect that produces because the application internal memory is not being met in order to prevent, the maximum memory that often adopts first to file to use is then by the method for the own managing internal memory of application program.The application program a kind of common way of managing internal memory voluntarily is that internal memory is divided into the identical memory block of some sizes, connects each memory block with chained list then, deposits the control information of this memory block at the head of each memory block.In this technology, in case the operation that the application program mistake is write internal memory takes place, tend to the control information of covering memory piece, might cause comprising the serious consequence of system crash.
Cause a main cause of this situation to be, the control information of memory block and deposit for the memory block of application layer continuously.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of EMS memory management process of computer system, makes application program manage the internal memory of oneself better, and reduce since internal memory by the disastrous effect of rewriting mistakenly and may cause.
In order to solve the problems of the technologies described above, in the EMS memory management process of the bright computer system that provides of we, comprise following steps:
The A application program is created memory pool, described memory pool comprise the control information that is used for the stored memory pond the memory pool control domain, be used to place the memory block memory block of data and be used to indicate the user mode of each piece internal memory and the internal memory usage flag chain of the index of next free memory piece;
The B application program is according to the control information in the memory pool control domain, the memory block in memory pool application memory block memory block, and revise information in the internal memory usage flag chain;
The C application program is according to the control information in the memory pool control domain, the memory block in memory pool releasing memory piece memory block, and revise information in the internal memory usage flag chain.
Wherein, the control information of described memory pool comprises total number, the index of current available internal memory piece, current available internal memory piece number, the first address of memory block memory block and the first address of internal memory usage flag chain of memory block in the size, memory block memory block of each memory block in the memory pool.
Described memory block memory block is made up of the big or small identical memory block of predetermined quantity.
Described internal memory usage flag chain is made of an array, and each element of array comprises two parts, indicates the status indication of corresponding memory block and the index of next free memory piece respectively.
The status indication of described memory block has two states: used state and idle condition.
Described steps A also comprises following steps:
The A1 application program is created the memory pool control domain;
The A2 application program is created the memory block memory block;
The A3 application program is created internal memory usage flag chain, wherein, the status indication of the memory block in the internal memory usage flag chain is changed to idle condition; The index of the next free memory in the internal memory usage flag chain is changed to the index of next memory block in the memory block memory block;
The A4 application program is filled in the control information of described memory pool control domain, wherein, the index of first memory block of memory block memory block filled out in the index of current available internal memory piece, and the first address that current available internal memory piece number is filled in the first address of total number, memory block memory block of memory block in the memory block memory block and internal memory usage flag chain is filled in the memory address of respective regions.
Described step B also comprises following steps:
The B1 application program judges whether free memory piece in addition according to the current available internal memory piece number in the described memory pool control domain, if do not have, directly returns invalid value, and process ends if having, enters step B2;
The B2 computer system returns to application program with the index of the current available internal memory piece in the described memory pool control domain, described application program is arranged to use state with the status indication of this memory block, simultaneously the index of current available internal memory piece is arranged to the index of the next free memory piece of this memory block, is entered step B3;
The described application program of B3 subtracts one with the current available internal memory piece number in the memory pool control domain.
Described step C also comprises following steps:
The usage flag of memory block in internal memory usage flag chain that the C1 application program will need to discharge is arranged to idle condition, the index of the current available internal memory piece in the memory pool control domain be arranged in the index of the next free memory piece of this memory block, and the index of current available internal memory piece in the memory pool control domain need be arranged to the index of the memory block that discharges;
The C2 application program adds one to the current available internal memory piece number in the memory pool control domain.
In addition, described computer system is based on the real-time application system of embedded chip.
By relatively finding that technical scheme difference with the prior art of the present invention is, memory pool is divided into memory pool control domain, memory block memory block and the internal memory usage flag chain of separate, stored separately.Wherein this internal memory usage flag chain indicates the user mode of each piece internal memory and the index of next free memory piece.
Difference on this technical scheme, brought comparatively significantly beneficial effect, promptly because the memory block memory block of storage data is independent of the memory pool control domain and the internal memory usage flag chain of storage control information, therefore when mistake is write internal memory, influence only limits in the scope of memory block memory block, seldom can have influence on the memory pool control domain and the internal memory usage flag chain of storage control information, so the present invention makes mistake write the harm that internal memory operation may cause to alleviate greatly.In addition, the present invention is independent of operating system, has good portability.
Description of drawings
Fig. 1 is the process flow diagram that application program is created memory pool in one embodiment of the present of invention.
Fig. 2 be in one embodiment of the present of invention application program to the process flow diagram of memory pool application internal memory.
Fig. 3 is the process flow diagram of application program releasing memory in one embodiment of the present of invention.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with accompanying drawing.
In the computer system memory management method that the present invention proposes, memory pool is divided into memory pool control domain, memory block memory block and internal memory usage flag chain.
Wherein, the control information in the main stored memory of memory pool control domain pond.The control information of memory pool comprises total number, the index of current available internal memory piece, current available internal memory piece number, the first address of memory block memory block and the first address of internal memory usage flag chain of memory block in the size, memory block memory block of each memory block in the memory pool.
The memory block memory block is made up of the big or small identical memory block of predetermined quantity, is used to place data message in the memory block.The size of memory block and total number information all leave in the memory pool control domain.
Internal memory usage flag chain is made of an array, the number of the number of element and memory block is identical in the described array, in the described array each element respectively with the memory block memory block in each memory block corresponding one by one, each element of array comprises two parts, i.e. the index of the status indication of corresponding memory block and next free memory piece.The status indication of described memory block is used for indicating the operating position of corresponding memory block, two states is arranged: used state and idle condition.
It should be noted that in the present embodiment above-mentioned three parts of memory pool can be used different physical memory zones, keep continuously, can use and define arrays or apply for that dynamically the method for bulk memory realizes but each several part is inner.
This shows, in the present invention, because the memory block memory block of storage data is independent of the memory pool control domain and the internal memory usage flag chain of storage control information, therefore just in case the operation that mistake is write internal memory takes place, only limit in most cases in the scope of memory block memory block, seldom can have influence on the memory pool control domain and the internal memory usage flag chain of storage control information, mistake is write the harm that internal memory operation may cause and is alleviated greatly.
EMS memory management process provided by the invention comprises creates memory pool, application internal memory and three steps of releasing memory.With reference to the accompanying drawings, these three steps are described in detail and explain.
At first the process that application program is created memory pool is described with reference to Fig. 1.
As shown in Figure 1, in step 101, application program is created the memory pool control domain.Because the size of memory pool control domain required memory is fixed, so directly get final product for its application fixed size internal memory.
In step 102, application program is created the memory block memory block.The size of this memory block memory block required memory is by the product decision of the size and the total number of memory block of each memory block in the memory pool.
In step 103, application program is created internal memory usage flag chain.The size of this internal memory usage flag chain required memory is determined by the total number of described memory block.After applying for successfully, the status indication of the memory block in the internal memory usage flag chain is changed to idle condition.The index of the next free memory in the internal memory usage flag chain is changed to the index of next memory block in the memory block memory block, to form a single-track link table.
In step 104, application program is filled in the control information of memory pool control domain.Wherein, in the memory pool in the size of each memory block and the memory block memory block total number of memory block know in advance, the index of first memory block of memory block memory block filled out in the index of current available internal memory piece, and the first address that current available internal memory piece number is filled in the first address of total number, memory block memory block of memory block in the memory block memory block and internal memory usage flag chain is filled in the memory address of respective regions.
It is to be noted, total number of the size of each memory block and memory block provides in advance according to the needs of application program in the memory pool, generally in real-time application, for fear of the time application of needing internal memory less than and the abnormal conditions that cause can be set at the sum of memory block the maximal value that application program may need.
Below with reference to Fig. 2 the process of application program to memory pool application internal memory described.
As shown in Figure 2, in step 201, application program determines whether free memory piece in addition according to the current available internal memory piece number in the memory pool control domain.If no, directly return invalid value, process ends; If have, enter step 202.
In step 202, application program is obtained the index of the current available internal memory piece in the memory pool control domain, the status indication of this memory block is arranged to use state, simultaneously the index of current available internal memory piece is arranged to the index of the next free memory piece of this memory block, is entered step 203 then.
In step 203, application program subtracts the current available internal memory piece number in the memory pool control domain
It is pointed out that application program can calculate the memory address of gained memory block according to the first address of memory block index that obtains and memory block memory block, uses then.
The process of application program releasing memory is described below with reference to Fig. 3.
As shown in Figure 3, in step 301, in internal memory usage flag chain, the usage flag of memory block in internal memory usage flag chain that application program will need earlier to discharge is arranged to idle condition, again the index of the next free memory piece of this memory block is arranged to the index of the current available internal memory piece in the memory pool control domain, then the index of current available internal memory piece in the memory pool control domain need is arranged to the index of the memory block that discharges.
In step 302, application program subtracts one to the current available internal memory piece number in the memory pool control domain.
It is pointed out that this method is particularly useful for the real-time application system based on embedded chip.
Though by reference some preferred embodiment of the present invention, the present invention is illustrated and describes, but those of ordinary skill in the art should be understood that, can do various changes to it in the form and details, and the spirit and scope of the present invention that do not depart from appended claims and limited.

Claims (9)

1. the EMS memory management process of a computer system is characterized in that, described method comprises following steps:
The A application program is created memory pool, described memory pool comprise the control information that is used for the stored memory pond the memory pool control domain, be used to place the memory block memory block of data and be used to indicate the user mode of each piece internal memory and the internal memory usage flag chain of the index of next free memory piece;
The B application program is according to the control information in the memory pool control domain, the memory block in memory pool application memory block memory block, and revise information in the internal memory usage flag chain;
The C application program is according to the control information in the memory pool control domain, the memory block in memory pool releasing memory piece memory block, and revise information in the internal memory usage flag chain.
2. the EMS memory management process of computer system according to claim 1, it is characterized in that the control information of described memory pool comprises total number, the index of current available internal memory piece, current available internal memory piece number, the first address of memory block memory block and the first address of internal memory usage flag chain of memory block in the size, memory block memory block of each memory block in the memory pool.
3. the EMS memory management process of computer system according to claim 2 is characterized in that, described memory block memory block is made up of the big or small identical memory block of predetermined quantity.
4. the EMS memory management process of computer system according to claim 3, it is characterized in that, described internal memory usage flag chain is made of an array, each element of described array comprises two parts, indicate the status indication of corresponding memory block and the index of next free memory piece respectively.
5. the EMS memory management process of computer system according to claim 4 is characterized in that, the status indication of described memory block has two states: used state and idle condition.
6. the EMS memory management process of computer system according to claim 4 is characterized in that, described steps A also comprises following steps:
The A1 application program is created the memory pool control domain;
The A2 application program is created the memory block memory block;
The A3 application program is created internal memory usage flag chain, wherein, the status indication of the memory block in the internal memory usage flag chain is changed to idle condition; The index of the next free memory in the internal memory usage flag chain is changed to the index of next memory block in the memory block memory block;
The A4 application program is filled in the control information of described memory pool control domain, wherein, the index of first memory block of memory block memory block filled out in the index of current available internal memory piece, and the first address that current available internal memory piece number is filled in the first address of total number, memory block memory block of memory block in the memory block memory block and internal memory usage flag chain is filled in the memory address of respective regions.
7. the EMS memory management process of computer system according to claim 4 is characterized in that, described step B also comprises following steps:
The B1 application program judges whether free memory piece in addition according to the current available internal memory piece number in the described memory pool control domain, if do not have, directly returns invalid value, and process ends if having, enters step B2;
The B2 computer system returns to application program with the index of the current available internal memory piece in the described memory pool control domain, described application program is arranged to use state with the status indication of this memory block, simultaneously the index of current available internal memory piece is arranged to the index of the next free memory piece of this memory block, is entered step B3;
The described application program of B3 subtracts one with the current available internal memory piece number in the memory pool control domain.
8. the EMS memory management process of computer system according to claim 4 is characterized in that, described step C also comprises following steps:
The usage flag of memory block in internal memory usage flag chain that the C1 application program will need to discharge is arranged to idle condition, the index of the current available internal memory piece in the memory pool control domain be arranged in the index of the next free memory piece of this memory block, and the index of current available internal memory piece in the memory pool control domain need be arranged to the index of the memory block that discharges;
The C2 application program adds one to the current available internal memory piece number in the memory pool control domain.
9. according to the EMS memory management process of arbitrary described computer system of claim 1 to 8, it is characterized in that described computer system is based on the real-time application system of embedded chip.
CNB031488927A 2003-06-16 2003-06-16 Internal memory managerial approach for computer system Expired - Fee Related CN100365593C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB031488927A CN100365593C (en) 2003-06-16 2003-06-16 Internal memory managerial approach for computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB031488927A CN100365593C (en) 2003-06-16 2003-06-16 Internal memory managerial approach for computer system

Publications (2)

Publication Number Publication Date
CN1567249A true CN1567249A (en) 2005-01-19
CN100365593C CN100365593C (en) 2008-01-30

Family

ID=34472407

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB031488927A Expired - Fee Related CN100365593C (en) 2003-06-16 2003-06-16 Internal memory managerial approach for computer system

Country Status (1)

Country Link
CN (1) CN100365593C (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100395712C (en) * 2005-12-22 2008-06-18 华为技术有限公司 Source management method for software system
CN101582031B (en) * 2009-06-16 2013-01-16 中兴通讯股份有限公司 Linked list management method based on structured language
CN103136104A (en) * 2011-11-24 2013-06-05 深圳市快播科技有限公司 Memory management method and system
CN103984639A (en) * 2014-04-29 2014-08-13 宁波三星电气股份有限公司 Dynamic memory distributing method
CN104317734A (en) * 2014-11-28 2015-01-28 迈普通信技术股份有限公司 Memory allocation method and device applicable to SLAB
CN109960472A (en) * 2019-04-01 2019-07-02 浙江中控技术股份有限公司 Embedded file system and file system operation method based on Flash
CN112506813A (en) * 2020-12-29 2021-03-16 郑州信大捷安信息技术股份有限公司 Memory management method and system
CN112650577A (en) * 2019-10-12 2021-04-13 龙芯中科技术股份有限公司 Memory management method and device
CN112685188A (en) * 2021-03-22 2021-04-20 四川九洲电器集团有限责任公司 Embedded memory management method and device based on global byte array
CN113467930A (en) * 2021-05-31 2021-10-01 翱捷科技股份有限公司 Processing method and device for hardware management shared memory

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2814555B1 (en) * 2000-09-25 2003-02-28 Thomson Multimedia Sa SYSTEM AND METHOD FOR MEMORY MANAGEMENT OF DATA COHERENCE AND MULTIPROCESSOR NETWORK THEREOF
CN1181434C (en) * 2001-06-28 2004-12-22 华为技术有限公司 Adaptive dynamic memory management method

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100395712C (en) * 2005-12-22 2008-06-18 华为技术有限公司 Source management method for software system
CN101582031B (en) * 2009-06-16 2013-01-16 中兴通讯股份有限公司 Linked list management method based on structured language
CN103136104B (en) * 2011-11-24 2016-04-06 深圳市快播科技有限公司 A kind of EMS memory management process and system
CN103136104A (en) * 2011-11-24 2013-06-05 深圳市快播科技有限公司 Memory management method and system
CN103984639B (en) * 2014-04-29 2016-11-16 宁波三星医疗电气股份有限公司 A kind of dynamic memory distribution method
CN103984639A (en) * 2014-04-29 2014-08-13 宁波三星电气股份有限公司 Dynamic memory distributing method
CN104317734A (en) * 2014-11-28 2015-01-28 迈普通信技术股份有限公司 Memory allocation method and device applicable to SLAB
CN109960472A (en) * 2019-04-01 2019-07-02 浙江中控技术股份有限公司 Embedded file system and file system operation method based on Flash
CN109960472B (en) * 2019-04-01 2022-04-19 浙江中控技术股份有限公司 Flash-based embedded file system and file system operation method
CN112650577A (en) * 2019-10-12 2021-04-13 龙芯中科技术股份有限公司 Memory management method and device
CN112506813A (en) * 2020-12-29 2021-03-16 郑州信大捷安信息技术股份有限公司 Memory management method and system
CN112685188A (en) * 2021-03-22 2021-04-20 四川九洲电器集团有限责任公司 Embedded memory management method and device based on global byte array
CN113467930A (en) * 2021-05-31 2021-10-01 翱捷科技股份有限公司 Processing method and device for hardware management shared memory
CN113467930B (en) * 2021-05-31 2023-04-14 翱捷科技股份有限公司 Processing method and device for hardware management shared memory

Also Published As

Publication number Publication date
CN100365593C (en) 2008-01-30

Similar Documents

Publication Publication Date Title
CN100337205C (en) Method and system for facilitating communication within shared memory environments using lock-free queues
CN1146795C (en) Memory management method
EP3916559A1 (en) Prioritizing data reconstruction in distributed storage systems
US7571163B2 (en) Method for sorting a data structure
US20170286004A1 (en) Dedupe dram system algorithm architecture
CN1271524C (en) Static internal storage management method
CN1567249A (en) Internal memory managerial approach for computer system
CN1991796A (en) Demand paging apparatus and method for embedded system
CN1790292A (en) Data management technique for improving data reliability
CN1877548A (en) Method and system for management of page replacement
CN100346289C (en) FIFO memory and method for output empty full marker thereof
CN1542623A (en) Method for implementing memory management
CN1180349C (en) Quick flashing decument system
CN101075220A (en) Simulator and method for bus arbitraction
CN1920796A (en) Cache method and cache system for storing file's data in memory blocks
CN1295613C (en) Method for general windows program to operate journal information record
CN1871592A (en) Method and system for enhancing the endurance of memory cells
CN101060679A (en) Event insertion method
CN1975935A (en) External storing performance testing method and apparatus
CN1581100A (en) Data aging method for network processor
CN1946035A (en) Method for managing net element data configuration and net element
CN1949191A (en) Method of realizing low power consumption high speed buffer storying and high speed buffer storage thereof
CN1783722A (en) Programmable device
CN1652111A (en) Method for implementing realtime database routine operation
CN1570883A (en) Dynamic allocation method for non-buffering memory in embedded real-time operating 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: 20080130

Termination date: 20170616