JP2000311110A - Memory managing device - Google Patents

Memory managing device

Info

Publication number
JP2000311110A
JP2000311110A JP11123179A JP12317999A JP2000311110A JP 2000311110 A JP2000311110 A JP 2000311110A JP 11123179 A JP11123179 A JP 11123179A JP 12317999 A JP12317999 A JP 12317999A JP 2000311110 A JP2000311110 A JP 2000311110A
Authority
JP
Japan
Prior art keywords
bitmap
memory
area
unit
search
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.)
Pending
Application number
JP11123179A
Other languages
Japanese (ja)
Inventor
Kenjiro Kurihara
謙二郎 栗原
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP11123179A priority Critical patent/JP2000311110A/en
Publication of JP2000311110A publication Critical patent/JP2000311110A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To accelerate bit map retrieving processing for memory management. SOLUTION: A maximum continuous empty area length managing means 104 compares the number of required bit map areas with a maximum continuous empty area length in a bit map and judges the presence/absence of an empty area capable of continuously securing the required bit map areas. When there is an empty area, a bit map secure managing means 110 calculates a position, where bit map securing operation is performed just before, inside the bit map. An empty bit map retrieving means 105 starts the retrieval of the empty area from that position. At such a time, when the number of required bit map areas exceeds one word, first of all, a word unit bit map retrieving means 108 retrieves the empty area for the unit of a word just for words in the required area size and next, a bit unit bit map retrieving means 109 retrieves the empty area for the unit of a bit concerning an excessive part or areas for one word or less.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、ビットマップを用
いてメモリ管理を行うシステムに係り、特に、空き領域
を捜すためのビットマップ検索処理を行うメモリ管理装
置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a system for performing memory management using a bitmap, and more particularly, to a memory management device for performing a bitmap search process for searching for a free area.

【0002】[0002]

【従来の技術】例えば、特開平8−221317には、
メモリの一部を固定長の複数のメモリセルに分割し、複
数のメモリセルにそれぞれビットを対応させるととも
に、当該メモリセルの使用中/未使用の状態を示すビッ
ト値として記憶するビットマップを管理データ領域に設
け、このビットマップを管理してメモリの確保/解放を
行うことにより、固定長/可変長メモリに関わらず効率
的なメモリ管理を実現する技術が開示されている。
2. Description of the Related Art For example, Japanese Patent Application Laid-Open No. Hei 8-221317 discloses that
A part of the memory is divided into a plurality of memory cells of a fixed length, bits are assigned to the plurality of memory cells, and a bit map that stores bit values indicating a used / unused state of the memory cells is managed. There is disclosed a technique for realizing efficient memory management irrespective of fixed-length / variable-length memory by providing a data area and managing this bitmap to secure / release the memory.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、従来技
術では、割り当てるためのメモリの総合サイズが大きく
なれば、それに比例してビットマップ領域も大きくな
る。したがって、当該ビットマップを検索する場合、先
頭から検索を行うので空き領域が後ろのほうにあるとき
などは、ビットマップ領域が大きくなればなるほど、結
果を取得するまでの時間が比例して大きくなってしま
う。また、ビットマップ検索なので、使用/未使用を切
り分けるためにビット単位で判断しているため、大きな
空きを必要とした場合、ビットマップ領域の大きさに比
例して判断回数が増える。このため、メモリの確保を行
うために未使用のビットを検索する処理に時間がかかる
という問題があった。
However, according to the prior art, as the total size of the memory to be allocated increases, the bitmap area also increases in proportion thereto. Therefore, when searching for the bitmap, since the search is performed from the beginning, when the empty area is located at the rear, the larger the bitmap area is, the longer the time until the result is obtained is proportionally increased. Would. In addition, since a bitmap search is used, a determination is made in units of bits in order to separate use / non-use. If a large space is required, the number of determinations increases in proportion to the size of the bitmap area. For this reason, there is a problem that it takes time to search for unused bits to secure a memory.

【0004】この発明は上述した事情に鑑みてなされた
もので、ビットマップ検索処理を高速化することができ
るメモリ管理装置を提供することを目的とする。
[0004] The present invention has been made in view of the above circumstances, and has as its object to provide a memory management device that can speed up bitmap search processing.

【0005】[0005]

【課題を解決するための手段】上述した問題点を解決す
るために、請求項1記載の発明では、メモリの一部を固
定長の複数のメモリセルに分割し、複数のメモリセルに
それぞれビットを対応させるとともに、当該メモリセル
の使用中/未使用の状態を示すビット値として記憶する
ビットマップを用いて、メモリの確保/解放を行うメモ
リ管理装置において、メモリ確保要求を受けると、要求
メモリサイズを管理するために必要とされる必要ビット
マップ領域数を算出する必要ビットマップ確保領域数計
算手段と、前記必要ビットマップ確保領域数計算手段に
より算出された必要ビットマップ領域数とビットマップ
内の最大連続空き領域長とを比べて、必要ビットマップ
数分連続した空き領域があるか否かを判別する最大連続
空き領域長管理手段と、ビットマップ確保操作を行った
ビットマップ内の最新位置を記憶するビットマップ検索
位置記憶手段と、前記必要ビットマップ領域数計算手段
により算出された必要ビットマップ領域数に基づいて、
前記ビットマップ検索位置記憶手段に記憶されている最
新位置からビットマップの検索を行う空きビットマップ
検索手段と、前記空きビットマップ検索手段により検索
された、前記必要ビットマップ領域数分のビットマップ
を確保するビットマップ確保手段とを具備することを特
徴とする。
According to the first aspect of the present invention, a part of a memory is divided into a plurality of fixed-length memory cells, and each of the plurality of memory cells has a bit. When a memory reservation request is received in a memory management device that reserves / releases a memory using a bitmap that stores a bit value indicating a used / unused state of the memory cell, Means for calculating the number of required bitmap areas required to manage the size, and a required bitmap area number calculating means for calculating the number of required bitmap areas and the number of required bitmap areas calculated by the required bitmap area number calculating means. The maximum continuous free area length management procedure that compares the maximum continuous free area length of the When a bitmap search position storage means for storing the latest position in the bitmap subjected to bitmap securing operation, based on the required bitmap area number calculated by the required bitmap area number calculation means,
An empty bitmap search unit for searching for a bitmap from the latest position stored in the bitmap search position storage unit, and a bitmap for the required bitmap area number searched by the empty bitmap search unit. Bitmap securing means for securing.

