JP2007264692A - Memory management method, device and program - Google Patents

Memory management method, device and program Download PDF

Info

Publication number
JP2007264692A
JP2007264692A JP2006084910A JP2006084910A JP2007264692A JP 2007264692 A JP2007264692 A JP 2007264692A JP 2006084910 A JP2006084910 A JP 2006084910A JP 2006084910 A JP2006084910 A JP 2006084910A JP 2007264692 A JP2007264692 A JP 2007264692A
Authority
JP
Japan
Prior art keywords
bitmap
area
memory
search
unit
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
JP2006084910A
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 JP2006084910A priority Critical patent/JP2007264692A/en
Publication of JP2007264692A publication Critical patent/JP2007264692A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To prevent insufficient memory or reduce the load of system resources in processing for performing memory management by use of a bit map. <P>SOLUTION: A maximum continuous free space length management part 13 inspects whether a continuous space for a necessary bit map number is present or not by comparing a necessary bit map area size with a maximum continuous free space length in a bit map area 101. When a necessary space is present in the bit map, a space bit map retrieval part 14 performs retrieval of the bit map area by use of a bit unit bit map retrieval part 15. When a necessary space bit map is found, a memory ensuring part 11 notifies its continuous space area length and location to an ensuring candidate location area management part 16, and when a plurality of continuous space areas necessary for memory ensuring is found, the part 11 compares the continuous space area length of the already found location with the continuous space area length of the second and following ones, and substitutes the content of the ensuring location area management part 16 by the smaller one. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、ビットマップを使用してメモリ管理を行う方法に関する。     The present invention relates to a method for performing memory management using a bitmap.

特許文献1は、空きメモリ確保時にメモリを管理するビットマップを検索する場合、必要なビットマップ領域数に応じてワード単位またはビット単位を切り替えることにより、1ワード以上のビットマップ領域を確保する場合の検索処理の高速化を実現している。
特開2000−311110号公報
In Patent Document 1, when searching for a bitmap for managing a memory when free memory is secured, a bitmap area of one word or more is secured by switching word units or bit units according to the number of necessary bitmap areas. Speeds up the search process.
JP 2000-311110 A

上述した従来の方法は、最初に見つけた空き領域に無条件に確保してしまうため、不用意に大きな領域を細切れで使用してしまい、その結果、メモリの断片化が発生し、空き領域の合計は十分な量があるのに、メモリの確保ができない状態となり、メモリ不足が発生してしまう、という問題があった。   The above-described conventional method unconditionally secures the first free space that is found, so that a large area is inadvertently used in pieces, resulting in memory fragmentation, Although the total amount is sufficient, there is a problem that memory cannot be secured, resulting in insufficient memory.

本発明の目的は、メモリの断片化を防ぐことにより、使用メモリの削減を実現するメモリ管理方法、装置、およびプログラムを提供することにある。   An object of the present invention is to provide a memory management method, an apparatus, and a program for realizing reduction of used memory by preventing fragmentation of memory.

