JP4176682B2 - Memory management method - Google Patents
Memory management method Download PDFInfo
- Publication number
- JP4176682B2 JP4176682B2 JP2004206464A JP2004206464A JP4176682B2 JP 4176682 B2 JP4176682 B2 JP 4176682B2 JP 2004206464 A JP2004206464 A JP 2004206464A JP 2004206464 A JP2004206464 A JP 2004206464A JP 4176682 B2 JP4176682 B2 JP 4176682B2
- Authority
- JP
- Japan
- Prior art keywords
- fixed
- memory
- length
- area
- length memory
- 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
Images
Description
本発明は,情報処理装置や画像処理装置などのメモリを使用する装置におけるメモリ管理方式に関し,特に,メモリ上の可変長領域に予め確保された所定のデータサイズの複数の固定長メモリ領域からなる固定長メモリブロックの領域を元の可変長領域に変更するメモリ管理方式に関するものである。 The present invention relates to a memory management method in an apparatus using a memory such as an information processing apparatus or an image processing apparatus, and in particular, includes a plurality of fixed-length memory areas having a predetermined data size secured in advance in a variable-length area on the memory. The present invention relates to a memory management system for changing a fixed-length memory block area to an original variable-length area.
従来からメモリを管理する方式として様々な方式が提案,実施されているが,それらの方式は,可変長メモリ管理方式と固定長メモリ管理方式とに大別される。
上記可変長メモリ管理方式では,例えば,CPU等によりサイズαのデータの割付要求が出されると,メモリの先頭アドレスから順に上記サイズαのデータを収容し得る空き領域(未使用領域),即ち開放されたメモリ領域があるか否かが探索され(探索処理),この探索結果に基づいて上記割付要求を満たす空き領域があると判断されると,上記空き領域が上記サイズαと残りの空き領域とに分割され(領域分割処理),その後,上記サイズαの空き領域にデータが割り付けられる。また,割り付けられたデータの開放要求が出されると,CPU等により指定されたメモリアドレスの割付領域内のデータが消去された後に開放された領域の前後のメモリ領域の使用状況を確認して,隣接する空き領域があれば複数の空き領域を併合する処理(領域併合処理)が行われる。
このように,可変長メモリ管理方式によれば,データを収容し得る空き領域さえ存在しておれば,任意のサイズのメモリ割り付けが要求されたサイズどおりに行えるため,メモリ内に無駄なメモリ領域が生じ難い。従って,効率よくメモリ領域を使用することができる。しかし,その反面,割り付け時に行われる空き領域の上記探索処理或いは上記領域分割処理等の前処理や,開放時に行われる上記領域併合処理や空き領域のチェーン処理等の後処理が付随することになるため,メモリ管理における各処理の速度が遅くなる。特に,メモリの末端アドレス部分ほど前記した割付時探索処理に時間がかかり,処理速度が極端に落ちる傾向にある。
一方,上記固定長メモリ管理方式では,メモリ領域を所定のサイズの複数のメモリセル(固定長メモリ領域と同義)に区切り,上記メモリセル単位でメモリが管理される。そのため,メモリ領域の割り付けや開放が高速に行えるという利点がある。しかし,上記メモリセルのサイズを大きくするほど,管理されるメモリセルの数が減って処理速度は上がるが,上記メモリセルにデータが割り付けられたときの上記メモリセルにおける端数が拡大するため,上記メモリセル内に使用することのできない無駄なメモリ領域が生じ,メモリの使用効率が悪くなるという問題がある。
Conventionally, various methods have been proposed and implemented as methods for managing memory, and these methods are roughly classified into variable-length memory management methods and fixed-length memory management methods.
In the variable-length memory management system, for example, when an allocation request for data of size α is issued by a CPU or the like, a free area (unused area) that can accommodate the data of size α in order from the start address of the memory, that is, free Whether or not there is a designated memory area is searched (search process), and if it is determined that there is a free area that satisfies the allocation request based on the search result, the free area is the size α and the remaining free areas. (Area division processing), and then data is allocated to the empty area of the size α. In addition, when a request to release the allocated data is issued, the usage status of the memory area before and after the area released after the data in the allocated area of the memory address specified by the CPU or the like is erased is confirmed. If there are adjacent empty areas, a process of merging a plurality of empty areas (area merging process) is performed.
As described above, according to the variable-length memory management method, as long as there is an empty area that can accommodate data, memory allocation of an arbitrary size can be performed according to the requested size. Is unlikely to occur. Therefore, the memory area can be used efficiently. However, on the other hand, pre-processing such as the above-described search process or the above-described area dividing process for the free area performed at the time of allocation, and post-processing such as the above-described area merging process or free area chain process performed at the time of release are accompanied. Therefore, the speed of each process in memory management becomes slow. In particular, the end address portion of the memory takes time for the above-described search process at the time of allocation, and the processing speed tends to extremely decrease.
On the other hand, in the fixed-length memory management method, the memory area is divided into a plurality of memory cells having a predetermined size (synonymous with the fixed-length memory area), and the memory is managed in units of the memory cells. Therefore, there is an advantage that the memory area can be allocated and released at high speed. However, as the size of the memory cell is increased, the number of managed memory cells is reduced and the processing speed is increased. However, since the fraction of the memory cell when data is allocated to the memory cell increases, There is a problem that a useless memory area that cannot be used in the memory cell is generated, and the use efficiency of the memory is deteriorated.
そこで,特許文献1に示すように,メモリを所定のデータサイズからなる複数の固定長のメモリセルに分割して,固定長メモリ管理方式の利点を生かしつつ,可変長領域の割付,開放要求に対しては,各メモリセルの使用状況を「0」又は「1」のビット値として記録するビットマップを管理用データとして設けて,このビットマップを管理してメモリの可変長の割付,開放を行うことにより,従来の可変長メモリ管理方式の問題を低減させるメモリ管理方法が提案されている。
しかしながら,特許文献1に提案されるメモリ管理方式は,固定長の複数のメモリセルを使用して可変長データに対応するものであるため,以下の(1)〜(3)に記載する問題があった。
(1)一の可変長データに対して,連続するメモリセルを割り付ける必要があるため,メモリセルの割り付けと開放が繰り返された場合は,未使用のメモリセルが動的メモリ領域内に分散して,連続した未使用のメモリセルが減少することになり却ってメモリの使用効率が低下する。
(2)固定長のメモリセルを使用するため,可変長データに対しては従来と同様に,メモリセルのサイズ以下の割り付け要求が発生した場合に,割り付けられた複数のメモリセルの最後のメモリセルに,無駄な割り付け端数が発生するため,メモリの使用効率が低下する。
(3)メモリ内に,実データ以外の前記ビットマップ等のデータを格納しておく必要があるため,メモリ管理領域内における実データの記憶管理領域が相対的に減少する。
However, since the memory management method proposed in
(1) Since it is necessary to allocate consecutive memory cells to one variable length data, unused memory cells are distributed in the dynamic memory area when memory cell allocation and release are repeated. As a result, the number of consecutive unused memory cells decreases, and the use efficiency of the memory decreases.
(2) Since a fixed-length memory cell is used, the last memory of a plurality of allocated memory cells when variable-size data is requested to be allocated below the size of the memory cell, as in the past. Since useless fractions are generated in the cells, the memory usage efficiency decreases.
(3) Since it is necessary to store data such as the bitmap other than the actual data in the memory, the storage management area for the actual data in the memory management area is relatively reduced.
上述した特許文献1のメモリ管理方式が有する上記各問題は,以下のメモリ管理方式Xにより解決され得る。即ち,所定サイズのデータの割付,開放要求がなされたときに,前記可変長メモリ管理方式により管理される可変長メモリ上の可変長メモリ領域に複数の固定長メモリ領域(固定長のメモリセルと同義)からなる固定長メモリブロックを確保して,該確保された固定長メモリブロック内の複数の固定長メモリ領域に対して上記所定サイズのデータの割付,開放を行い,上記固定長メモリブロック内の複数の固定長メモリ領域が全て開放されたときには,該固定長メモリブロックを元の可変長メモリ領域に変更するメモリ管理方式Xを採用することにより,上記各問題を生じさせずに,メモリ領域を有効に使用することが可能となる。なお,上記メモリ管理方式Xの詳細については,後段の発明の詳細な説明の欄で説明する。
しかし,上記メモリ管理方式Xを用いて上記固定長メモリブロックを元の可変長領域に変更する場合,以下の問題が生じるおそれがある。例えば,上記固定長メモリブロック内の複数の固定長メモリ領域が全て開放されたために上記固定長メモリブロックを元の可変長領域に変更する処理が行われ,その直後に上記所定サイズのデータの割付要求がなされた場合は,上記固定長メモリブロックを新たに再確保する処理が行われる。そのため,固定長メモリ領域への割付,開放が連続して行われた場合に,上記変更処理,確保処理が繰り返し行われることになる。このように変更処理,確保処理が繰り返し行われると,上記固定長メモリブロックのサイズは単純に割付,開放されるメモリ領域のサイズと較べて格段に大きいため,上記変更処理や確保処理を実行するCPUやメモリコントローラ等の負担が増大するという問題がある。
そこで,本発明は上記事情に鑑みてなされたものであり,その目的とするところは,一旦,可変長メモリ領域に確保された固定長メモリブロックの領域を元の可変長領域に変更する際に生じ得る処理負担の大きい繰り返し処理を排除してメモリの割付及び開放処理を高速に行い,且つ,メモリ内に使用することができない未使用領域を生じさせずに使用効率のよいメモリ管理方式を提供することにある。
Each of the above problems of the memory management system of
However, when the fixed-size memory block is changed to the original variable-length area using the memory management method X, the following problems may occur. For example, since all the fixed-sized memory areas in the fixed-sized memory block have been released, the process of changing the fixed-sized memory block to the original variable-sized area is performed, and immediately after that, the allocation of the data of the predetermined size is performed. When the request is made, a process of newly reallocating the fixed-length memory block is performed. For this reason, when the allocation and release to the fixed-length memory area are continuously performed, the change process and the securing process are repeatedly performed. If the change process and the secure process are repeatedly performed in this way, the size of the fixed-size memory block is much larger than the size of the memory area that is simply allocated and released, so the change process and the secure process are executed. There is a problem that the burden on the CPU, the memory controller, etc. increases.
Accordingly, the present invention has been made in view of the above circumstances, and the object of the present invention is to temporarily change the area of the fixed-length memory block secured in the variable-length memory area to the original variable-length area. Provides a memory management method with high use efficiency without causing unusable areas that cannot be used in the memory, which eliminates repetitive processing that can generate a large processing load and performs memory allocation and release processing at high speed. There is to do.
上記目的を達成するために本発明は,メモリ上の可変長領域に予め確保された所定のデータサイズの複数の固定長メモリ領域からなる固定長メモリブロックの領域を元の可変長領域に変更するメモリ管理方式において,上記メモリ上の可変長領域に二以上の上記固定長メモリブロックが確保されている場合に,上記確保された二以上の上記固定長メモリブロックのうちの少なくとも二以上の固定長メモリブロック内の全ての上記固定長メモリ領域が開放されたことを条件に,該固定長メモリ領域が全て開放された二以上の固定長メモリブロックのうちのいずれか一つの固定長メモリブロック全体の領域を元の可変長領域に変更し,上記固定長メモリ領域が全て開放された上記固定長メモリブロックが一つである場合には該固定長メモリブロックを元の可変長領域に変更しないことを特徴とするメモリ管理方式として構成されている。
また,上記固定長ブロックの固定長メモリ領域の割り付け・開放に伴ってチェーンの張り替えを実行することにより該固定長メモリ領域がチェーン管理される構成では,上記メモリ上の可変長領域に二以上の上記固定長メモリブロックが確保されている場合に,上記可変長領域に確保された二以上の上記固定長メモリブロックのいずれか一つの固定長メモリブロック内の上記固定長メモリ領域が全て開放されたとき,該一つの固定長メモリブロックの他に上記固定長メモリ領域が全て開放された上記固定長メモリブロックが存在しない場合には該一つの固定長メモリブロックの固定長メモリ領域を元の可変長領域に変更せず,該一つの固定長メモリブロックの他に上記固定長メモリ領域が全て開放された上記固定長メモリブロックが存在する場合には該一つの固定長メモリブロックの固定長メモリ領域をチェーンの張り替えの実行前に元の可変長領域に変更することが望ましい。
To achieve the above object, the present invention changes an area of a fixed-length memory block composed of a plurality of fixed-length memory areas having a predetermined data size previously secured in a variable-length area on a memory to the original variable-length area. In the memory management method, when two or more fixed-length memory blocks are secured in a variable-length area on the memory, at least two fixed lengths of the two or more secured-length memory blocks secured all of the fixed-length condition that a memory area is opened in the memory block, the overall one fixed-length memory block one of the two or more fixed-size memory blocks in which the fixed-length memory area is all open change the region based on the variable-length area, the fixed-length memory block if the fixed-length memory area are all opened the fixed-length memory block is one Is configured as a memory management method, characterized in that no change to the original variable-length area.
Further, in the configuration in which the fixed-length memory area is chain-managed by executing chain reassignment as the fixed-length memory area of the fixed-length block is allocated / released, two or more variable-length areas on the memory are provided. When the fixed-length memory block is secured, all the fixed-length memory areas in any one of the fixed-length memory blocks of the two or more fixed-length memory blocks secured in the variable-length area are released. When there is no fixed-length memory block in which all the fixed-length memory area is released other than the one fixed-length memory block, the fixed-length memory area of the one fixed-length memory block is changed to the original variable length. There is the fixed-size memory block in which the fixed-size memory area is completely released in addition to the single fixed-size memory block. The case it is desirable to change the original variable-length area fixed length memory area of said one fixed-size memory blocks before performing the replacement of the chain.
以上説明したように,本発明は,メモリ上の可変長領域に所定のデータサイズの複数の固定長メモリ領域からなる固定長メモリブロックが予め二以上確保されている場合に,上記確保された二以上の上記固定長メモリブロックのうちの少なくとも二以上の固定長メモリブロック内の全ての上記固定長メモリ領域が開放されたことを条件に,該固定長メモリ領域が全て開放された二以上の固定長メモリブロックのうちのいずれか一つの固定長メモリブロック全体の領域を元の可変長領域に変更し,上記固定長メモリ領域が全て開放された上記固定長メモリブロックが一つである場合には該固定長メモリブロックを元の可変長領域に変更しないよう構成されているため,一旦確保された一つの固定長メモリブロック内の全ての固定長メモリ領域が開放された場合であっても,上記固定長メモリ領域が全て開放された上記固定長メモリブロックが一つである場合には上記一つの固定長メモリブロックは元の可変長領域に変更されず,全ての固定長メモリ領域が開放された固定長メモリブロックが二以上存在する場合に初めて上記固定長メモリブロックが一つだけ元の可変長領域に変更される。そのため,新たに固定長メモリ領域に対するデータの割付要求がなされたとしても,未使用の(空の)固定長メモリブロックが既に存在し,該固定長メモリブロックを再確保する必要が無いため,メモリ管理における割付及び開放処理の負担が軽減されるだけでなく,総合的に高速な割付,開放処理が実現され得る。
また,上記固定長ブロックの固定長メモリ領域の割り付け・開放に伴ってチェーンの張り替えを実行することにより該固定長メモリ領域がチェーン管理される構成では,上記メモリ上の可変長領域に二以上の上記固定長メモリブロックが確保されている場合に,上記可変長領域に確保された二以上の上記固定長メモリブロックのいずれか一つの固定長メモリブロック内の上記固定長メモリ領域が全て開放されたとき,該一つの固定長メモリブロックの他に上記固定長メモリ領域が全て開放された上記固定長メモリブロックが存在しない場合には該一つの固定長メモリブロックの固定長メモリ領域を元の可変長領域に変更せず,該一つの固定長メモリブロックの他に上記固定長メモリ領域が全て開放された上記固定長メモリブロックが存在する場合には該一つの固定長メモリブロックの固定長メモリ領域をチェーンの張り替えの実行前に元の可変長領域に変更するように構成することにより,該一つの固定長メモリブロックに対してのチェーンの張り替えのための処理負担が軽減される。
As described above, according to the present invention, when two or more fixed-length memory blocks including a plurality of fixed-length memory areas having a predetermined data size are secured in advance in the variable-length area on the memory, Two or more fixed areas in which all the fixed length memory areas are released on condition that all the fixed length memory areas in at least two fixed length memory blocks of the above fixed length memory blocks are released. If any one of a fixed length and change the memory block the entire area to the original variable-length area, the fixed-length memory block in which the fixed-length memory area is all open of the long memory block is one because it is configured not to change the fixed-size memory blocks to the original variable-length area, once all the fixed-length memory area in the fixed-length memory block one which is secured Even when released, the single fixed-length memory block when the fixed-length memory area is all open the fixed-length memory block is one is not changed to the original variable-length area, Only when there are two or more fixed-length memory blocks in which all the fixed-length memory areas are released, only one fixed-length memory block is changed to the original variable-length area. Therefore, even if a data allocation request for a fixed-sized memory area is newly made, an unused (empty) fixed-sized memory block already exists and there is no need to reallocate the fixed-sized memory block. Not only is the burden of allocation and release processing in management reduced, but overall high-speed allocation and release processing can be realized.
Further, in the configuration in which the fixed-length memory area is chain-managed by executing chain reassignment as the fixed-length memory area of the fixed-length block is allocated / released, two or more variable-length areas on the memory are provided. When the fixed-length memory block is secured, all the fixed-length memory areas in any one of the fixed-length memory blocks of the two or more fixed-length memory blocks secured in the variable-length area are released. When there is no fixed-length memory block in which all the fixed-length memory area is released other than the one fixed-length memory block, the fixed-length memory area of the one fixed-length memory block is changed to the original variable length. There is the fixed-size memory block in which the fixed-size memory area is completely released in addition to the single fixed-size memory block. In this case, the chain for the one fixed-sized memory block is changed by changing the fixed-sized memory area of the one fixed-sized memory block to the original variable-sized area before executing the chain replacement. The processing burden for re-installing is reduced.
以下添付図面を参照しながら,本発明の実施の形態について説明し,本発明の理解に供する。尚,以下の実施の形態は,本発明を具体化した一例であって,本発明の技術的範囲を限定する性格のものではない。
ここに,図1は本発明のメモリ管理方式Xを実現するためのハードウェア構成を示すブロック図,図2は図1の管理領域6内に作成され,本発明のメモリ管理方式Xに係わる固定長メモリ領域の管理テーブルの内容を示すテーブル図,図3は図1の実データ領域7にデータが順次割り付けられたときの実データ領域7の状態を示す模式図,図4はメモリ管理手段4によって図3で示した可変長データや固定長データが割り付けられる概略手順を説明するフローチャート,図5は固定長メモリブロックの領域BB1を作成する手順を説明する模式図,図6は固定長メモリブロックの領域BB1内の固定長メモリ領域を割り付ける手順を説明する模式図,図7はメモリアドレス611番地の固定長メモリ領域11を割り付けた後の後処理を説明するための模式図,図8は図1の実データ領域7に作成された3つの固定長メモリブロック領域BB1〜BB3のうちの固定長メモリブロックBB3内の先頭アドレス711の固定長メモリ領域11を開放する手順を説明するための模式図,図9は図1の実データ領域7に確保された固定長メモリブロック領域が可変長領域に変更されるときの実データ領域7の状態を示す模式図,図10は図7に示すメモリアドレス612番地の固定長メモリ領域11が開放された場合の新たなポインタとチェーンを示す図,図11はメモリ管理手段4によって固定長データの格納領域として割り付けられた固定長メモリ領域を開放する概略手順を説明するフローチャートである。
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings so that the present invention can be understood. The following embodiment is an example embodying the present invention, and does not limit the technical scope of the present invention.
FIG. 1 is a block diagram showing a hardware configuration for realizing the memory management method X of the present invention. FIG. 2 is a diagram created in the
まず,図1のブロック図を用いて本実施形態に係るメモリ管理方式Xについて具体的に説明する。図1は,本発明のハードウェア構成図であり,CPU1によって制御が行われるOS2上でプログラム3が稼働している例を示す。プログラム3やOS2によってメモリを必要とするジョブが発生すると,その要求はCPU1に送られて,CPU1からメモリ管理手段4にメモリ要求(割付要求,開放要求)として送出される。メモリ管理手段4は,例えば,従来周知のメモリコントローラ等により構成されている。このメモリ管理手段4は,上記CPU1からのメモリ要求を受けてメモリ5の実データ領域7内に,要求されたメモリサイズの領域の割付,開放を実行する。その場合,前処理の一例である実データ領域7内における空き領域の探索処理を実行するため,メモリ5内に設けられた管理領域6で管理されている実データ領域7のメモリ使用状況に関する管理情報(管理テーブル)が上記メモリ管理手段4によって参照される。
First, the memory management system X according to the present embodiment will be specifically described with reference to the block diagram of FIG. FIG. 1 is a hardware configuration diagram of the present invention, and shows an example in which a
本メモリ管理方式Xでは,メモリ5の管理を,可変長メモリ管理方式に基づいて行っているため,メモリに対する割付,開放要求がCPU1から発行された場合は,従来の可変長メモリ方式によって管理領域6に管理用のデータを作成し,実データ領域7のメモリ使用状況を管理する。即ち,上記実データ領域7は全域可変長メモリ領域である。従って,上記メモリ5の可変長メモリ管理を行うためのメモリ管理手段4及び管理領域6の動作と構成については従来の技術を使用して実現可能であり,その説明は省略する。
In this memory management system X, the
ここで,上記メモリ5の可変長メモリ管理を行う中で,本発明のメモリ管理方式Xにおける特異な点を図2及び図3を参照して説明する。図2は,本発明のメモリ管理方式Xに係わる固定長メモリ領域の管理テーブルの内容を示すテーブル図である。特に,情報処理装置や入出力装置,或いは画像処理装置などでデータ処理が行われる場合,ある特定の固定データサイズのデータが頻繁に処理されることがある。例えば,固定データサイズの入出力バッファを介して転送されて処理されるデータは256バイトや1024バイトなどのように固定長である。また,画像処理の場合は,1ラインごとに固定長のデータを処理することも行われている。
Here, while performing variable-length memory management of the
このように,頻繁に処理される固定データサイズは,装置の種類によって決まっている場合が多いため,そのサイズのデータを後述する固定長メモリブロックの領域内で固定長として処理することで可変長メモリ管理方式に伴う従来の問題点を改善するとともに,可変長メモリ管理方式に適したデータは可変長で処理することで固定長メモリ管理方式に伴う従来の問題点を改善することができる。 As described above, the fixed data size that is frequently processed is often determined depending on the type of device. Therefore, by processing the data of that size as a fixed length in the area of the fixed-length memory block described later, the variable length can be changed. In addition to improving the conventional problems associated with the memory management system, the conventional problems associated with the fixed-length memory management system can be improved by processing data suitable for the variable-length memory management system in a variable length.
ここで,本発明のメモリ管理方式Xが利用される画像処理装置や情報処理装置等の装置において,1024バイトと256バイトの固定長データが頻繁に処理される場合を想定して上記メモリ管理方式Xについて説明する。図2に示される固定長メモリ領域の管理テーブル10は,管理領域6内に設けられ,固定長としてメモリ管理が行われるデータの「固定データサイズ」と,可変長データ領域として作成された領域内に存在する上記固定データサイズと同一サイズ(所定のデータサイズに相当)の固定長メモリ領域の「総数」と,複数の上記固定長メモリ領域のうちの未使用,未割り付けになっている空き固定長メモリ領域の「空き個数」と,最初の空き固定長メモリ領域のアドレスを指す「先頭アドレス」とを管理している。なお,上記管理データ10で管理される要素を上記各要素に限定する趣旨ではない。以下の例では,1024バイトと256バイトそれぞれの固定長データに対して管理が行われるものとする。
Here, in the image processing apparatus, the information processing apparatus, and the like using the memory management system X of the present invention, the memory management system is assumed assuming that 1024 bytes and 256 bytes of fixed-length data are frequently processed. X will be described. The fixed-length memory area management table 10 shown in FIG. 2 is provided in the
図2に示す例では,固定データサイズ1024バイトに関しては,総数欄に32が示されているので,1024バイトの固定長メモリ領域32個からなる固定長メモリブロック領域を実データ領域7(図1)内に作成することが可能であることを意味し,空き個数欄と先頭アドレス欄はそれぞれ,10進数表示で“0”を示しているため,上記固定長メモリブロックはまだ作成されていないことを意味する。256バイトの固定長メモリ領域についても同様であるが,総数欄に64が示されているため,64個の固定長メモリ領域からなる固定長メモリブロック領域が作成可能である。尚,詳細は後述するが,空き個数欄と先頭アドレス欄とがともに“0”表示でない場合は,固定長データが割り付けられる固定長メモリブロック領域は既に作成されていることを意味する。 In the example shown in FIG. 2, with respect to the fixed data size of 1024 bytes, 32 is shown in the total number column, so the fixed length memory block area consisting of 32 fixed length memory areas of 1024 bytes is assigned to the real data area 7 (FIG. 1). ) Means that it can be created, and since the empty number field and the top address field each indicate “0” in decimal notation, the above fixed-length memory block has not yet been created. Means. The same applies to a 256-byte fixed-length memory area, but since 64 is shown in the total number column, a fixed-length memory block area composed of 64 fixed-length memory areas can be created. Although details will be described later, when both the empty number field and the head address field are not “0”, it means that a fixed-length memory block area to which fixed-length data is allocated has already been created.
次に,図3と図4を使用して,可変長メモリ管理方式を使用しながら特定の固定データサイズのデータに対して上記メモリ管理手段4(図1)が固定長メモリ管理を行う手順の概要を説明する。図3は,上記実データ領域7(図1)にデータが順次割り付けられたときの実データ領域7の状態を示す模式図であって,(a)は実データ領域7全てが空き領域Aとなっている状態を示し,(b)は可変長データの割り付け要求があり,その要求に基づいて,空き領域Aの中に,つまり空き領域Aを分割して,可変長データ領域AAの割り付けと空き領域Bを確保している状態を示す。
Next, referring to FIG. 3 and FIG. 4, a procedure for the memory management means 4 (FIG. 1) to perform fixed-length memory management for data of a specific fixed data size using the variable-length memory management method. An outline will be described. FIG. 3 is a schematic diagram showing the state of the
また,図3(c)は,実データ領域7が図3(b)の状態となった後に,予め管理テーブル10に登録されている1024バイトの固定長データの割り付けの要求を受け,それを割り付ける領域が存在しない場合に,空き領域Bを二分して,1024バイト×32個の領域を固定長メモリブロックの領域BB1として作成し,残りを空き領域Cとして確保したときの実データ領域7の状態を示し,図3(d)は,その後,予め管理テーブル10に登録されている256バイトの固定長データのメモリ割り付け要求を受け,それを割り付ける領域が存在しない場合に,空き領域Cを二分して,256バイト×64個の領域を固定長メモリブロックの領域CCとして割り付け,残りを空き領域Dとして確保したときの実データ領域7の状態を示す。尚,固定長メモリブロックの領域BB1及びCCは,それぞれ領域としては可変長メモリ管理方式によって管理されている。
FIG. 3C shows a request for allocation of fixed-length data of 1024 bytes registered in advance in the management table 10 after the
図4は,図3で示した可変長データ領域AAや固定長メモリブロック領域BB1或いはCCが上記メモリ管理手段4(図1)によって割り付けられる概略手順を示すフローチャートである。図中のS1,S2,…は処理手順番号(ステップ番号)を示す。処理はS1から開始される。
いま,S1で,CPU1から,あるサイズのメモリの割り付け要求がメモリ管理手段4に出されると,S2では,メモリ管理手段4により管理テーブル10(図2)が検索され,要求された割付サイズが本メモリ管理方式Xによるメモリ管理を行う固定データサイズとして登録されているか否かが判断される。S3での判断が行われ,割り付け要求がなされたデータのサイズが登録されていない場合は,S8に分岐して通常の可変長メモリ管理方式に基づいて,可変長データ領域(例えば可変長データ領域AA)が実データ領域7内に確保される(図3(b)参照)。
FIG. 4 is a flowchart showing a schematic procedure for allocating the variable length data area AA and the fixed length memory block area BB1 or CC shown in FIG. 3 by the memory management means 4 (FIG. 1). In the figure, S1, S2,... Indicate processing procedure numbers (step numbers). The process starts from S1.
Now, when an allocation request for a certain size of memory is issued from the
S3で,割り付け要求がなされたデータのサイズが本発明によるメモリ管理を行う固定データサイズ(例えば1024バイト)として登録されていると判断された場合は,その後,処理手順はS4に移行する。S4では,既にそのサイズの固定長メモリブロック領域が既に作成されているか否か,即ち,メモリ5内に要求された上記固定データサイズに対応する固定長メモリブロック領域が存在するか否かが判断される。この判断は,管理テーブル10内の空き個数と先頭アドレスの値に基づいて行われる。即ち,上記空き個数と先頭アドレスの欄に“0”以外の数値が書き込まれている場合は,固定長メモリブロック領域が存在すると判断され,“0”が書き込まれている場合は固定長メモリブロック領域が存在すると判断される。S4で,図3(c)に示すように,固定長メモリブロックBB1が既に作成されていると判断された場合は,S6に移行する。また,まだ作成されていないと判断された場合は,S5に分岐して固定長メモリブロック領域BB1(図3(c)参照)を作成した後にS6に移行する。
If it is determined in S3 that the size of the data requested for allocation is registered as a fixed data size (for example, 1024 bytes) for performing memory management according to the present invention, the processing procedure thereafter proceeds to S4. In S4, it is determined whether or not a fixed-sized memory block area of that size has already been created, that is, whether or not a fixed-sized memory block area corresponding to the requested fixed data size exists in the
S6では,既に存在する固定長メモリブロック領域BB1,或いはS5で新たに作成された固定長メモリブロック領域BB1において,管理テーブル10に記憶されている先頭アドレスから始まる固定長メモリ領域が,要求されたデータのメモリ格納領域として割り付けられる。この固定長メモリ領域の割り付けによって,固定長メモリブロック領域BB1内の空き固定長メモリ領域の空き個数と先頭アドレスが変動することになる。そのため,後述するS7においてチェーンの張り替えが行われ,管理テーブル10の空き個数及び先頭アドレスと同時に,空き固定長メモリ領域の状態情報が最新状態に更新される。また,フローチャートに図示しないが,割り付け要求が処理されて固定長メモリ領域が割り付けられると,割り付けられたメモリ領域のアドレスがメモリ管理手段4から要求元のCPU1に戻されて割り付け処理が完了する。
In S6, a fixed-sized memory block area starting from the head address stored in the management table 10 is requested in the fixed-sized memory block area BB1, which already exists, or in the fixed-sized memory block area BB1 newly created in S5. Allocated as a memory storage area for data. Due to the allocation of the fixed-length memory area, the number of empty fixed-length memory areas in the fixed-length memory block area BB1 and the start address vary. For this reason, chain replacement is performed in S7, which will be described later, and the state information of the free fixed-length memory area is updated to the latest state at the same time as the free number and head address of the management table 10. Although not shown in the flowchart, when an allocation request is processed and a fixed-sized memory area is allocated, the address of the allocated memory area is returned from the memory management means 4 to the requesting
次に,図4のS5による手順,すなわち,管理テーブル10に登録されている固定データサイズの固定長メモリブロック領域BB1が,まだ作成されていない場合の作成手順についての詳細を,図5を参照して説明する。ここに,図5は,固定長メモリブロック領域BB1を作成する手順を説明する模式図であり,(a)は管理テーブル10の内容を示し,(b)は図3(c)で示した固定長メモリブロック領域BB1とその内容の詳細を示す。 Next, see FIG. 5 for details of the procedure in S5 of FIG. 4, that is, the creation procedure when the fixed-size memory block area BB1 of the fixed data size registered in the management table 10 has not yet been created. To explain. FIG. 5 is a schematic diagram for explaining the procedure for creating the fixed-length memory block area BB1, where (a) shows the contents of the management table 10, and (b) shows the fixed table shown in FIG. 3 (c). The long memory block area BB1 and its details are shown.
図5(a)は,図2で示した管理テーブル10の一部であって,固定データサイズが1024バイトの固定長データが32個作成可能であることを示しており,固定長メモリブロック領域BB1が作成されるまでは,空き個数欄は“0”が表示され,先頭アドレス欄にも“0”が表示される。1024バイトのメモリ割り付け要求を受け取ったメモリ管理手段4(図1)は,1024サイズが管理テーブル10に登録されており(S3のYes側),且つそのサイズ(1024バイト)に対応する固定長メモリブロック領域BB1が存在しないと判断した場合は(S4のNo側),図3(b)の空き領域B内に,32個の1024バイトの固定長メモリ領域11からなる固定長メモリブロックの領域BB1を作成(確保)する。上記各固定長メモリ領域11のメモリアドレスは,10進数で表現すると,例えば先頭の611番地から始まり最後の固定長メモリ領域11は642番地で終わる。尚,ここでいう番地(611番地〜642番地)は,本実施形態を容易に説明するための番地であり,1024バイトごとに付与した番地で,実際のメモリアドレスとは異なる。実際のアドレスとしては,メモリ5の物理アドレスや論理アドレス空間を絶対アドレス或いは相対アドレスで表したものなどが使用される。
FIG. 5A shows that a part of the management table 10 shown in FIG. 2 and that 32 pieces of fixed-length data having a fixed data size of 1024 bytes can be created. Until BB1 is created, “0” is displayed in the empty number column, and “0” is also displayed in the head address column. The memory management means 4 (FIG. 1) that has received the 1024-byte memory allocation request has the 1024 size registered in the management table 10 (Yes in S3), and a fixed-length memory corresponding to that size (1024 bytes) When it is determined that the block area BB1 does not exist (No in S4), the area BB1 of the fixed-length memory block including the 32 1024-byte fixed-
そして,それぞれの固定長メモリ領域11は空き状態なので,管理テーブル10の先頭アドレスの欄には,空いている最初の固定長メモリ領域11のアドレス611番地が書き込まれる。つまり,管理テーブル10の先頭アドレスの欄は,最初の空き固定長メモリ領域11を指している。
現時点では,全ての固定長メモリ領域11は未使用状態(空き状態)である。そのため,最初のアドレス611番地の固定長メモリ領域11には,次の空いている固定長メモリ領域11のアドレス,すなわち,612番地が書き込まれ,同様にして,612番地の固定長メモリ領域11内には613番地が書き込まれる。つまり,n番目の空き固定長メモリ領域11内にはn+1番目の空き固定長メモリ領域11を指すアドレスが書き込まれることになる。そして,最後の642番地の固定長メモリ領域11は次に指し示す空き固定長メモリ領域がないため,“0”が書き込まれる。このようにして,空き領域に次の空き領域のアドレスが書き込まれることにより,管理テーブル10の先頭アドレスの欄に書き込まれた次の番地を示すアドレス(ポインタ)を順番にたどっていけば,全ての空き固定長メモリ領域11が順番に繋がるチェーンが完成する。上記チェーンの終端は,ポインタとして“0”を持つ固定長メモリ領域11である。
その後,管理テーブル10の空き個数欄に,空き固定長メモリ領域11の個数(現時点では32個)が書き込まれる。
このようなS5(図4)の手順を踏むことにより,固定長メモリブロック領域BB1が作成される。
なお,その後,図4のS6の割り付けが行われることにより,611番地の空き固定長メモリ領域11がデータの格納領域として割り付けられるため,後述するS7のチェーン張り替え時に,上記管理テーブル10の空き個数欄が31個に書き換えられる。その後,CPU1(図1)からの要求に応じて,メモリ管理手段4(図1)により611番地にデータが書き込まれる。
Since each fixed
At present, all the fixed-
Thereafter, the number of free fixed-length memory areas 11 (currently 32) is written in the empty number column of the management table 10.
By following the procedure of S5 (FIG. 4), a fixed-length memory block area BB1 is created.
After that, since the allocation of S6 in FIG. 4 is performed, the empty fixed-
続いて,既に,固定長メモリブロック領域BB1が作成されている場合,即ち図4のS4で固定長メモリブロック領域がある(S4のYes側)と判断された後のS6の手順について,図6と図7を参照して具体的に説明する。図6は,固定長メモリブロック領域BB1内の固定長メモリ領域11を割り付ける手順を説明する模式図であり,(a)は管理テーブル10の内容を示し,(b)は図3(c)で示した固定長メモリブロック領域BB1の詳細を示す。
Subsequently, when the fixed-length memory block area BB1 has already been created, that is, the procedure of S6 after it is determined in S4 of FIG. 4 that there is a fixed-length memory block area (Yes side of S4), FIG. A specific description will be given with reference to FIG. FIG. 6 is a schematic diagram for explaining the procedure for allocating the fixed-
図6(a)の管理テーブル10には,固定データサイズが1024バイトの固定長データの固定長メモリ領域11が32個作成されており,そのうち10個が空いており,先頭の空き固定長メモリ領域11を示す先頭アドレスは611番地であることが示されている。図4のフローチャートに基づいて説明したように,1024バイトのメモリ割り付け要求をメモリ管理手段4(図1)が受けると,常に,管理テーブル10の先頭アドレス欄に書き込まれているアドレスが指す最初の空き固定長メモリ領域11,つまりこの例では611番地の固定長メモリ領域11がデータの格納領域として割り付けられる。
In the management table 10 of FIG. 6A, 32 fixed-
次に,図7の模式図を用いて,611番地の固定長メモリ領域11を割り付けた後の,後処理の一例であるポインタとチェーンの張り替え手順(図4のS7)について説明する。図6で示されている611番地の固定長メモリ領域11が割り付けられると,図7では,その611番地の固定長メモリ領域11内にそれまで書き込まれていたポインタ(613番地)が,図7(a)に示される管理テーブル10の先頭アドレス欄に書き込まれる。即ち,先頭アドレス欄に示すポインタが611番地から613番地に書き換えられる。図6と図7を比較すると分かるように,613番地以降の空き固定長メモリ領域11内に書き込まれているポインタ(次の空き領域を示すアドレス)は変更されない。アドレス611番地の固定長メモリ領域11内にそれまで書き込まれていたポインタは,書き込まれるデータによって消失するが,そのポインタはデータによって消失する前に管理テーブル10の先頭アドレス欄に転記される。このとき,管理テーブル10の空き個数が1つ減るため,空き個数の総数表示が10個から9個に書き換えられる。このようにして図4のS6の割り付けが行われた後のポインタとチェーンの張り替えが行われる。
Next, referring to the schematic diagram of FIG. 7, a pointer and chain replacement procedure (S7 in FIG. 4), which is an example of post-processing, after allocating the fixed-
続いて,図8〜図10を参照しながら,図11のフローチャートを用いて,上記メモリ管理手段4によってデータの格納領域として割り付けられた固定長メモリ領域を開放する概略手順について説明する。ここに,図8は,メモリ5の実データ領域7に作成された3つの固定長メモリブロック領域BB1〜BB3のうちの固定長メモリブロックBB3内の先頭アドレス711の固定長メモリ領域11を開放する手順を説明するための模式図であり,(a)は管理テーブル10の内容を示し,(b)は固定長メモリブロック領域BB3とその内容の詳細を示す。なお,図8(a)は,図2で示した管理テーブル10の一部であって,固定データサイズが1024バイトの固定長データが32個作成可能であることを示す。また,図8(b)に示すように,固定長メモリブロックBB3(アドレス711〜742番地で構成)は,アドレス711の固定長メモリ領域11のみが使用中であり,他の31個の固定長メモリ領域は空き状態となっている。また,図9は,図1の実データ領域7に確保された固定長メモリブロック領域が可変長領域に変更されるときの実データ領域7の状態を示す模式図である。
まず,S11で,CPU1から上記メモリ管理手段4(図1)に対してアドレス711を指定して,固定長メモリブロックBB3内のアドレス711の固定長メモリ領域11を開放する開放要求が出されると,S12では,指定されたアドレス711の固定長メモリ領域11が開放される。その後,S13において,固定長メモリブロックBB3内の全ての固定長メモリ領域11が開放されたか否か,即ち,固定長メモリブロックBB3内の全ての固定長メモリ領域11が空き状態(未使用)であるか否かが判断される。かかる判断は,開放を行なう前後における図8(a)の管理テーブルの空き個数の欄の数値に基づいて行われる。この例では,固定長メモリブロックBB3のアドレス711の固定長メモリ領域11のみが使用中であったため,この固定長メモリ領域11が開放されることにより,固定長メモリブロックBB3内の全ての固定長メモリ領域が開放されたと判断されて,処理はS14に移行する。なお,ステップS13の判断でNoと判断された場合は,S16に移行して,後述するチェーンの張り替えが行われる。
Next, a schematic procedure for releasing the fixed-length memory area allocated as the data storage area by the memory management means 4 will be described with reference to FIGS. Here, FIG. 8 releases the fixed
First, in S11, when the
S13で全ての固定長メモリ領域11が開放されたと判断されると,その後,S14において,実データ領域7内に,全ての固定長メモリ領域11が開放された固定長メモリブロックが二以上存在するかどうかが判断される。例えば,図9(a)及び(b)に示すように,固定長メモリ領域が全て開放されている状態で実データ領域7に確保された固定長メモリブロックBB2が存在している場合に,上記S13で固定長メモリブロックBB3内の全ての固定長メモリ領域が開放されたと判断された場合は,固定長メモリ領域が全て開放されている二つの固定長メモリブロックBB2,BB3が存在することになるので,この場合は,処理はS15に移行する。また,全ての固定長メモリ領域が開放された固定長メモリブロックが二以上存在しない場合は,処理はS16に移行する。
S15では,上記固定長メモリブロックBB2又はBB3のいずれかが可変長メモリ領域に変更される。即ち,固定長メモリ領域を割り付けるために確保していた固定長メモリブロックの領域が元の可変長メモリ領域に復元される。図9(c)に変更後の実データ領域7の状態を示す。なお,可変長メモリ領域に変更される領域は上記固定長メモリブロックBB2又はBB3のいずれであってもかまわないが,先に固定長メモリ領域が全て開放されていた上記固定長メモリブロックBB2では既にチェーンの張り替えが行われているため,上記固定長メモリブロックBB3を可変長メモリ領域に変更することが望ましい。このほうが,固定長メモリブロックBB3に対してチェーンの張り替えを行う必要が無いため,その分,処理負担が軽減される。
If it is determined in S13 that all the fixed-
In S15, either the fixed-length memory block BB2 or BB3 is changed to a variable-length memory area. That is, the fixed-length memory block area reserved for allocating the fixed-length memory area is restored to the original variable-length memory area. FIG. 9C shows the state of the
ところで,固定長メモリ領域が全て開放された場合は,すぐに固定長メモリブロックの領域を元の可変長メモリ領域に変更することも考えられるが,例えば,上記固定長メモリブロックBB3内の複数の固定長メモリ領域が全て開放され,上記固定長メモリブロックBB3が元の可変長領域に変更された直後に,固定データサイズのデータの割付要求がなされた場合は,再度,複数の固定長メモリ領域からなる固定長メモリブロックBB3を新たに確保する必要が生じる。このようなことが繰り返し行われると,上記固定長メモリブロックBB3のサイズは非常に大きいため,可変長領域への変更や固定長メモリブロックの再確保にかかる処理負担が増大するという問題がある。そのため,本メモリ管理方式Xでは,他のメモリ管理方式とは異なり,固定長メモリブロックBB2内の全ての固定長メモリ領域が開放されたとしても他にそのような固定長メモリブロックが存在しない場合は上記固定長メモリブロックBB2を可変長メモリ領域に変更せずに残しておき,上記固定長メモリブロックBB3の固定長メモリ領域が全て開放されることによって,固定長メモリ領域が全て開放されていた上記固定長メモリブロックが二以上存在する場合にのみ,一つの上記固定長メモリブロックを可変長領域に変更することとした。これにより,実データ領域7(図1)内に,固定長メモリ領域が全て開放された上記固定長メモリブロックが少なくとも一つ存在することになるため,上述した処理負担が増大するという問題が発生することがなくなり,メモリの使用効率が向上され得る。 By the way, when all the fixed-length memory areas are released, it is possible to immediately change the area of the fixed-length memory block to the original variable-length memory area. For example, a plurality of fixed-length memory areas in the fixed-length memory block BB3 can be considered. If a fixed data size data allocation request is made immediately after the fixed length memory area is all released and the fixed length memory block BB3 is changed to the original variable length area, a plurality of fixed length memory areas are again stored. It is necessary to newly secure a fixed-length memory block BB3 consisting of If such a process is repeated, the size of the fixed-length memory block BB3 is very large, and there is a problem that the processing load for changing to the variable-length area and re-reserving the fixed-length memory block increases. Therefore, in this memory management method X, unlike other memory management methods, even when all the fixed-length memory areas in the fixed-length memory block BB2 are released, there is no other such fixed-length memory block. Left the fixed-length memory block BB2 without changing it to a variable-length memory area, and all the fixed-length memory areas of the fixed-length memory block BB3 were released, so that all the fixed-length memory areas were released. Only when there are two or more fixed-length memory blocks, one fixed-length memory block is changed to a variable-length area. As a result, there is at least one fixed-length memory block in which the fixed-size memory area is completely released in the actual data area 7 (FIG. 1), which causes a problem that the processing load described above increases. The memory usage efficiency can be improved.
上記S13或いはS14でNoと判断されて処理がS16に移行すると,このS16では,CPU1により指定されたアドレスの固定長メモリ領域が開放された後のチェーンの張り替えが行われる。ここで,図10を用いて,それまで使用中であった固定長メモリブロックBB1(図7参照)に示す612番の固定長メモリ領域11が開放された場合のポインタとチェーンの張り替え手順について説明する。図10は,図7に示す612番の固定長メモリ領域11が開放された場合の新たなポインタとチェーンを示す図である。メモリ管理手段4によって612番地の固定長メモリ領域11が開放されると,それまで図10(a)に示す管理テーブル10の先頭アドレス欄に書き込まれていたポインタが,613番地から612番地に書き換えられる。つまり。管理テーブル10の先頭アドレス欄のポインタとして,開放された固定長メモリ領域11(612番地)のアドレスが書き込まれる。そして,それまでの先頭アドレス欄に記憶されていた613番地が,開放された612番地の固定長メモリ領域11にポインタとして書き込まれる。
When it is determined No in S13 or S14 and the process proceeds to S16, the chain is replaced after the fixed-length memory area at the address designated by the
以上説明したように,CPU1からメモリ割り付け要求を受けると,管理テーブル10の先頭アドレス欄に書き込まれているアドレス(ポインタ)を通知するだけで,メモリ割り付けの前処理が完了し,メモリ管理の高速化が図れる。
また,固定長メモリ領域11がデータの格納領域として割り付けられると,その後の処理としては,管理テーブル10の先頭アドレス欄に,割り付けられた固定長メモリ領域11が有していたポインタを転記するだけの1つの動作ですむ。また,固定長メモリ領域11が開放されると,後処理として,開放された固定長メモリ領域11のアドレスを,管理テーブル10の先頭アドレス欄にポインタとして書き込むことと,開放された固定長メモリ領域11に,それまで管理テーブル10の先頭アドレス欄が有していたポインタを転記することの2つの動作ですむ。つまり,チェーンの最初のポインタ,或いは最初と2番目のポインタを変更するのみで,空き固定長メモリ領域11を繋いで示すチェーンの張り替えが完了することになり,更にメモリ管理の高速化が図れる。
As described above, when a memory allocation request is received from the
When the fixed-
なお,図示して説明しないが,図3(d)で示した256バイトの固定長メモリブロック領域CCも,これまで説明した固定長メモリブロック領域BB1〜BB3と同様な手順で管理される。
また,これまで,可変長メモリ管理方式によって1024バイトや256バイトの固定長メモリブロック領域BB1等やCCが管理され,更に,その固定長メモリブロック領域BB1内やCC内では,空き固定長メモリ領域をポインタでチェーン管理することを具体的な例をあげて説明したが,本発明はこうした例や数値に限定されないことは言うまでもない。
また,1024バイトや256バイトの固定長は,本発明が実施される装置によって変わるものであり,例えば2048バイトや512バイト,或いはその他の固定データサイズであってもよい。更に,これらの固定データサイズは,本発明が実施される装置で頻繁にメモリ割り付け要求が出されるサイズに設定するとよい。そうすると,従来の固定長メモリ管理方式のように,要求されるサイズとの間に端数が発生してメモリの使用効率が低下することもない。
Although not illustrated and described, the 256-byte fixed-length memory block area CC shown in FIG. 3D is also managed in the same procedure as the fixed-length memory block areas BB1 to BB3 described so far.
Up to now, 1024 bytes or 256 bytes of fixed-length memory block area BB1 or the like and CC have been managed by the variable-length memory management method. Furthermore, in the fixed-length memory block area BB1 or CC, an empty fixed-length memory area However, it goes without saying that the present invention is not limited to these examples and numerical values.
The fixed length of 1024 bytes or 256 bytes varies depending on the apparatus in which the present invention is implemented, and may be, for example, 2048 bytes, 512 bytes, or other fixed data sizes. Furthermore, these fixed data sizes may be set to a size at which memory allocation requests are frequently issued in the apparatus in which the present invention is implemented. Then, unlike the conventional fixed-size memory management method, a fraction is not generated between the required size and the memory use efficiency is not lowered.
以上の実施例を分かり易く説明するために,メモリ5,及び管理領域6と実データ領域7を物理メモリとし,実際のアドレスを具体的な番地で示したが,本発明は,物理メモリとともに論理メモリにも適用できることは勿論のこと,メモリに限らず,ハードディスク,CD−RW,DVD−RW,DVD−RAM,MO,MDなどの書き換え可能な記録媒体にも適用可能である。
In order to explain the above embodiment in an easy-to-understand manner, the
1…CPU
2…OS
3…プログラム
4…メモリ管理手段
5…メモリ
6…管理領域
7…実データ領域
10…管理テーブル
11…固定長メモリ領域
A,B,C,D… 空き領域
AA…可変長データ領域
BB,BB1,BB2,CC…固定長メモリブロック領域
1 ... CPU
2 ... OS
3 ...
Claims (2)
上記メモリ上の可変長領域に二以上の上記固定長メモリブロックが確保されている場合に,上記確保された二以上の上記固定長メモリブロックのうちの少なくとも二以上の固定長メモリブロック内の全ての上記固定長メモリ領域が開放されたことを条件に,該固定長メモリ領域が全て開放された二以上の固定長メモリブロックのうちのいずれか一つの固定長メモリブロック全体の領域を元の可変長領域に変更し,上記固定長メモリ領域が全て開放された上記固定長メモリブロックが一つである場合には該固定長メモリブロックを元の可変長領域に変更しないことを特徴とするメモリ管理方式。 In a memory management method for changing an area of a fixed-length memory block composed of a plurality of fixed-length memory areas having a predetermined data size previously secured in a variable-length area on a memory to the original variable-length area,
When two or more fixed-length memory blocks are reserved in the variable-length area on the memory, all of at least two fixed-length memory blocks of the two or more fixed-length memory blocks reserved of the condition that the fixed-length memory area is opened, the fixed-length memory area either based on one of the fixed-length memory block the entire area of all the opened two or more fixed-size memory blocks A memory that is changed to a variable-length area, and when there is one fixed-length memory block in which all the fixed-length memory areas are released, the fixed-length memory block is not changed to the original variable-length area. Management method.
上記メモリ上の可変長領域に二以上の上記固定長メモリブロックが確保されている場合に,上記可変長領域に確保された二以上の上記固定長メモリブロックのいずれか一つの固定長メモリブロック内の上記固定長メモリ領域が全て開放されたとき,該一つの固定長メモリブロックの他に上記固定長メモリ領域が全て開放された上記固定長メモリブロックが存在しない場合には該一つの固定長メモリブロックの固定長メモリ領域を元の可変長領域に変更せず,該一つの固定長メモリブロックの他に上記固定長メモリ領域が全て開放された上記固定長メモリブロックが存在する場合には該一つの固定長メモリブロックの固定長メモリ領域をチェーンの張り替えの実行前に元の可変長領域に変更する請求項1に記載のメモリ管理方式。When two or more fixed-length memory blocks are secured in the variable-length area on the memory, in any one fixed-length memory block of the two or more fixed-length memory blocks secured in the variable-length area When the fixed-length memory area is all released, and there is no fixed-length memory block whose fixed-length memory area is completely released in addition to the one fixed-length memory block, the one fixed-length memory block If the fixed-size memory area of the block is not changed to the original variable-length area, and there is the fixed-length memory block in which the fixed-size memory area is completely released, in addition to the one fixed-length memory block, 2. The memory management system according to claim 1, wherein the fixed-length memory areas of the two fixed-length memory blocks are changed to the original variable-length areas before execution of the chain replacement.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004206464A JP4176682B2 (en) | 2004-07-13 | 2004-07-13 | Memory management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004206464A JP4176682B2 (en) | 2004-07-13 | 2004-07-13 | Memory management method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006031187A JP2006031187A (en) | 2006-02-02 |
JP4176682B2 true JP4176682B2 (en) | 2008-11-05 |
Family
ID=35897489
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004206464A Expired - Fee Related JP4176682B2 (en) | 2004-07-13 | 2004-07-13 | Memory management method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4176682B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5977011B2 (en) * | 2011-09-29 | 2016-08-24 | 富士通株式会社 | Storage device, control device, and storage device control method |
-
2004
- 2004-07-13 JP JP2004206464A patent/JP4176682B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2006031187A (en) | 2006-02-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11573701B2 (en) | Memory device and host device | |
US9684462B2 (en) | Method and apparatus utilizing non-uniform hash functions for placing records in non-uniform access memory | |
US7610434B2 (en) | File recording apparatus | |
JP2020046963A (en) | Memory system and control method | |
US20060218347A1 (en) | Memory card | |
JP2019020788A (en) | Memory system and control method | |
JP2007523412A (en) | Memory allocation | |
CN108139972B (en) | Method and apparatus for managing memory fragmentation in hardware assisted data compression | |
CN111190537B (en) | Method and system for managing sequential storage disk in additional writing scene | |
WO2024099448A1 (en) | Memory release method and apparatus, memory recovery method and apparatus, and computer device and storage medium | |
US10482012B1 (en) | Storage system and method of operating thereof | |
KR100907477B1 (en) | Apparatus and method for managing index of data stored in flash memory | |
CN112650577A (en) | Memory management method and device | |
JP4311312B2 (en) | Time series data management method and program | |
JP4176682B2 (en) | Memory management method | |
JP4204405B2 (en) | Memory management method | |
JP2005099971A (en) | Input/output control method of virtual tape device | |
JP6243884B2 (en) | Information processing apparatus, processor, and information processing method | |
US9146859B2 (en) | Information processing apparatus, method, and program for improving use efficiency of a storage apparatus | |
JP2006039942A (en) | File management device in hierarchical storage system, and its file management method | |
JP4033829B2 (en) | Memory management system | |
JP2004046900A (en) | Control method for information processing system | |
JP5697403B2 (en) | Information processing apparatus, information processing method, and program | |
JP6276208B2 (en) | Memory system and program | |
JPH0869399A (en) | File management device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080527 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080717 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20080819 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20080820 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110829 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110829 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120829 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120829 Year of fee payment: 4 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120829 Year of fee payment: 4 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130829 Year of fee payment: 5 |
|
LAPS | Cancellation because of no payment of annual fees |