【0006】また、請求項2記載の発明では、請求項1
記載のメモリ管理装置において、前記空きビットマップ
検索手段は、前記必要ビットマップ領域数のうち、ワー
ドで割り切れる分についてはワード単位でビットマップ
を検索するワード単位ビットマップ検索手段と、前記必
要ビットマップ領域数のうち、ワードで割り切れない端
数分についてはビット単位でビットマップを検索するビ
ット単位ビットマップ検索手段とを具備し、前記必要ビ
ットマップ領域数に基づいて、前記ワード単位ビットマ
ップ検索手段と前記ビット単位ビットマップ検索手段と
を選択的に切り替えることを特徴とする。
Further, according to the invention described in claim 2, according to claim 1,
In the memory management device described above, the free bitmap search means includes a word unit bitmap search means for searching a bitmap in word units for a part of the required bitmap area that can be divided by a word, and the required bitmap area. A bit unit bit map search unit for searching a bit map in a bit unit for a fraction that is not divisible by a word of the number of regions, and the word unit bit map search unit based on the required number of bit map regions. It is characterized by selectively switching the bit unit bitmap search means.

【0007】また、請求項3記載の発明では、請求項1
または2記載のメモリ管理装置において、前記ビットマ
ップ確保手段は、前記必要ビットマップ領域数分のビッ
トマップを確保した後、該ビットマップのビットを操作
して使用中に変更することを特徴とする。
[0007] According to the third aspect of the present invention, the first aspect of the present invention.
3. The memory management device according to claim 2, wherein the bitmap securing unit secures the bitmaps for the required bitmap area number, and then manipulates the bits of the bitmap to change the bitmap during use. .

【0008】また、請求項4記載の発明では、請求項1
ないし3のいずれかに記載のメモリ管理装置において、
メモリ解放の要求を受け取ると、解放するメモリを管理
するのに必要とされる必要ビットマップ領域数を算出す
る必要ビットマップ解放領域数計算手段と、前記解放す
るメモリに基づいて、対応するビットマップの先頭位置
を割り出すビットマップ先頭位置算出手段と、前記必要
ビットマップ解放領域数計算手段により算出された必要
ビットマップ領域数に基づいて、前記ビットマップ先頭
位置算出手段により算出されたビットマップの先頭位置
から未使用の状態に変更するビットマップ解放手段と、
前記ビットマップ解放手段により解放されたビットマッ
プの位置を記憶するビットマップ解放監視手段とを具備
することを特徴とする。
Further, according to the invention described in claim 4, according to claim 1,
4. The memory management device according to any one of claims 1 to 3,
Upon receiving a memory release request, a required bitmap release area number calculating means for calculating a required bitmap area number required to manage the memory to be released, and a corresponding bitmap based on the released memory A bit map head position calculating means for calculating the head position of the bit map, and a head of the bit map calculated by the bit map head position calculating means based on the required bit map area number calculated by the required bit map release area number calculating means. Bitmap release means for changing from a position to an unused state;
A bitmap release monitoring unit that stores the position of the bitmap released by the bitmap release unit.

【0009】この発明では、必要ビットマップ確保領域
数計算手段は、メモリ確保要求を受けると、要求メモリ
サイズを管理するために必要とされる必要ビットマップ
領域数を算出する。最大連続空き領域長管理手段は、必
要ビットマップ領域数とビットマップ内の最大連続空き
領域長とを比べて、必要ビットマップ数分連続した空き
領域があるか否かを判別する。空きビットマップ検索手
段は、前記必要ビットマップ領域数に基づいて、ビット
マップ検索位置記憶手段に記憶されている最新位置から
ビットマップの検索を行う。そして、ビットマップ確保
手段は、前記空きビットマップ検索手段により検索され
た、前記必要ビットマップ領域数分のビットマップを確
保する。したがって、適切なビットマップの検索開始位
置を求め、また、ワード単位/ビット単位の検索を切り
分けることにより、メモリ管理のためのビットマップ検
索処理の高速化を図ることが可能となる。
In the present invention, upon receiving a memory reservation request, the required bitmap reserved area number calculating means calculates the required bitmap region number required to manage the required memory size. The maximum continuous free area length management means compares the required number of bitmap areas with the maximum continuous free area length in the bitmap to determine whether or not there is a continuous free area for the required number of bitmaps. The empty bitmap search means searches for a bitmap from the latest position stored in the bitmap search position storage means based on the required number of bitmap areas. Then, the bitmap securing means secures the bitmaps for the required bitmap area number searched by the empty bitmap searching means. Therefore, it is possible to speed up the bitmap search process for memory management by determining an appropriate bitmap search start position and separating the search in word units / bit units.

【0010】[0010]