本発明のメモリ管理方法は、メモリ確保手段と、割り当てメモリアドレス算出手段と、必要ビットマップ領域数計算手段と、最大連続空き領域長管理手段と、空きビットマップ検索手段と、ビットマップ検索位置通知手段と、ビットマップ確保手段と、ビット単位ビットマップ検索手段と、確保候補場所領域管理手段とを有するメモリ管理装置を用いて、ビットマップ領域と割り当て領域を有するメモリを管理する方法であって、
メモリ確保手段が、メモリ確保要求を受けて要求メモリサイズを必要ビットマップ領域数計算手段に通知するステップと、
必要ビットマップ領域数計算手段が、要求メモリサイズを管理するために必要なビットマップ領域サイズを求め、その値をメモリ確保手段に返却するステップと、
最大連続空き領域長管理手段が、メモリ確保手段から通知された必要ビットマップ領域サイズを前記ビットマップ領域内の最大連続空き領域長と比べて、必要ビットマップ領域サイズ分連続した空きの有無をメモリ確保手段に通知するステップと、
必要ビットマップ領域サイズ分連続した空きがある場合、メモリ確保手段からの通知を受けて、空きビットマップ検索手段が、ビット単位ビットマップ検索手段を用いて前記ビットマップ検索位置通知手段から通知された検索位置からビットマップ領域の検索を行い、必要な連続空きビットマップを見つけたら、メモリ確保手段に、その連続空き領域サイズと場所を通知するステップと
メモリ確保手段が、ビットマップ領域の検索が完了した地点で、確保に必要な連続空きビットマップが前記ビットマップ領域内で1つの場合、その連続空き領域サイズとその場所を、複数の場合、最小の連続空き領域長とその場所を前記確保候補場所領域管理手段に通知するステップと、
メモリ確保手段が、確保候補場所領域管理手段が記憶している場所をビットマップ確保手段に通知するステップと、
ビットマップ確保手段が、ビットマップ領域の通知された場所の確保を行うと共に、割り当てメモリアドレス算出手段に対して新たに確保したビットマップ領域の位置を通知するステップと、
割り当てメモリアドレス算出手段が、通知されたビットマップ領域の位置から割り当てメモリアドレスの算出を行い、メモリ要求者に対して割り当てアドレスを返却するステップと、
を有し、
必要ビットマップ領域サイズ分連続して空きがない場合、他のメモリを対象として前記最大連続空き領域長管理手段が行うステップから処理を繰り返す。
The memory management method of the present invention includes a memory securing means, an allocated memory address calculating means, a required bitmap area number calculating means, a maximum continuous free area length managing means, a free bitmap search means, and a bitmap search position notification. A memory management apparatus having a means, a bitmap securing means, a bit-unit bitmap search means, and a securing candidate location area management means, and managing a memory having a bitmap area and an allocation area,
A step of notifying a required memory size to a required bitmap area calculating means in response to a memory securing request;
A required bitmap area number calculating means obtains a bitmap area size necessary for managing the requested memory size, and returns the value to the memory securing means;
The maximum continuous free area length management means compares the required bitmap area size notified from the memory securing means with the maximum continuous free area length in the bitmap area, and determines whether there is continuous free space for the required bitmap area size. A step of notifying the securing means;
When there is continuous free space for the required bitmap area size, a notification from the memory securing means is received, and the free bitmap search means is notified from the bitmap search position notification means using the bit unit bitmap search means. When the bitmap area is searched from the search position and the necessary continuous free bitmap is found, the step of notifying the memory securing means of the size and location of the continuous free area and the memory securing means complete the bitmap area search. If the number of consecutive free bitmaps required for reservation is one in the bitmap area, the size of the continuous free area and its location are used. Notifying the location area management means;
A step of notifying the bitmap securing means of a location stored by the securing candidate location area managing means;
The bitmap securing means secures the notified location of the bitmap area, and notifies the allocated memory address calculating means of the position of the newly secured bitmap area;
An allocated memory address calculating means calculates an allocated memory address from the position of the notified bitmap area, and returns the allocated address to the memory requester;
Have
If there is no free space continuously for the required bitmap area size, the processing is repeated from the step performed by the maximum continuous free space length management means for other memories.

本発明は、メモリの管理を、ビットマップを使って行う処理において、確保に必要な連続空き領域のうち一番小さい領域を確保し、大きいサイズの連続空き領域をなるべく残すことにより、メモリ不足、つまり、システムリソースの負荷軽減を図るものである。   The present invention, in the process of managing the memory using a bitmap, secures the smallest of the continuous free areas necessary for securing, leaving as much of the continuous free area of a large size as possible. That is, the load of system resources is reduced.

本発明によれば、確保に必要な連続空き領域のうち一番小さい領域を使用し、大きいサイズの連続空き領域をなるべく残すことにより、メモリの断片化によるメモリ不足を解消し、システムリソースの負荷軽減を図ることができる。   According to the present invention, by using the smallest continuous free area necessary for securing and leaving a continuous free area of a large size as much as possible, memory shortage due to memory fragmentation is eliminated, and system resource load is reduced. Mitigation can be achieved.

次に、本発明の実施の形態について図面を参照して詳細に説明する。 Next, embodiments of the present invention will be described in detail with reference to the drawings.

図1を参照すると、本発明のメモリ管理装置は、ビットマップ領域101と割り当て領域102を有するメモリ100を管理するもので、メモリ管理部11と必要ビットマップ領域数計算部12と最大連続空き領域長管理部13と空きビットマップ検索部14とビット単位ビットマップ検索部15と確保候補場所領域管理部16とビットマップ確保部17とビットマップ検索位置通知部18と割り当てメモリアドレス算出部19とを有している。   Referring to FIG. 1, the memory management apparatus of the present invention manages a memory 100 having a bitmap area 101 and an allocation area 102, and includes a memory management section 11, a required bitmap area number calculation section 12, and a maximum continuous free area. The length management unit 13, the free bitmap search unit 14, the bit unit bitmap search unit 15, the allocation candidate location area management unit 16, the bitmap allocation unit 17, the bitmap search position notification unit 18, and the allocated memory address calculation unit 19 Have.

必要ビットマップ領域数計算部12は要求メモリサイズを管理するために必要なビットマップ領域サイズを求める。最大連続空き領域長管理部13は必要ビットマップ領域サイズをビットマップ領域101内の最大連続空き領域長と比べて、必要ビットマップ領域サイズ分連続した空きの有無をメモリ管理部11に通知する。空きビットマップ検索部14はメモリ確保部11からの通知を受けて、必要ビットマップ領域サイズ分連続した空きがある場合、ビット単位ビットマップ検索部15を用いて、ビットマップ検索位置通知部18から通知されたビットマップ検索位置からビットマップ領域101の検索を行い、必要な連続空きビットマップを見つけたら、その連続空き領域サイズと場所をメモリ管理部11に通知する。メモリ管理部11は、メモリ確保要求を受けて要求メモリサイズを必要ビットマップ領域数計算部12に通知し、必要ビットマップ領域数計算部12で算出された必要ビットマップ領域サイズを最大連続空き領域長管理部13に通知し、空きビットマップ検索部14からの通知を受け、ビットマップ領域101の検索が完了した地点で、確保に必要な連続空きビットマップがビットマップ領域101内で1つの場合、その連続空き領域サイズとその場所を、複数の場合、最小の連続空き領域長とその場所を確保候補場所領域管理手段16に通知する。ビットマップ確保部17はビットマップ領域101の、メモリ確保部11からの通知された場所の確保を行うと共に、新たに確保したビットマップの位置を割り当てメモリアドレス算出部19に通知する。割り当てメモリアドレス算出部19はビットマップ確保部17から通知されたビットマップの位置から割り当てメモリアドレスの算出を行い、メモリ要求者に対して割り当てアドレスを返却する。   The necessary bitmap area number calculation unit 12 obtains a bitmap area size necessary for managing the requested memory size. The maximum continuous free area length management unit 13 compares the required bitmap area size with the maximum continuous free area length in the bitmap area 101 and notifies the memory management unit 11 of the presence or absence of continuous free space for the required bitmap area size. When the empty bitmap search unit 14 receives the notification from the memory securing unit 11 and there is a continuous free space corresponding to the required bitmap area size, the bitmap search unit 15 uses the bit-unit bitmap search unit 15 to send the bitmap search position notification unit 18. When the bitmap area 101 is searched from the notified bitmap search position and a necessary continuous free bitmap is found, the memory management section 11 is notified of the continuous free area size and location. Upon receipt of the memory allocation request, the memory management unit 11 notifies the required bitmap area number calculation unit 12 of the required memory size, and the required bitmap area size calculated by the necessary bitmap area number calculation unit 12 is the maximum continuous free area. When the length management unit 13 is notified, the notification from the free bitmap search unit 14 is received, and the search of the bitmap area 101 is completed, the continuous free bitmap necessary for securing is one in the bitmap area 101 In the case where there are a plurality of continuous free area sizes and their locations, the minimum candidate free space length and its location are notified to the secured candidate location area management means 16. The bitmap securing unit 17 secures the location of the bitmap area 101 notified from the memory securing unit 11 and notifies the allocation memory address calculating unit 19 of the position of the newly secured bitmap. The allocated memory address calculation unit 19 calculates an allocated memory address from the position of the bitmap notified from the bitmap securing unit 17, and returns the allocated address to the memory requester.

次に、本実施形態のメモリ管理装置の動作について図2を参照して説明する。   Next, the operation of the memory management device of this embodiment will be described with reference to FIG.

メモリ確保部11は、メモリ確保要求を受けて要求メモリサイズを必要ビットマップ領域数計算部12に通知する(ステップ201)。必要ビットマップ領域数計算部12は、要求メモリサイズを管理するために必要なビットマップ領域サイズを、要求メモリサイズをビットマップ領域101の1ビット当たりのメモリサイズで割ることにより求め、その値をメモリ確保部11に返却する(ステップ202)。最大連続空き領域長管理部13はメモリ確保部11から通知された必要ビットマップ領域サイズをビットマップ領域101内の最大連続空き領域長と比べて、必要ビットマップ数分連続した空きの有無をメモリ確保部11に通知する(ステップ203)。メモリ確保部11は、ビットマップ領域101内に必要な空きがなければ、他のメモリ領域を検索対象とし(ステップ204)、空きがある場合、空きビットマップ検索部14は、メモリ確保部11からの通知を受けて、ビット単位ビットマップ検索部15を用いて、ビットマップ検索位置通知部18から通知された検索位置からビットマップ領域101の検索を行う(ステップ205)。   In response to the memory reservation request, the memory reservation unit 11 notifies the required memory size calculation unit 12 of the required memory size (step 201). The necessary bitmap area number calculation unit 12 obtains the bitmap area size necessary for managing the requested memory size by dividing the requested memory size by the memory size per bit of the bitmap area 101, and calculates the value. It returns to the memory securing unit 11 (step 202). The maximum continuous free area length management unit 13 compares the required bitmap area size notified from the memory securing unit 11 with the maximum continuous free area length in the bitmap area 101, and determines whether or not there is a continuous free space corresponding to the required number of bitmaps. The reservation unit 11 is notified (step 203). If there is no necessary space in the bitmap area 101, the memory reservation unit 11 searches for another memory area (step 204). If there is a space, the free bitmap search unit 14 starts from the memory reservation unit 11. In response to this notification, the bitmap area 101 is searched from the search position notified from the bitmap search position notification section 18 using the bit unit bitmap search section 15 (step 205).