【発明の実施の形態】以下、図面を用いて本発明の実施
の形態を説明する。 A.実施形態の構成 図1は、本発明の実施形態によるメモリ管理装置の構成
を示すブロック図である。図において、本発明のメモリ
管理のためのビットマップ検索高速化方式は、適切なビ
ットマップの検索開始位置を求め、また、ワード単位/
ビット単位の検索を切り分けることにより、メモリ管理
のためのビットマップ検索処理を高速化することを特徴
とする。メモリ確保手段100は、メモリ確保要求を受
け付ける。割り当てメモリアドレス算出手段101は、
確保されたビットマップに応じたメモリアドレスを算出
する。必要ビットマップ領域数計算手段103は、要求
されたメモリを管理するために必要なビットマップの領
域数を算出する。最大連続空き領域長管理手段104
は、ビットマップ領域中の連続空き領域の中で最大のも
のを管理する。
Embodiments of the present invention will be described below with reference to the drawings. A. Configuration of Embodiment FIG. 1 is a block diagram illustrating a configuration of a memory management device according to an embodiment of the present invention. In the figure, the bitmap search speed-up method for memory management of the present invention determines an appropriate bitmap search start position, and
The bitmap search processing for memory management is speeded up by separating the search in bit units. The memory securing unit 100 receives a memory securing request. The allocated memory address calculation means 101
Calculate the memory address according to the secured bitmap. The required bitmap area number calculation means 103 calculates the number of bitmap areas required to manage the requested memory. Maximum continuous free area length management means 104
Manages the largest continuous free area in the bitmap area.

【0011】空きビットマップ検索手段105は、後述
するワード単位ビットマップ検索手段108およびビッ
ト単位ビットマップ検索手段109の2つの検索手段を
場合に応じて切り分けて使用し、空きビットマップ領域
を検索する。ビットマップ検索位置通知手段106は、
ビットマップの検索開始位置を通知する。ビットマップ
確保手段107は、空きビットマップを使用中に変更す
る。ワード単位ビットマップ検索手段108は、ワード
単位でビットマップを検索する。ビット単位ビットマッ
プ検索手段109は、ビット単位でビットマップを検索
する。ビットマップ確保監視手段110は、ビットマッ
プを監視し、ビットマップの操作を行った最新位置を管
理する。メモリ111は、割り当て領域113と割当量
域を管理するためのビットマップ領域112とから構成
される。
The free bitmap search means 105 searches for a free bitmap area by using two search means, word unit bitmap search means 108 and bit unit bitmap search means 109, which will be described later. . The bitmap search position notification means 106
Notify the start position of bitmap search. The bitmap securing unit 107 changes the free bitmap to a used bitmap. The word unit bitmap search unit 108 searches a bitmap in word units. The bit unit bitmap search means 109 searches a bitmap in bit units. The bitmap securing monitoring unit 110 monitors the bitmap and manages the latest position where the operation of the bitmap has been performed. The memory 111 includes an allocation area 113 and a bitmap area 112 for managing an allocation amount area.

【0012】B.実施形態の動作 次に、本発明の実施形態の動作について、図1を参照し
てメモリ確保する場合について詳細に説明する。ここ
で、図2ないし図5は、本実施形態の動作を説明するた
めのフローチャートである。メモリ確保手段100は、
メモリ確保要求を受けて要求メモリサイズを必要ビット
マップ領域数計算手段103に通知する。必要ビットマ
ップ領域数計算手段103は、要求メモリサイズを管理
するために必要とされる必要ビットマップ領域数を求め
(ステップS1)、その値をメモリ確保手段100に返
却する。メモリ確保手段100は、上記必要ビットマッ
プ領域数を最大連続空き領域長管理手段104に通知す
る。
B. Next, the operation of the embodiment of the present invention will be described in detail with reference to FIG. Here, FIGS. 2 to 5 are flowcharts for explaining the operation of the present embodiment. The memory securing means 100
Upon receiving the memory securing request, the required memory size is notified to the required bitmap area number calculating means 103. The required bitmap area number calculation means 103 calculates the number of required bitmap areas required to manage the required memory size (step S1), and returns the value to the memory securing means 100. The memory reserving unit 100 notifies the required number of bitmap areas to the maximum continuous free area length managing unit 104.

【0013】最大連続空き領域長管理手段104は、メ
モリ確保手段100から通知された必要ビットマップ領
域数とビットマップ内の最大連続空き領域長とを比べて
(ステップS2)、必要ビットマップ領域数分を連続し
て確保できる空き領域の有無をメモリ確保手段100に
通知する。メモリ確保手段100は、ビットマップ内に
必要な空き領域がなければ、他のメモリ領域を検索対象
とすべく、ビットマップ確保手段107に通知する。ビ
ットマップ確保手段107は、空きビットマップを使用
中に変更する(ステップS3)。
The maximum continuous free area length managing means 104 compares the required number of bitmap areas notified from the memory securing means 100 with the maximum continuous free area length in the bitmap (step S2), and determines the required number of bitmap areas. The presence / absence of a free area that can be continuously secured is notified to the memory securing unit 100. If there is no necessary free area in the bitmap, the memory securing unit 100 notifies the bitmap securing unit 107 to search another memory area. The bitmap securing unit 107 changes the empty bitmap to “in use” (step S3).