メモリ確保部11は、必要な連続空きビットマップを見つけたら、確保候補場所領域長管理部16に連続空き領域長とその場所を通知し、他に候補がないかどうか空きビットマップ検索部14によってビットマップ領域101内をさらに検索する(ステップ206〜209)。メモリ確保部11はメモリ確保に必要な連続空き領域が複数見つかった場合は、既に見つかっている場所の連続空き領域長と2個目以降で見つけた連続空き領域長を比べて、小さい方を確保場所領域管理部16の内容と置き換える(ステップ210、211)。   When the memory securing unit 11 finds the necessary continuous free bitmap, it notifies the secured candidate location region length management unit 16 of the continuous free region length and its location, and the free bitmap search unit 14 determines whether there are other candidates. The bitmap area 101 is further searched (steps 206 to 209). When a plurality of continuous free areas necessary for memory reservation are found, the memory securing unit 11 secures the smaller one by comparing the continuous free area length of the already found place with the continuous free area length found after the second one. Replaced with the contents of the location area management unit 16 (steps 210 and 211).

ビットマップ領域101内を全て検索した結果、メモリ確保部11は、確保場所領域長管理部16に記憶されているビットマップ領域101の位置をビットマップ確保部17に通知し、ビットマップ確保部17は通知された位置のビットマップを確保すると共に、割り当てメモリアドレス算出部18に対して新たに確保したビットマップ領域101の位置を通知する(ステップ212、213)。割り当てメモリアドレス算出部19は、通知されたビットマップ領域101の位置から割り当てメモリアドレスの算出を、該位置が示すビット数に1ビット当たりのビット数を乗算することで行い(ステップ214)、メモリ要求者に対して割り当てアドレスを返却する(ステップ215)。   As a result of searching the entire bitmap area 101, the memory securing unit 11 notifies the bitmap securing unit 17 of the position of the bitmap area 101 stored in the secured location area length management unit 16, and the bitmap securing unit 17 Secures the bitmap of the notified position and notifies the allocated memory address calculation unit 18 of the position of the newly secured bitmap area 101 (steps 212 and 213). The allocated memory address calculation unit 19 calculates the allocated memory address from the notified position of the bitmap area 101 by multiplying the number of bits indicated by the position by the number of bits per bit (step 214). The assigned address is returned to the requester (step 215).

次に、本実施形態の具体例について図3を参照して詳細に説明する。   Next, a specific example of this embodiment will be described in detail with reference to FIG.

図3に示すように、メモリ100はビットマップ領域101と割り当て用領域102とから構成され、ビットマップ領域101の空き領域が、ビットマップA1、A2、A3、B、Cとなっている場合に、ビットマップが6バイト必要なメモリ要求がされたものとする。   As shown in FIG. 3, the memory 100 includes a bitmap area 101 and an allocation area 102, and the empty areas of the bitmap area 101 are bitmaps A1, A2, A3, B, and C. Assume that a memory request requiring 6 bytes of bitmap is made.

メモリ確保部11はメモリ確保の要求を受けると、要求されたサイズのメモリを管理するのに必要なビットマップの領域数を求めるため、必要ビットマップ領域数計算部12を使用する。この場合は、必要なビットマップの領域数が6.5バイト(52ビット)だったとする。メモリ確保部11は、最大連続空き領域長と先に求めた6.5バイトを比較する。今回の場合は、最大連続空き領域長のほうが大きいためビットマップ領域101でメモリの確保が行えると判断し処理を続行する。ビットマップ101でメモリを確保できると判断したメモリ確保部11は、空きビットマップ検索部14を通じて空きビットマップ領域101の検索を行う。空きビットマップ検索部14は、まず、必要ビットマップ領域数をビット単位ビットマップ検索部15に通知する。ビット単位ビットマップ検索部15は、A1から始まる領域を見つけ、確保に必要な領域を見つけたと判断し、さらにその後ろの空き領域長をそのまま調査し、確保候補場所領域管理部16にA1の場所および、A1、A2、A3の連続空き領域長(12バイト)を保存する。その後、さらに検索していない後ろのビットマップ領域101を検索し、領域Bを見つけ、上記と同様な処理を行い、確保可能と判断する。その際、先に見つけた候補場所の連続空き領域長と比べて、今回見つけた方が短い(8バイト)ため、確保候補場所領域管理部16には、Bを記憶する。その結果、図に示す網掛けの部分が連続した6.5バイトの空きと判断され、ビットマップ確保部17に通知される。ビットマップ確保部17は、先に見つけた6.5バイトの空きを使用中に変更する(0000000000000→1111111111111)。ビットマップ確保部17からビットマップの位置を受け取った割り当てメモリアドレス算出部19は、割り当てる実メモリアドレスをビットマップの位置から算出し、メモリ確保要求者に求めたアドレスを返却する。   When the memory securing unit 11 receives a memory securing request, the memory securing unit 11 uses the necessary bitmap area number calculating unit 12 in order to obtain the number of bitmap areas necessary for managing the memory of the requested size. In this case, it is assumed that the necessary number of bitmap areas is 6.5 bytes (52 bits). The memory securing unit 11 compares the maximum continuous free area length with the previously obtained 6.5 bytes. In this case, since the maximum continuous free area length is larger, it is determined that memory can be secured in the bitmap area 101, and the processing is continued. The memory securing unit 11 that has determined that the memory can be secured by the bitmap 101 searches the free bitmap area 101 through the free bitmap search unit 14. The empty bitmap search unit 14 first notifies the bit unit bitmap search unit 15 of the number of necessary bitmap areas. The bit unit bitmap search unit 15 finds an area starting from A1, determines that an area necessary for securing is found, further checks the free area length behind it, and stores the location of A1 in the allocation candidate place area management unit 16 And the continuous free area length (12 bytes) of A1, A2, and A3 is stored. Thereafter, the subsequent bitmap area 101 that has not been searched is further searched to find the area B, the same processing as described above is performed, and it is determined that the area can be secured. At this time, since the currently found area is shorter (8 bytes) than the continuous empty area length of the previously found candidate place, B is stored in the reserved candidate place area management unit 16. As a result, the shaded portion shown in the figure is determined to be a continuous 6.5-byte space, and is notified to the bitmap securing unit 17. The bitmap securing unit 17 changes the previously found 6.5-byte empty space to be in use (0000000000000 → 11111111111111). The allocated memory address calculating unit 19 that has received the bitmap position from the bitmap securing unit 17 calculates the actual memory address to be allocated from the bitmap position, and returns the requested address to the memory securing requester.