【0014】一方、空き領域があれば、ビットマップ確
保監視手段110は、ビットマップ確保操作を行ったビ
ットマップ内の最新位置を算出し(ステップS4)、ビ
ットマップ検索位置通知手段106を経由して空きビッ
トマップ検索手段105に通知する。空きビットマップ
検索手段105は、必要ビットマップ領域数に応じてワ
ード単位ビットマップ検索手段108およびビット単位
ビットマップ検索手段109を切り替えて、ビットマッ
プ確保監視手段110から通知を受けた最新位置からビ
ットマップの検索を行う(ステップS5)。ここで、必
要に応じて切り替えるのは、必要なビットマップ領域サ
イズが1ワードを越える場合には、必要領域サイズのワ
ード数分だけワード単位で空き領域を検索し(ステップ
S7)、余った分または1ワード以下の場合には、ビッ
ト単位で空き領域を検索するためである(ステップS
8)。
On the other hand, if there is a free area, the bitmap securing monitoring means 110 calculates the latest position in the bitmap for which the bitmap securing operation has been performed (step S4), and passes through the bitmap search position notifying means 106. To the empty bitmap search means 105. The empty bitmap search means 105 switches between the word-based bitmap search means 108 and the bit-based bitmap search means 109 according to the required number of bitmap areas, and switches from the latest position notified by the bitmap securing monitoring means 110 A map search is performed (step S5). Here, switching is performed as necessary, when the required bitmap area size exceeds one word, an empty area is searched in word units by the number of words of the required area size (step S7), and the remaining area is searched. Or, in the case of one word or less, this is for searching for an empty area in bit units (step S).
8).

【0015】ワード単位ビットマップ検索手段108
は、まず、必要ビットマップ領域数をワードにより除算
することにより、その商(必要ワード数)を求める(ス
テップS10)。次に、必要とする連続した空き領域
(必要ワード数)が見つかったか否かを判断し(ステッ
プS11)、見つからなければ、次のワードへ検索対象
をずらす(ステップS12)。そして、当該ワードが未
使用であるか否かを判断し(ステップS13)、未使用
でなければ、ステップS17へ戻り、次のワードへ検索
対象をずらしながら、未使用のワードを探す。そして、
未使用のワードが見るかると、ステップS16へ戻り、
当該ワードから連続した空き領域(必要ワード数)を見
つける。そして、必要とする連続した空き領域(必要ワ
ード数)が見つかると、見つかった空き領域がワードで
割り切れる大きさであるか否かを判断する(ステップS
14)。そして、割り切れなければ、すなわち余りが生
じた場合には、ビット単位検索処理へ移行する(ステッ
プS15)。一方、割り切れれば、すなわち余りが生じ
ない場合には、見つかったワードフラグを使用中
(「1」)にし(ステップS16)、後述するメモリ割
り当て処理へ進む(ステップS17)。
Word unit bitmap search means 108
First, the quotient (the required number of words) is obtained by dividing the required number of bitmap areas by the words (step S10). Next, it is determined whether or not a necessary continuous free area (the required number of words) is found (step S11). If not found, the search target is shifted to the next word (step S12). Then, it is determined whether or not the word is unused (step S13). If not, the process returns to step S17 to search for an unused word while shifting the search target to the next word. And
When an unused word is seen, the process returns to step S16,
A continuous free area (the required number of words) is found from the word. Then, when a necessary continuous free area (the required number of words) is found, it is determined whether or not the found free area is a size divisible by words (step S).
14). If it is not divisible, that is, if there is a remainder, the process proceeds to the bit unit search process (step S15). On the other hand, if the word flag is divisible, that is, if there is no remainder, the found word flag is set in use ("1") (step S16), and the process proceeds to a memory allocation process described later (step S17).

【0016】また、ビット単位ビットマップ検索手段1
09は、必要とする連続した空き領域(ビット単位)が
見つかったか否かを判断し(ステップS20)、連続し
た空き領域が見つからなければ、次のビットへ検索対象
をずらし(ステップS21)、当該ビットが未使用か否
かを判断する(ステップS22)。ここで、当該ビット
が未使用でなければ、ステップS11に戻り、次のビッ
トへ検索対象をずらし、未使用のビットを探す。そし
て、未使用ビットが見つかると、ステップS10に戻
り、当該ビットから連続した空き領域を見つける。そし
て、必要とする連続した空き領域が見つかると、見つか
ったビットフラグを使用中(「1」)にし(ステップS
23)、後述するメモリ割り当て処理へ進む(ステップ
S24)。
Further, a bit unit bit map search means 1
In step 09, it is determined whether or not a necessary continuous free area (in units of bits) is found (step S20). If no continuous free area is found, the search target is shifted to the next bit (step S21). It is determined whether the bit is unused (step S22). If the bit is not unused, the process returns to step S11 to shift the search target to the next bit and search for an unused bit. When an unused bit is found, the process returns to step S10 to find a continuous free area from the bit. Then, when a necessary continuous free area is found, the found bit flag is used ("1") (step S).
23), and proceed to a memory allocation process described later (step S24).

【0017】メモリ確保手段100は、必要な連続空き
ビットマップが見つかると、ビットマップ確保手段10
7にビットマップの位置を通知する。ビットマップ確保
手段107は、通知された位置のビットマップを確保す
べく、見つかったビットマップのフラグを使用中
(「1」)に変更するとともに、ビットマップ確保監視
手段110および割り当てメモリアドレス算出手段10
1に対して新たに確保したビットマップの位置を通知す
る。ビットマップ確保監視手段110は、今回変更した
ビットマップの位置を記憶する(ステップS31)。割
り当てメモリアドレス算出手段101は、通知されたビ
ットマップの位置から割り当てメモリアドレスを算出し
(ステップS32)、メモリ要求者に対して割り当てア
ドレスを返却する(ステップS33)。
When the necessary continuous free bitmap is found, the memory reserving means 100
7 is notified of the position of the bitmap. The bitmap securing unit 107 changes the flag of the found bitmap to “in use” (“1”) in order to secure the bitmap at the notified position, and monitors the bitmap securing monitoring unit 110 and the allocated memory address calculating unit. 10
1 is notified of the newly secured bitmap position. The bitmap securing monitoring unit 110 stores the position of the bitmap changed this time (step S31). The allocated memory address calculating means 101 calculates the allocated memory address from the notified bit map position (step S32), and returns the allocated address to the memory requester (step S33).

【0018】以上の処理により、メモリ割り当てのため
のビットマップ検索処理の高速化を実現することが可能
となる。
With the above processing, it is possible to realize a high-speed bitmap search processing for memory allocation.

【0019】C.具体例 次に、本実施形態の具体例について図面を参照して詳細
に説明する。ここで、図6は、本実施形態の具体例を説
明するための概念図である。図において、メモリ600
は、ビットマップ領域601と割り当て用領域602と
から構成される。また、検索開始位置のビットマップ
A、メモリが割り当てられるビットマップB、Cとから
構成される。次に、図1と図6を参照して、ビットマッ
プ検索開始位置がビットマップAの先頭に位置している
場合に、必要なビットマップが6バイトであるメモリ要
求がされた場合について詳細に説明する。ただし、ビッ
トマップA、B、Cは、各々、説明を簡単にするため1
ワード単位とする。
C. Specific Example Next, a specific example of the present embodiment will be described in detail with reference to the drawings. Here, FIG. 6 is a conceptual diagram for explaining a specific example of the present embodiment. In the figure, a memory 600
Is composed of a bitmap area 601 and an allocation area 602. Further, it is composed of a bitmap A at the search start position and bitmaps B and C to which memories are allocated. Next, with reference to FIG. 1 and FIG. 6, a detailed description will be given of a case where a memory request in which the required bitmap is 6 bytes is made when the bitmap search start position is located at the head of the bitmap A. explain. However, each of the bitmaps A, B, and C is 1 for ease of explanation.
Word unit.

【0020】メモリ確保手段100は、メモリ確保の要
求を受けると、要求されたサイズのメモリを管理するの
に必要なビットマップの領域数を求めるため、必要ビッ
トマップ領域数計算手段103を用いる。この場合、必
要なビットマップの領域数は6バイトである。メモリ確
保手段100は、最大連続空き領域長と先に求めた6バ
イトとを比較する。この場合、最大連続空き領域長のほ
うが大きいため、当該ビットマップ領域でメモリの確保
が行えると判断し、処理を続行する。但し、当該ビット
マップに確保できないと判断した場合には、別のビット
マップを含むメモリの検索を行う。ビットマップでメモ
リを確保できると判断したメモリ確保手段100は、空
きビットマップ検索手段105を通じて空きビットマッ
プの検索を行う。
Upon receipt of the memory reservation request, the memory reservation unit 100 uses the required bitmap region number calculation unit 103 to determine the number of bitmap regions required for managing the memory of the requested size. In this case, the required number of bitmap areas is 6 bytes. The memory securing means 100 compares the maximum continuous free area length with the previously obtained 6 bytes. In this case, since the maximum continuous free area length is longer, it is determined that the memory can be secured in the bitmap area, and the processing is continued. However, if it is determined that it cannot be secured in the bitmap, a search for a memory including another bitmap is performed. The memory allocating unit 100 that has determined that the memory can be allocated by the bitmap searches the empty bitmap through the empty bitmap searching unit 105.

【0021】空きビットマップ検索手段105は、ま
ず、必要ビットマップ領域数が1ワードより大きいか否
かを判断し、大きい場合には、その商を求める。この場
合、必要ビットマップ領域数が6バイトのため、1ワー
ド(4バイト)より大きく、6/4の商は「1」とな
り、余りが「2」となる。このため、空きビットマップ
検索手段105は、ワード単位ビットマップ検索手段1
08に1ワードの連続空き領域の検索要求を行い、見つ
かった領域に連続して2バイトの空き領域があるか否か
をビット単位ビットマップ検索手段109を用いて検索
する。
The free bitmap search means 105 first determines whether or not the number of necessary bitmap areas is larger than one word, and if so, finds the quotient. In this case, since the required number of bitmap areas is 6 bytes, it is larger than one word (4 bytes), the quotient of 6/4 is “1”, and the remainder is “2”. For this reason, the empty bitmap search means 105 is a word unit bitmap search means 1
At 08, a search request for a one-word continuous free area is made, and a search is made using the bit-unit bitmap search means 109 to determine whether or not there is a two-byte free area in the found area.

【0022】ワード単位ビットマップ検索手段108の
動作を具体的に説明すると、図示する検索開始位置から
1ワード(A)が未使用か否か(すべて「0」か否か)
のチェックを行う。Aの値は、「00000000」で
はなく、「00001111」であるので、空き領域と
は判断されず、次の1ワード(B)を検索する。Bの値
は、「00000000」であるので、空き領域と判断
され、残り2バイトの使用の有無を調べるために、処理
は、ビット単位ビットマップ検索手段109に移行され
る。ビット単位ビットマップ検索手段109は、次の1
ワード(C)の先頭からビット単位で空き領域の有無を
調査する。その結果、図示する実線枠で囲んだ部分が連
続した6バイトの空き領域であると判断され、ビットマ
ップ確保手段107に通知される。
The operation of the word unit bitmap searching means 108 will be described in detail. One word (A) from the illustrated search start position is unused (whether it is all "0").
Check. Since the value of A is not “00000000” but “000011111”, it is not determined to be a free area, and the next one word (B) is searched. Since the value of B is “00000000”, it is determined that the area is a free area, and the processing is shifted to the bit unit bitmap search means 109 to check whether or not the remaining two bytes are used. The bit unit bitmap search means 109 outputs the following 1
The presence / absence of an empty area is checked bit by bit from the beginning of the word (C). As a result, the portion surrounded by the solid line frame shown in the drawing is determined to be a continuous 6-byte free area, and the bitmap securing means 107 is notified.