このように、不用意に大きいサイズの空き領域(A1、A2、A3)を使用せず、小さい領域を使用することにより、メモリの断片化が原因のメモリ不足を防ぎ、システムリソースの負荷軽減を実現することが可能である。   In this way, by using small areas instead of inadvertently using large sized free areas (A1, A2, A3), memory shortage due to memory fragmentation can be prevented and system resource load can be reduced. It is possible to realize.

図5を参照すると、本発明の他の実施形態によるメモリ管理装置は、図1のメモリ管理装置に、ワード単位にビットマップ領域を検索するワード単位ビットマップ検索部20と、バイト単位にビットマップ領域を検索するバイト単位ビットマップ検索部21を付加した構成となっている。   Referring to FIG. 5, a memory management apparatus according to another embodiment of the present invention includes a word management bitmap search unit 20 that searches a bitmap area in units of words and a bitmap in units of bytes. A byte unit bitmap search unit 21 for searching an area is added.

本実施形態では、ビットマップ領域101内に必要な空きがある場合、空きビットマップ検索部14は、必要ビットマップ領域数に応じてワード単位ビットマップ検索部20、バイト単位ビットマップ検索部21、ビット単位ビットマップ検索手段15を用いてビットマップ領域の検索を行う点が第1の実施形態と異なる。   In the present embodiment, when there is a necessary space in the bitmap area 101, the space bitmap search unit 14 selects the word unit bitmap search unit 20, the byte unit bitmap search unit 21, according to the number of necessary bitmap regions, The difference from the first embodiment is that a bitmap area is searched using the bit unit bitmap search means 15.

ここで、必要に応じてというのは、必要なビットマップ領域サイズが1ワードを越える場合、必要領域サイズのワード数分だけワード単位に空きを検索し、余った分、または1ワード以下の場合、バイト単位に空きを検索し、最後に余った分(これは8ビット未満を意味する)についてビット単位に空きを検索することである。   Here, if necessary, if the required bitmap area size exceeds 1 word, empty space is searched for by the number of words of the required area size, and the remainder is 1 word or less. Searching for vacancy in byte units, and searching for vacancy in bit units for the last remaining (this means less than 8 bits).

なお、メモリ管理装置の機能は、その機能を実現するためのプログラムを、コンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータに読み込ませ、実行するものであってもよい。コンピュータ読み取り可能な記録媒体とは、フレキシブルディスク、光磁気ディスク、CD−ROM等の記録媒体、コンピュータシステムに内蔵されるハードディスク装置等の記憶装置を指す。さらに、コンピュータ読み取り可能な記録媒体は、インターネットを介してプログラムを送信する場合のように、短時間、動的にプログラムを保持するもの(伝送媒体もしくは伝送波)、その場合のサーバとなるコンピュータ内の揮発性メモリのように、一定時間プログラムを保持しているものを含む。   The function of the memory management device is to record a program for realizing the function on a computer-readable recording medium, and cause the computer to read and execute the program recorded on the recording medium. Also good. The computer-readable recording medium refers to a recording medium such as a flexible disk, a magneto-optical disk, and a CD-ROM, and a storage device such as a hard disk device built in a computer system. Further, the computer-readable recording medium is a medium that dynamically holds the program for a short time (transmission medium or transmission wave) as in the case of transmitting the program via the Internet, and in the computer serving as a server in that case Such as a volatile memory that holds a program for a certain period of time.