【0023】ビットマップ通知手段107は、先に見つ
けた6バイトの空き領域を使用中に変更し(「0000
0000」→「11111111」)、ビットマップ確
保監視手段110は、今回変更したビットマップの位置
を記憶する。ビットマップ確保手段107からビットマ
ップの位置を受け取った割り当てメモリアドレス算出手
段101は、割り当てる実メモリアドレスをビットマッ
プから算出し、メモリ確保要求者に求めたアドレスを返
却する。
The bitmap notifying means 107 changes the previously found 6-byte free area to in use ("0000").
0000 "→" 11111111 "), the bitmap securing monitoring means 110 stores the position of the bitmap changed this time. The allocated memory address calculating means 101 having received the position of the bitmap from the bitmap securing means 107 calculates the actual memory address to be allocated from the bitmap, and returns the requested address to the memory securing requester.

【0024】D.他の実施形態 次に、本発明の他の実施形態について説明する。ここ
で、図7は、本発明の他の実施形態によるメモリ管理装
置の構成を示すブロック図である。本他の実施形態で
は、解放した割り当てメモリに対応するビットマップ領
域の場所を記憶することにより、メモリ割り当て/解放
のためのビットマップ検索処理をより高速化することを
特徴とする。図において、メモリ解放手段700、必要
ビットマップ領域数計算手段701、最大連続空き領域
長管理手段702、ビットマップ先頭位置算出手段70
3、ビットマップ解放手段704、ビットマップ解放監
視手段705、および、割り当て領域708と当該領域
を管理するためのビットマップ領域707から成るメモ
リ706を備えている。
D. Another Embodiment Next, another embodiment of the present invention will be described. Here, FIG. 7 is a block diagram showing a configuration of a memory management device according to another embodiment of the present invention. The other embodiment is characterized in that the bitmap search processing for memory allocation / release is further accelerated by storing the location of the bitmap area corresponding to the released allocation memory. In the figure, memory release means 700, required bitmap area number calculation means 701, maximum continuous free area length management means 702, bitmap head position calculation means 70
3, a bitmap release unit 704, a bitmap release monitoring unit 705, and a memory 706 including an allocation area 708 and a bitmap area 707 for managing the area.

【0025】次に、本発明の他の実施の形態の動作につ
いて、図7を参照してメモリを解放する場合について詳
細に説明する。メモリ解放手段700は、メモリ解放の
要求を受け取ると、解放するメモリを管理するのに必要
なビットマップ領域数を、必要ビットマップ領域数計算
手段701を用いて求める。次に、メモリ解放手段70
0は、ビットマップ先頭位置算出手段703を用いて、
解放するメモリからそのメモリを管理しているビットマ
ップの先頭位置を割り出し、該ビットマップの先頭位置
をビットマップ解放手段704に通知する。ビットマッ
プ解放手段704は、ビットマップ領域の当該ビットマ
ップを未使用の状態に変更するとともに、ビットマップ
解放監視手段705にビットマップの位置を通知する。
ビットマップ解放監視手段705は、通知を受けたビッ
トマップの位置を記憶する。
Next, the operation of another embodiment of the present invention will be described in detail with reference to FIG. Upon receiving the memory release request, the memory release unit 700 uses the required bitmap region number calculation unit 701 to determine the number of bitmap areas required to manage the memory to be released. Next, the memory release means 70
0 is calculated using the bitmap head position calculation means 703.
The head position of the bitmap managing the memory is determined from the memory to be released, and the head position of the bitmap is notified to the bitmap releasing means 704. The bitmap release unit 704 changes the bitmap in the bitmap area to an unused state, and notifies the bitmap release monitoring unit 705 of the position of the bitmap.
The bitmap release monitoring unit 705 stores the position of the notified bitmap.

【0026】メモリ解放手段700は、領域の解放が終
了すると、先に求めたビットマップ数を最大連続空き領
域長管理手段702に通知する。最大連続空き領域長管
理手段702は、現在の最大連続空き領域長と通知され
たビットマップ数とを比べて、通知されたビットマッ
プ、つまり解放されたばかりのビットマップ数のほうが
大きい場合には、その値を記憶する。
When the release of the area is completed, the memory release means 700 notifies the maximum continuous free area length management means 702 of the previously obtained bitmap number. The maximum continuous free area length managing means 702 compares the current maximum continuous free area length with the notified bitmap number, and when the notified bitmap, that is, the just released bitmap number, is larger. Store that value.

【0027】これにより、メモリ割り当て/解放のため
のビットマップ検索処理をより高速化することが可能と
なる。
As a result, it is possible to further speed up the bitmap search processing for memory allocation / release.

【0028】[0028]

【発明の効果】以上説明したように、本発明によれば、
メモリを管理するためのビットマップの空き領域を捜す
ためのビットマップ検索処理において、直前にビットマ
ップの操作を行った場所の近傍に必要なサイズの領域が
空いている可能性が高いことに着目し、直前にビットマ
ップ操作を行った場所から検索の開始を行うとともに、
必要なビットマップのサイズが1ワード以上ならば、ワ
ード単位に検索を行うので、メモリ割り当てのためのビ
ットマップ検索処理を高速化することができるという利
点が得られる。
As described above, according to the present invention,
In the bitmap search process for searching for a free area of the bitmap for managing the memory, notice that there is a high possibility that an area of the required size is vacant near the place where the bitmap operation was performed immediately before. And start the search from the place where you just performed the bitmap operation,
If the required bitmap size is one word or more, since the search is performed in word units, there is an advantage that the bitmap search process for memory allocation can be speeded up.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 本発明の実施形態によるビットマップ検索高
速化方式を実現するためのメモリ管理装置の構成を示す
ブロック図である。
FIG. 1 is a block diagram showing a configuration of a memory management device for realizing a high-speed bitmap search method according to an embodiment of the present invention.

【図2】 本実施形態の動作を説明するためのフローチ
ャートである。
FIG. 2 is a flowchart for explaining the operation of the present embodiment.

【図3】 本実施形態の動作を説明するためのフローチ
ャートである。
FIG. 3 is a flowchart for explaining the operation of the present embodiment.

【図4】 本実施形態の動作を説明するためのフローチ
ャートである。
FIG. 4 is a flowchart for explaining the operation of the present embodiment.

【図5】 本実施形態の動作を説明するためのフローチ
ャートである。
FIG. 5 is a flowchart for explaining the operation of the present embodiment.

【図6】 具体的な動作を説明するための概念図であ
る。
FIG. 6 is a conceptual diagram for explaining a specific operation.

【図7】 本発明の他の実施形態によるビットマップ検
索高速化方式を実現するためのメモリ管理装置の構成を
示すブロックである。
FIG. 7 is a block diagram showing a configuration of a memory management device for realizing a high speed bitmap search method according to another embodiment of the present invention.

【符号の説明】[Explanation of symbols]

100 メモリ確保手段 101 割り当てメモリアドレス算出手段 103 必要ビットマップ領域数計算手段(必要ビット
マップ確保領域数計算手段) 104 最大連続空き領域長管理手段 105 空きビットマップ検索手段 106 ビットマップ検索位置通知手段(ビットマップ
検索位置記憶手段) 107 ビットマップ確保手段 108 ワード単位ビットマップ検索手段 109 ビット単位ビットマップ検索手段 110 ビットマップ確保監視手段(ビットマップ検索
位置記憶手段) 600 メモリA 601 ビットマップ 602 割り当て用領域 700 メモリ解放手段 701 必要ビットマップ領域数計算手段(必要ビット
マップ解放領域数計算手段) 702 最大連続空き領域長管理手段 703 ビットマップ先頭位置算出手段 704 ビットマップ解放手段 705 ビットマップ解放監視手段 706 メモリ 707 ビットマップ領域 708 割り当て領域
Reference Signs List 100 memory securing means 101 allocated memory address calculating means 103 necessary bitmap area number calculating means (necessary bitmap securing area number calculating means) 104 maximum continuous free area length managing means 105 free bitmap searching means 106 bitmap searching position notifying means ( Bitmap search position storage means) 107 Bitmap securing means 108 Word unit bitmap search means 109 Bit unit bitmap search means 110 Bitmap reservation monitoring means (Bitmap search position storage means) 600 Memory A 601 Bitmap 602 Allocation area 700 memory release means 701 required bitmap area number calculation means (necessary bitmap release area number calculation means) 702 maximum continuous free area length management means 703 bitmap head position calculation means 704 bits -Up release means 705 bitmap release monitoring means 706 memory 707 bitmap area 708 assigned area

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 メモリの一部を固定長の複数のメモリセ
ルに分割し、複数のメモリセルにそれぞれビットを対応
させるとともに、当該メモリセルの使用中/未使用の状
態を示すビット値として記憶するビットマップを用い
て、メモリの確保/解放を行うメモリ管理装置におい
て、 メモリ確保要求を受けると、要求メモリサイズを管理す
るために必要とされる必要ビットマップ領域数を算出す
る必要ビットマップ確保領域数計算手段と、 前記必要ビットマップ確保領域数計算手段により算出さ
れた必要ビットマップ領域数とビットマップ内の最大連
続空き領域長とを比べて、必要ビットマップ数分連続し
た空き領域があるか否かを判別する最大連続空き領域長
管理手段と、 ビットマップ確保操作を行ったビットマップ内の最新位
置を記憶するビットマップ検索位置記憶手段と、 前記必要ビットマップ領域数計算手段により算出された
必要ビットマップ領域数に基づいて、前記ビットマップ
検索位置記憶手段に記憶されている最新位置からビット
マップの検索を行う空きビットマップ検索手段と、 前記空きビットマップ検索手段により検索された、前記
必要ビットマップ領域数分のビットマップを確保するビ
ットマップ確保手段とを具備することを特徴とするメモ
リ管理装置。
1. A memory part is divided into a plurality of fixed-length memory cells, and a bit is assigned to each of the plurality of memory cells, and is stored as a bit value indicating a used / unused state of the memory cell. In a memory management device that allocates / releases memory using a bitmap to be allocated, when a memory allocation request is received, a required bitmap area required to manage the required memory size is calculated. Comparing the required bitmap area number calculated by the required bitmap securing area number calculating means with the maximum continuous free area length in the bitmap, there is a free area continuous by the required bitmap number. Means for managing the maximum continuous free area length for determining whether or not the bit is the latest position in the bitmap for which the bitmap securing operation has been performed. Based on the number of required bitmap areas calculated by the required number of bitmap areas calculated by the required bitmap area number calculating means, and performs a search for a bitmap from the latest position stored in the bitmap search position storage means. A memory management device comprising: a bitmap search unit; and a bitmap securing unit that secures bitmaps for the required number of bitmap areas searched by the empty bitmap search unit.
【請求項2】 前記空きビットマップ検索手段は、 前記必要ビットマップ領域数のうち、ワードで割り切れ
る分についてはワード単位でビットマップを検索するワ
ード単位ビットマップ検索手段と、 前記必要ビットマップ領域数のうち、ワードで割り切れ
ない端数分についてはビット単位でビットマップを検索
するビット単位ビットマップ検索手段とを具備し、 前記必要ビットマップ領域数に基づいて、前記ワード単
位ビットマップ検索手段と前記ビット単位ビットマップ
検索手段とを選択的に切り替えることを特徴とする請求
項1記載のメモリ管理装置。
2. An empty bitmap search unit, comprising: a word-unit bitmap search unit for searching a bitmap in word units for a portion of the required bitmap region that is divisible by a word; A bitmap search unit for searching a bitmap in bit units for a fraction that is not divisible by a word, wherein the word unit bitmap search unit and the bit are searched based on the required number of bitmap areas. 2. The memory management device according to claim 1, wherein the memory management device selectively switches between unit bitmap search means.
【請求項3】 前記ビットマップ確保手段は、前記必要
ビットマップ領域数分のビットマップを確保した後、該
ビットマップのビットを操作して使用中に変更すること
を特徴とする請求項1または2記載のメモリ管理装置。
3. The bitmap securing means, after securing bitmaps for the required bitmap area number, manipulates bits of the bitmap to change the bitmap during use. 3. The memory management device according to 2.
【請求項4】 メモリ解放の要求を受け取ると、解放す
るメモリを管理するのに必要とされる必要ビットマップ
領域数を算出する必要ビットマップ解放領域数計算手段
と、 前記解放するメモリに基づいて、対応するビットマップ
の先頭位置を割り出すビットマップ先頭位置算出手段
と、 前記必要ビットマップ解放領域数計算手段により算出さ
れた必要ビットマップ領域数に基づいて、前記ビットマ
ップ先頭位置算出手段により算出されたビットマップの
先頭位置から未使用の状態に変更するビットマップ解放
手段と、 前記ビットマップ解放手段により解放されたビットマッ
プの位置を記憶するビットマップ解放監視手段とを具備
することを特徴とする請求項1ないし3のいずれかに記
載のメモリ管理装置。
4. Upon receiving a memory release request, a required bitmap release area number calculating means for calculating a required bitmap area number required to manage the memory to be released; and A bitmap head position calculating means for calculating a head position of a corresponding bitmap; and a required bitmap area number calculated by the required bitmap release area number calculating means. Bitmap releasing means for changing from the head position of the bitmap to an unused state, and bitmap release monitoring means for storing the position of the bitmap released by the bitmap releasing means. The memory management device according to claim 1.
JP11123179A 1999-04-28 1999-04-28 Memory managing device Pending JP2000311110A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11123179A JP2000311110A (en) 1999-04-28 1999-04-28 Memory managing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11123179A JP2000311110A (en) 1999-04-28 1999-04-28 Memory managing device