本発明の一実施形態によるメモリ管理装置のブロック図である。1 is a block diagram of a memory management device according to an embodiment of the present invention. FIG. 図1のメモリ管理装置の動作を示すフローチャートである。3 is a flowchart showing an operation of the memory management device of FIG. 1. 図1のメモリ管理装置の動作を示すビットマップの例を示す図である。It is a figure which shows the example of the bitmap which shows operation | movement of the memory management apparatus of FIG. 本発明の他の実施形態によるメモリ管理装置のブロック図である。FIG. 5 is a block diagram of a memory management device according to another embodiment of the present invention.

符号の説明Explanation of symbols

11 メモリ確保部
12 必要ビットマップ領域数計算部
13 最大連続空き領域長管理部
14 空きビットマップ検索部
15 ビット単位ビットマップ検索部
16 確保候補場所領域管理部
17 ビットマップ確保部
18 ビットマップ検索位置通知部
19 割り当てメモリアドレス算出部
20 ワード単位ビットマップ検索部
21 ビット単位ビットマップ検索部
100、100A メモリ
101 ビットマップ領域
102 割り当て領域
201-205 ステップ
DESCRIPTION OF SYMBOLS 11 Memory reservation part 12 Necessary bitmap area number calculation part 13 Maximum continuous free area length management part 14 Empty bitmap search part 15 Bit unit bitmap search part 16 Reserve candidate place area management part 17 Bitmap reservation part 18 Bitmap search position Notification unit 19 Allocation memory address calculation unit 20 Word unit bitmap search unit 21 Bit unit bitmap search unit 100, 100A Memory 101 Bit map region 102 Allocation region 201-205 Steps

Claims (5)