Publications (1)

Publication Number Publication Date
JP2000311110A true JP2000311110A (en) 2000-11-07

Family

ID=14854154

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11123179A Pending JP2000311110A (en) 1999-04-28 1999-04-28 Memory managing device

Country Status (1)

Country Link
JP (1) JP2000311110A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1146490A (en) * 1997-07-28 1999-02-16 Matsushita Electric Works Ltd Motor rotational speed control circuit
JP2014238767A (en) * 2013-06-10 2014-12-18 カシオ計算機株式会社 Memory controller, memory control method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1146490A (en) * 1997-07-28 1999-02-16 Matsushita Electric Works Ltd Motor rotational speed control circuit
JP2014238767A (en) * 2013-06-10 2014-12-18 カシオ計算機株式会社 Memory controller, memory control method, and program

Similar Documents

Publication Publication Date Title
US6381676B2 (en) Cache management for a multi-threaded processor
JP4323637B2 (en) Memory allocation method, memory allocation device, and storage medium
EP3306477B1 (en) Storage device and block storage method based on the storage device
CN106681829B (en) Memory management method and system
CN108038002B (en) Embedded software memory management method
US20130208596A1 (en) Congestion management in a network
US8275968B2 (en) Managing unallocated storage space using extents and bitmaps
JPH0546447A (en) Idle area retrieving method
US6473842B1 (en) Virtual memory managing system for managing swap-outs by page units and a batch swap-out by task units
GB2446071A (en) Method of dynamic memory management in an object oriented system
CN110780823B (en) Small object memory management method, small object memory management device, electronic equipment and computer readable medium
CN106445835A (en) Memory allocation method and apparatus
US20050268049A1 (en) Dynamic memory management
US8176291B1 (en) Buffer management architecture
JP2000311110A (en) Memory managing device
JP2002366424A (en) Memory management system
CN115292373A (en) Method and device for segmenting data block
CN109284234A (en) A kind of memory address allocation method and system
JPH06309197A (en) Storage area management system
CN116991855B (en) Hash table processing method, device, equipment, medium, controller and solid state disk
US20160292096A1 (en) Packet processing system, method and device to optimize packet buffer space
JPH06119234A (en) Memory managing device
JPH10124363A (en) Sequential index managing method
CN113867925A (en) Memory management method, device, equipment and storage medium
JPH08249225A (en) Memory management device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20020226