メモリ確保手段と、割り当てメモリアドレス算出手段と、必要ビットマップ領域数計算手段と、最大連続空き領域長管理手段と、空きビットマップ検索手段と、ビットマップ検索位置通知手段と、ビットマップ確保手段と、ビット単位ビットマップ検索手段と、確保候補場所領域管理手段とを有するメモリ管理装置を用いて、ビットマップ領域と割り当て領域を有するメモリを管理する方法であって、
前記メモリ確保手段が、メモリ確保要求を受けて要求メモリサイズを必要ビットマップ領域数計算手段に通知するステップと、
前記必要ビットマップ領域数計算手段が、前記要求メモリサイズを管理するために必要なビットマップ領域サイズを求め、その値を前記メモリ確保手段に返却するステップと、
前記最大連続空き領域長管理手段が、前記メモリ確保手段から通知された必要ビットマップ領域サイズを前記ビットマップ領域内の最大連続空き領域長と比べて、前記必要ビットマップ領域サイズ分連続した空きの有無を前記メモリ確保手段に通知するステップと、
前記必要ビットマップ領域サイズ分連続した空きがある場合、前記メモリ確保手段からの通知を受けて、前記空きビットマップ検索手段が、前記ビット単位ビットマップ検索手段を用いて前記ビットマップ検索位置通知手段から通知された検索位置から前記ビットマップ領域の検索を行い、必要な連続空きビットマップを見つけたら、前記メモリ確保手段に、その連続空き領域サイズと場所を通知するステップと
前記メモリ確保手段が、前記ビットマップ領域の検索が完了した地点で、確保に必要な連続空きビットマップが前記ビットマップ領域内で1つの場合、その連続空き領域サイズとその場所を、複数の場合、最小の連続空き領域長とその場所を前記確保候補場所領域管理手段に通知するステップと、
前記メモリ確保手段が、前記確保候補場所領域管理手段が記憶している場所を前記ビットマップ確保手段に通知するステップと、
前記ビットマップ確保手段が、前記ビットマップ領域の通知された場所の確保を行うと共に、前記割り当てメモリアドレス算出手段に対して新たに確保した前記ビットマップ領域の位置を通知するステップと、
前記割り当てメモリアドレス算出手段が、通知されたビットマップ領域の位置から割り当てメモリアドレスの算出を行い、メモリ要求者に対して割り当てアドレスを返却するステップと、
を有し、
前記必要ビットマップ領域サイズ分連続して空きがない場合、他のメモリを対象として前記最大連続空き領域長管理手段が行うステップから処理を繰り返す、
メモリ管理方法。
Memory securing means, allocated memory address calculating means, required bitmap area number calculating means, maximum continuous free area length managing means, free bitmap search means, bitmap search position notifying means, bitmap securing means, A method of managing a memory having a bitmap area and an allocation area using a memory management device having a bit-unit bitmap search means and a reservation candidate location area management means,
The memory securing means receiving a memory securing request and notifying the required bitmap area number computing means of the requested memory size;
The necessary bitmap area number calculating means obtains a bitmap area size necessary for managing the requested memory size, and returns the value to the memory securing means;
The maximum continuous free area length management means compares the required bitmap area size notified from the memory securing means with the maximum continuous free area length in the bitmap area, and the continuous free area length corresponding to the required bitmap area size. Notifying the memory securing means of presence or absence;
When there is continuous free space for the required bitmap area size, upon receiving notification from the memory securing means, the free bitmap search means uses the bit-unit bitmap search means for the bitmap search position notification means. The bitmap area is searched from the search position notified from, and when the necessary continuous free bitmap is found, the step of notifying the memory securing means of the continuous free area size and location; and the memory securing means, At the point where the search of the bitmap area is completed, if there is one continuous free bitmap necessary for securing in the bitmap area, the size and location of the continuous free area are the same. Notifying the reservation candidate location area management means of the length and its location;
The memory securing means notifying the bitmap securing means of the location stored in the securing candidate location area managing means;
The bitmap securing means secures the notified location of the bitmap area, and notifies the allocated memory address calculation means of the position of the newly secured bitmap area;
The allocated memory address calculating means calculates an allocated memory address from the position of the notified bitmap area, and returns the allocated address to the memory requester;
Have
If there is no free space continuously for the required bitmap area size, repeat the process from the step performed by the maximum continuous free space length management means for other memory,
Memory management method.
前記空きビットマップ検索手段が前記ビットマップ領域の検索を行う際、前記必要なビットマップ領域サイズが1ワードを越える場合、ワード単位ビットマップ検索手段を用いて必要領域サイズのワード数分だけワード単位に空きを検索し、余った分、または1ワード以下の場合、バイト単位ビットマップ検索手段を用いてバイト単位に空きを検索し、最後に余った分について前記ビット単位ビットマップ検索手段を用いてビット単位に空きを検索する、請求項1に記載のメモリ管理方法。   When the required bitmap area size exceeds one word when the empty bitmap search means searches the bitmap area, the word unit bitmap search means uses the word area bitmap search means for the number of words. If there is a remaining space or less than one word, the space is searched in byte units using the byte unit bitmap search means, and the last bit space is searched using the bit unit bitmap search means. The memory management method according to claim 1, wherein a vacancy is searched in bit units. ビットマップ領域と割り当て領域を有するメモリを管理する装置であって、
要求メモリサイズを管理するために必要なビットマップ領域サイズを求める必要ビットマップ領域数計算手段と、
前記必要ビットマップ領域サイズをビットマップ領域内の最大連続空き領域長と比べて、前記必要ビットマップ領域サイズ分連続した空きの有無を通知する最大連続空き領域長管理手段と、
前記ビットマップ領域の検索位置を通知するビットマップ検索位置通知手段と、
前記必要ビットマップ領域サイズ分連続した空きがある場合、ビット単位ビットマップ検索手段を用いて前記ビットマップ検索位置通知手段から通知された検索位置から前記ビットマップ領域の検索を行い、必要な連続空きビットマップを見つけたら、その連続空き領域サイズと場所を通知する前記空きビットマップ検索手段と
確保候補場所領域管理手段と、
メモリ確保要求を受けて要求メモリサイズを前記必要ビットマップ領域数計算手段に通知し、前記必要ビットマップ領域サイズを前記最大連続空き領域長管理手段に通知し、前記空きビットマップ検索手段からの通知を受け、ビットマップ領域の検索が完了した地点で、確保に必要な連続空きビットマップが同じビットマップ領域内で1つの場合、その連続空き領域サイズとその場所を、複数の場合、最小の連続空き領域長とその場所を前記確保候補場所領域管理手段に通知するメモリ確保手段と、
前記メモリ確保手段からの通知された場所のビットマップの確保を行うと共に、新たに確保したビットマップ領域の位置を通知するビットマップ確保手段と、
前記ビットマップ確保手段から通知されたビットマップ領域の位置から割り当てメモリアドレスの算出を行い、メモリ要求者に対して割り当てアドレスを返却する割り当てメモリアドレス算出手段と、
を有するメモリ管理装置。
An apparatus for managing a memory having a bitmap area and an allocation area,
A necessary bitmap area number calculating means for obtaining a bitmap area size necessary for managing the required memory size;
Comparing the required bitmap area size with the maximum continuous free area length in the bitmap area, maximum continuous free area length management means for notifying whether there is a continuous free space for the required bitmap area size;
Bitmap search position notifying means for notifying the search position of the bitmap area;
When there is a continuous space for the required bitmap area size, the bitmap region is searched from the search position notified from the bitmap search position notification unit using the bit-unit bitmap search unit, and the necessary continuous space is obtained. When the bitmap is found, the free bitmap search means for notifying the continuous free area size and location, the reserved candidate place area management means,
In response to a memory allocation request, the required memory size is notified to the required bitmap area number calculating means, the required bitmap area size is notified to the maximum continuous free area length managing means, and the empty bitmap search means is notified. When the bitmap area search is completed and there is one continuous free bitmap in the same bitmap area, the size of the continuous free area and its location are the minimum continuous in the case of multiple. Memory securing means for notifying the securing candidate location area managing means of the free space length and its location;
Bitmap securing means for notifying the location of the newly secured bitmap area while securing the bitmap of the notified location from the memory securing means,
An allocated memory address calculating unit that calculates an allocated memory address from the position of the bitmap area notified from the bitmap securing unit, and returns the allocated address to the memory requester;
A memory management device.
ワード単位ビットマップ検索手段とバイト単位ビットマップ検索手段をさらに有し、前記空きビットマップ検索手段は、前記ビットマップ領域の検索を行う際、必要なビットマップ領域サイズが1ワードを越える場合、前記ワード単位ビットマップ検索手段を用いて必要領域サイズのワード数分だけワード単位に空きを検索し、余った分、または1ワード以下の場合、前記バイト単位ビットマップ検索手段を用いてバイト単位に空きを検索し、最後に余った分について前記ビット単位ビットマップ検索手段を用いてビット単位に空きを検索する、請求項3に記載のメモリ管理装置。   Further comprising a word unit bitmap search unit and a byte unit bitmap search unit, wherein the free bitmap search unit performs the search of the bitmap region, and if the required bitmap region size exceeds one word, A word unit bitmap search means is used to search for free space in word units by the number of words of the required area size. If there is a surplus or less than one word, the byte unit bitmap search means uses the byte unit bitmap search means to free space. The memory management device according to claim 3, wherein a search is made for a vacancy in bit units using the bit unit bitmap search means for the last remaining portion. コンピュータを、請求項3または4に記載のメモリ管理装置として実行させるためのメモリ管理プログラム。   A memory management program for causing a computer to execute as the memory management device according to claim 3.
JP2006084910A 2006-03-27 2006-03-27 Memory management method, device and program Pending JP2007264692A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006084910A JP2007264692A (en) 2006-03-27 2006-03-27 Memory management method, device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006084910A JP2007264692A (en) 2006-03-27 2006-03-27 Memory management method, device and program

Publications (1)

Publication Number Publication Date
JP2007264692A true JP2007264692A (en) 2007-10-11

Family

ID=38637672

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006084910A Pending JP2007264692A (en) 2006-03-27 2006-03-27 Memory management method, device and program

Country Status (1)

Country Link
JP (1) JP2007264692A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012118943A (en) * 2010-12-03 2012-06-21 Digital Media Professional:Kk Graphic arithmetic processing chip
CN111722802A (en) * 2020-06-12 2020-09-29 苏州浪潮智能科技有限公司 Storage space allocation method, device and equipment for metadata LSA volume
JP2022545997A (en) * 2019-07-02 2022-11-02 マイクロソフト テクノロジー ライセンシング,エルエルシー hardware-based memory compression
CN113535392B (en) * 2021-07-08 2023-07-11 中国人民解放军国防科技大学 Memory management method and system for realizing support of large memory continuous allocation based on CMA

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012118943A (en) * 2010-12-03 2012-06-21 Digital Media Professional:Kk Graphic arithmetic processing chip
JP2022545997A (en) * 2019-07-02 2022-11-02 マイクロソフト テクノロジー ライセンシング,エルエルシー hardware-based memory compression
JP7438246B2 (en) 2019-07-02 2024-02-26 マイクロソフト テクノロジー ライセンシング,エルエルシー Hardware-based memory compression
CN111722802A (en) * 2020-06-12 2020-09-29 苏州浪潮智能科技有限公司 Storage space allocation method, device and equipment for metadata LSA volume
CN113535392B (en) * 2021-07-08 2023-07-11 中国人民解放军国防科技大学 Memory management method and system for realizing support of large memory continuous allocation based on CMA

Similar Documents

Publication Publication Date Title
US6505283B1 (en) Efficient memory allocator utilizing a dual free-list structure
US20150317246A1 (en) Memory Reclamation Method and Apparatus
RU2479013C2 (en) Method of optimising solid-state drive and optimiser
CN107665146B (en) Memory management device and method
CN109614377A (en) File delet method, device, equipment and the storage medium of distributed file system
US9886667B2 (en) Performance of predicted actions
US20060149915A1 (en) Memory management technique
CN107209716B (en) Memory management device and method
EP2659387B1 (en) Predictive software streaming
US20170004087A1 (en) Adaptive cache management method according to access characteristics of user application in distributed environment
US20050268049A1 (en) Dynamic memory management
US20100325083A1 (en) Skip list generation
CN107992271A (en) Data pre-head method, device, equipment and computer-readable recording medium
US20210089442A1 (en) Dynamically allocating memory pool subinstances
US11204812B2 (en) Information processing apparatus and distributed processing system
JP2007264692A (en) Memory management method, device and program
US8274521B2 (en) System available cache color map
WO2022135160A1 (en) Releasing method and releasing system for buffer space, and electronic device and storage medium
US20100325360A1 (en) Multi-core processor and multi-core processor system
JP2008234059A (en) Data transfer device and information processing system
CN108563470A (en) The loaded and optimized strategy of web page under a kind of iOS
CN111858393A (en) Memory page management method, memory page management device, medium and electronic device
JP4749237B2 (en) Variable length frame buffer device
US20180203875A1 (en) Method for extending and shrinking volume for distributed file system based on torus network and apparatus using the same
CN112084141A (en) Full-text retrieval system capacity expansion method, device, equipment and medium