[go: up one dir, main page]

JP2008033838A - Memory management device and memory management method - Google Patents

Memory management device and memory management method Download PDF

Info

Publication number
JP2008033838A
JP2008033838A JP2006209212A JP2006209212A JP2008033838A JP 2008033838 A JP2008033838 A JP 2008033838A JP 2006209212 A JP2006209212 A JP 2006209212A JP 2006209212 A JP2006209212 A JP 2006209212A JP 2008033838 A JP2008033838 A JP 2008033838A
Authority
JP
Japan
Prior art keywords
area
memory
free
fixed
secured
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
JP2006209212A
Other languages
Japanese (ja)
Inventor
Naoki Mochizuki
尚樹 望月
Ryohei Himeki
涼平 姫木
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP2006209212A priority Critical patent/JP2008033838A/en
Publication of JP2008033838A publication Critical patent/JP2008033838A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a memory management device and a memory management method capable of realizing efficient memory management in a fixed-length block system. <P>SOLUTION: A domain securing part 11 is provided for securing domains partitioned into a plurality of first fixed-length blocks in an unsecured domain in a memory 2, and a free domain determining part 12 is provided for determining whether or not there is a free domain of a requested size or more on the secured domain when there is an allocation request of the memory 2, and a request including information of size to be allotted is received from the outside. In the domain securing part 11, if there is no free domain of a requested size or more on the secured domain, one or more first fixed-length blocks are newly secured in continuance with the secured domain in the unsecured domain to secure a free domain of the requested size or more. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、組込みシステムに適用されるメモリ管理装置及びメモリ管理方法に関する。   The present invention relates to a memory management device and a memory management method applied to an embedded system.

携帯電話等の組込みシステムは、パーソナルコンピュータ(PC)と比較して、処理能力の低いCPUと小容量のメモリ等を具備する。また、組込みシステムでは、メモリが必要な場合、必要な領域をメモリブロック単位で確保し、不要になったら開放する「メモリプール機能」がオペレーションシステム(OS)の一機能として実装されている。   A built-in system such as a mobile phone includes a CPU having a low processing capacity and a small-capacity memory as compared with a personal computer (PC). In the embedded system, when a memory is necessary, a “memory pool function” that secures a necessary area in units of memory blocks and releases it when it is no longer needed is implemented as a function of the operation system (OS).

メモリプール機能には、使用可能なメモリブロックのサイズにより、固定長ブロック方式と可変長ブロック方式がある。「固定長ブロック方式」は、予め固定長のメモリブロックを複数用意し、固定長のメモリブロック単位でメモリを管理する方式である。固定長ブロック方式では、最初に用意したメモリブロックの個数だけメモリが確保できるが、実際に使用されていないにも関わらずメモリが確保されることによって、メモリの利用効率低下が生じ易い。   The memory pool function includes a fixed-length block method and a variable-length block method depending on the size of usable memory blocks. The “fixed-length block method” is a method in which a plurality of fixed-length memory blocks are prepared in advance and the memory is managed in units of fixed-length memory blocks. In the fixed-length block method, it is possible to secure the memory by the number of memory blocks prepared first, but the memory utilization efficiency is likely to be reduced by securing the memory even though it is not actually used.

「可変長ブロック方式」は、可変長のメモリブロック単位で動的にメモリブロックを確保する方式である。よって、メモリの利用効率の観点からは有利であるが、異なったサイズのメモリブロック単位で確保と解放を繰り返すことにより、使用中のメモリブロックと空き領域が不連続に現れ、使用中のメモリブロックの間に小さな空き領域が現れる断片化(フラグメンテーション)が発生し易い。   The “variable length block method” is a method for dynamically securing memory blocks in units of variable length memory blocks. Therefore, it is advantageous from the viewpoint of memory utilization efficiency, but by repeating securing and releasing in units of memory blocks of different sizes, the memory block in use and the free space appear discontinuously, and the memory block in use Fragmentation (fragmentation) in which a small vacant area appears between them is likely to occur.

可変長ブロック方式において断片化の発生を抑制する技術として、空き領域の探査方向をメモリアドレスの昇順とするか又は降順とするかを決するために用いる基準サイズを記憶する基準サイズ記憶手段を備え、データのサイズが、基準サイズ以上の場合は探査方向を降順、基準サイズ未満の場合は探査方向を昇順としつつ、データのサイズ以上のサイズを有するものとして最初に探査された空き領域を選択してデータに対するメモリの割り付けを行う手法が提案されている(特許文献1参照。)。
特開2005−157714号公報
As a technique for suppressing the occurrence of fragmentation in the variable-length block method, comprising a reference size storage means for storing a reference size used for determining whether the search direction of the free area is ascending order or descending order of the memory address, If the data size is greater than or equal to the reference size, the search direction is descending, and if the data size is less than the reference size, the search direction is ascending, and the free space that was first explored as having a size greater than or equal to the data size is selected. A method for allocating memory to data has been proposed (see Patent Document 1).
JP 2005-157714 A

可変長ブロック方式を組込みシステムに適用する場合、実装負担が大きく、リアルタイム性も損なわれやすい。このため、組込みシステムに用いられるリアルタイムOSでは、可変長ブロック方式をサポートせず、固定長ブロック方式のみをサポートしている場合がある。このような場合は固定長ブロック方式が利用される。しかしながら、上述したように、固定長ブロック方式では、実際に使用されていないにも関わらずメモリが確保されてしまう。また、固定長ブロック方式では、メモリブロックのサイズを小さくすると断片化が発生し易くなる。さらに、固定長ブロック方式では、メモリブロックのサイズを大きくすると、小さなサイズのメモリ要求に対して1ブロック使用してしまう。したがって、固定長ブロック方式を用いると、効率的なメモリの管理は困難となる。   When the variable-length block method is applied to an embedded system, the mounting burden is large and the real-time property is easily lost. For this reason, a real-time OS used in an embedded system may not support the variable-length block method but may support only the fixed-length block method. In such a case, the fixed length block method is used. However, as described above, in the fixed-length block method, a memory is secured even though it is not actually used. In the fixed-length block method, fragmentation tends to occur when the memory block size is reduced. Further, in the fixed-length block method, if the size of the memory block is increased, one block is used for a memory request of a small size. Therefore, if the fixed-length block method is used, efficient memory management becomes difficult.

上記問題点を鑑み、本発明は、固定長ブロック方式において、効率的なメモリ管理を実現可能とするメモリ管理装置及びメモリ管理方法を提供することを目的とする。   In view of the above problems, an object of the present invention is to provide a memory management device and a memory management method capable of realizing efficient memory management in a fixed-length block method.

上記目的を達成するために、本発明の第1の特徴は、メモリ内の未確保領域内に、複数の第1固定長ブロックに分割された領域を確保する領域確保部と、メモリの割り当て要求であって、割り当てるサイズの情報を含んだ要求を外部から受け付けた場合、要求されたサイズ以上の空き領域が上記確保した領域に存在するか否かを判定する空き領域判定部とを備え、領域確保部は、要求されたサイズ以上の空き領域が上記確保した領域内に存在しない場合、未確保領域内に、上記確保した領域に連続して新たに上記第1固定長ブロックを1つ以上確保して、要求されたサイズ以上の空き領域を確保するメモリ管理装置であることを要旨とする。   In order to achieve the above object, a first feature of the present invention is that an area securing unit for securing an area divided into a plurality of first fixed-length blocks in an unallocated area in the memory, and a memory allocation request A free area determination unit that determines whether or not a free area larger than the requested size exists in the reserved area when a request including information on a size to be allocated is received from the outside, The securing unit secures one or more new first fixed-length blocks in succession to the secured area in the unsecured area when there is no free area of the requested size or more in the secured area. Thus, the gist of the present invention is a memory management device that secures a free area of a requested size or more.

この特徴によれば、上記領域確保部は、要求されたサイズ以上の空き領域が上記確保した領域内に存在しない場合、未確保領域内に、上記確保した領域に連続して新たに第1固定長ブロックを1つ以上確保して、要求されたサイズ以上の空き領域を確保するので、メモリを効率的に使用可能とすると共に、断片化によるエラーを抑制することができる。   According to this feature, when there is no free area of the requested size or more in the reserved area, the area securing unit newly fixes the first fixed area in the unsecured area continuously to the secured area. Since one or more long blocks are secured and a free space of a requested size or more is secured, the memory can be used efficiently and errors due to fragmentation can be suppressed.

第2の特徴は、第1の特徴に係るメモリ管理装置において、新たに確保した第1固定長ブロックの領域が解放された場合、当該解放された領域を未確保領域とする領域解放部をさらに備えることを要旨とする。   The second feature is that in the memory management device according to the first feature, when the newly secured area of the first fixed-length block is released, an area release unit that sets the released area as an unsecured area is further provided. The gist is to provide.

この特徴によれば、新たに確保した第1固定長ブロックの領域が解放された場合、上記解放された領域を未確保領域とするので、メモリを効率的に使用できる。   According to this feature, when the newly secured area of the first fixed-length block is released, the released area is set as an unsecured area, so that the memory can be used efficiently.

第3の特徴は、第1又は第2の特徴に係るメモリ管理装置において、領域確保部は、未確保領域内に、さらに、複数の第2固定長ブロックに分割された領域を確保することを要旨とする。   A third feature is that, in the memory management device according to the first or second feature, the area securing unit secures an area further divided into a plurality of second fixed-length blocks in the unsecured area. The gist.

この特徴によれば、領域確保部は、未確保領域内に、さらに、複数の第2固定長ブロックに分割された領域を確保するサイズの異なる固定長ブロックからなる2つのメモリ領域を確保するので、2つのメモリ領域を使い分けることが可能となり、メモリを効率的に使用できる。   According to this feature, the area securing unit secures two memory areas including fixed-length blocks of different sizes that secure an area divided into a plurality of second fixed-length blocks in the unsecured area. The two memory areas can be used properly, and the memory can be used efficiently.

本発明の第4の特徴は、メモリ内の未確保領域内に、複数の第1固定長ブロックに分割された領域を確保するステップと、メモリの割り当て要求であって、割り当てるサイズの情報を含んだ要求を外部から受け付けた場合、要求されたサイズ以上の空き領域が上記確保した領域に存在するか否かを判定するステップと、要求されたサイズ以上の空き領域が上記確保した領域内に存在しない場合、未確保領域内に、上記確保した領域に連続して新たに第1固定長ブロックを1つ以上確保して、要求されたサイズ以上の空き領域を確保するステップとを含むメモリ管理方法であることを要旨とする。   A fourth feature of the present invention is a step of securing an area divided into a plurality of first fixed-length blocks in an unallocated area in the memory, and a memory allocation request, which includes information on the allocation size. If the request is received from the outside, a step of determining whether or not a free area larger than the requested size exists in the reserved area, and a free area larger than the requested size exists in the reserved area. If not, a memory management method including the step of securing one or more first fixed-length blocks in the unallocated area in succession to the secured area and securing a free area of a requested size or more. It is a summary.

本発明によれば、固定長ブロック方式において、効率的なメモリ管理を実現可能とするメモリ管理装置及びメモリ管理方法を提供できる。   According to the present invention, it is possible to provide a memory management device and a memory management method capable of realizing efficient memory management in the fixed-length block method.

次に、図面を参照して、本発明の実施形態を説明する。以下の実施形態における図面の記載において、同一又は類似の部分には同一又は類似の符号を付している。   Next, an embodiment of the present invention will be described with reference to the drawings. In the description of the drawings in the following embodiments, the same or similar parts are denoted by the same or similar reference numerals.

(メモリ管理装置)
本発明の実施形態に係るメモリ管理装置の説明の前に、メモリ管理装置の適用される組込みシステムのハードウェア構成について、図1(a)を用いて簡単に説明する。図1(a)の例では、携帯電話システムの概要を示している。当該システムは、CPU10と、メモリ2と、ROM5と、通信装置6とを備えている。ROM5は、CPU10において実行されるプログラムを格納するプログラム記憶装置等として機能する。メモリ2は、主に、CPU10におけるプログラム実行処理中に利用されるデータ等を一時的に格納し、あるいは作業領域として利用される一時的なデータメモリ等として機能する。ROM5に格納されるプログラムとしては、各種のアプリケーションに加えて、CPU10を制御するOS(リアルタイムOS)が含まれる。このOSは、上述した固定長ブロック方式を用いてメモリ2を管理するメモリ管理機能を有している。通信装置6は、各種の通信処理を実行する。
(Memory management device)
Prior to the description of the memory management device according to the embodiment of the present invention, the hardware configuration of an embedded system to which the memory management device is applied will be briefly described with reference to FIG. In the example of FIG. 1A, an outline of a mobile phone system is shown. The system includes a CPU 10, a memory 2, a ROM 5, and a communication device 6. The ROM 5 functions as a program storage device that stores a program executed by the CPU 10. The memory 2 mainly functions as a temporary data memory or the like that temporarily stores data or the like used during program execution processing in the CPU 10 or is used as a work area. The programs stored in the ROM 5 include an OS (real-time OS) that controls the CPU 10 in addition to various applications. This OS has a memory management function for managing the memory 2 using the above-described fixed-length block method. The communication device 6 executes various communication processes.

次に、図1(a)のシステムの機能構成例を図1(b)に示す。図1(a)のCPU10は、図1(b)の処理装置3及びメモリ管理装置1の機能を実行する。処理装置3は、各アプリケーションに対応する複数のモジュール31,32,・・・を備える。複数のモジュール31,32,・・・のそれぞれはメモリ2を共有して使用する。   Next, FIG. 1B shows an example of the functional configuration of the system shown in FIG. The CPU 10 in FIG. 1A executes the functions of the processing device 3 and the memory management device 1 in FIG. The processing device 3 includes a plurality of modules 31, 32,... Corresponding to each application. The plurality of modules 31, 32,... Share the memory 2 for use.

メモリ管理装置1は、領域確保部11と、空き領域判定部12と、空き領域割り当て部13と、領域解放部14とを備える。領域確保部11は、メモリ2内の未確保領域に対して、複数の固定長ブロックに分割されたメモリ領域を確保する。この結果、メモリ2は、モジュール31,32,・・・が使用可能なメモリ領域(以下「確保済領域」と称する)と、モジュール31,32,・・・が使用できない未確保領域の2つの領域に分けられる。   The memory management device 1 includes an area securing unit 11, a free area determination unit 12, a free area allocation unit 13, and an area release unit 14. The area securing unit 11 secures a memory area divided into a plurality of fixed-length blocks with respect to an unsecured area in the memory 2. As a result, the memory 2 has two memory areas, namely, a memory area where the modules 31, 32,... Can be used (hereinafter referred to as “allocated areas”) and an unallocated area where the modules 31, 32,. Divided into areas.

空き領域判定部12は、メモリ2の割り当てを要求するメモリ要求をモジュール31,32,・・・から受信した場合、要求されたサイズ以上の空き領域が確保済領域内に存在するか否かを判定する。空き領域割り当て部13は、要求されたサイズ以上の空き領域が確保済領域内に存在する場合、メモリ要求に対して空き領域を割り当てる。   When the memory area request for allocation of the memory 2 is received from the modules 31, 32,..., The free area determination unit 12 determines whether or not there is a free area larger than the requested size in the secured area. judge. The free area allocation unit 13 allocates a free area to a memory request when a free area having a size larger than the requested size exists in the reserved area.

また、領域確保部11は、要求されたサイズ以上の空き領域が上記確保済領域内に存在しない場合、確保済領域に固定長ブロックを少なくとも1つ追加することで、未確保領域に向けて使用可能なメモリ領域を拡張する。つまり、領域確保部11は、上記未確保領域内に上記確保済領域に連続して新たに固定長ブロックを1つ以上確保する。この際、領域確保部11は、上記要求されたサイズ以上の空き領域を確保する。なお、以下では、モジュール31,32,・・・がメモリの割り当てを要求するサイズを「要求サイズ」と称する。拡張した領域(つまり、新たに使用可能となった領域)を、「拡張メモリ領域」と称する。   In addition, when there is no free area of the requested size or more in the secured area, the area securing unit 11 adds at least one fixed length block to the secured area and uses it for the unsecured area. Extend possible memory space. In other words, the area securing unit 11 secures one or more new fixed-length blocks in succession to the secured area in the unsecured area. At this time, the area securing unit 11 secures a free area that is equal to or larger than the requested size. In the following, the size at which the modules 31, 32,... Request memory allocation is referred to as “requested size”. The expanded area (that is, a newly usable area) is referred to as an “extended memory area”.

領域解放部14は、上記拡張メモリ領域が解放された場合、当該解放された拡張メモリ領域を再度未確保領域とする。   When the extended memory area is released, the area releasing unit 14 sets the released extended memory area as an unsecured area again.

以下に、領域確保部11、空き領域判定部12、空き領域割り当て部13、及び領域解放部14の各機能の詳細について説明する。   Details of each function of the area securing unit 11, the free area determination unit 12, the free area allocation unit 13, and the area release unit 14 will be described below.

先ず、領域確保部11の詳細について、図2を用いて説明する。図2のメモリ配置の例では、領域確保部11が、所定のサイズの固定長ブロック(以下、「小容量ブロック」という。)からなる領域(以下、「第1確保済領域」という。)と、小容量ブロックよりもサイズの大きい固定長ブロック(以下、「大容量ブロック」という。)からなる領域(以下、「第2確保済領域」という。)を確保している。   First, details of the area securing unit 11 will be described with reference to FIG. In the example of the memory arrangement in FIG. 2, the area securing unit 11 is an area (hereinafter referred to as “first secured area”) composed of fixed-length blocks (hereinafter referred to as “small capacity blocks”) having a predetermined size. An area (hereinafter referred to as a “second reserved area”) composed of a fixed-length block (hereinafter referred to as “large capacity block”) having a size larger than that of the small capacity block is secured.

また、第1確保済領域は、メモリ2の先頭アドレスから最後尾アドレスへ向けて配置されている。第2確保済領域は、メモリ2の最後尾アドレスから先頭アドレスへ向けて配置されている。   The first reserved area is arranged from the top address of the memory 2 to the last address. The second reserved area is arranged from the last address of the memory 2 to the first address.

領域確保部11は、最初に確保済領域を確保する時点では、必要最小限の数の固定長ブロックを用意する。したがって、第1確保済領域と第2確保済領域の間には、未確保領域が残されている。   The area securing unit 11 prepares the minimum number of fixed-length blocks at the time of securing the secured area for the first time. Therefore, an unsecured area remains between the first secured area and the second secured area.

次に、空き領域判定部12及び空き領域割り当て部13の詳細について、図3を用いて説明する。   Next, details of the free space determination unit 12 and the free space allocation unit 13 will be described with reference to FIG.

空き領域判定部12は、受信したメモリ要求の要求サイズに応じて、第1確保済領域及び第2確保済領域のいずれに割り当てを行うかを判定する。一例として、空き領域判定部12は、要求サイズを閾値と比較して、閾値以下である場合は第1確保済領域に割り当てを行うと判断する。これに対して、閾値を超える場合は、空き領域判定部12は、第2確保済領域に割り当てを行うと判断する。   The free area determination unit 12 determines which of the first reserved area and the second reserved area should be allocated according to the request size of the received memory request. As an example, the free space determination unit 12 compares the request size with a threshold value, and determines that the allocation is made to the first secured region if the size is equal to or smaller than the threshold value. On the other hand, when the threshold value is exceeded, the free space determination unit 12 determines to allocate to the second secured region.

第1確保済領域に割り当てを行うと判断された場合、空き領域判定部12は、メモリ2の先頭アドレスから最後尾アドレスへ向けて空き領域を検索する。一方、第2確保済領域に割り当てを行うと判断された場合、空き領域判定部12は、メモリ2の最後尾アドレスから先頭アドレスへ向けて空き領域を検索する。   When it is determined that the first reserved area is to be allocated, the free area determination unit 12 searches for a free area from the top address to the last address of the memory 2. On the other hand, when it is determined that the allocation is made to the second secured area, the free area determination unit 12 searches for a free area from the last address of the memory 2 toward the first address.

第1確保済領域に割り当てを行う場合において、図3(a)に示すように、要求サイズを満たす連続した小容量ブロックからなる空き領域が存在するときは、空き領域割り当て部13は、空き領域に割り当てを行う。   In the case of allocating to the first reserved area, as shown in FIG. 3A, when there is a free area composed of continuous small capacity blocks that satisfy the requested size, the free area allocation unit 13 Make an assignment.

第1確保済領域に割り当てを行う場合において、図3(b)に示すように、要求サイズを満たす連続した小容量ブロックからなる空き領域が存在しないときは、領域確保部11は、上記第1確保済領域に対して小容量ブロックを少なくとも1つ(ここでは3つ)追加することで、未確保領域に向けて使用可能なメモリ領域を拡張する。なお、領域確保部11は、要求サイズに応じて、追加するブロック数を決定する。この結果、拡張メモリ領域が作成され、空き領域割り当て部13は、作成された拡張メモリ領域に対して割り当てを行う。   When allocating to the first reserved area, as shown in FIG. 3B, if there is no free area consisting of continuous small-capacity blocks satisfying the requested size, the area ensuring unit 11 By adding at least one small-capacity block (here, three) to the reserved area, the usable memory area is expanded toward the unsecured area. The area securing unit 11 determines the number of blocks to be added according to the requested size. As a result, an extended memory area is created, and the free area allocating unit 13 assigns the created extended memory area.

次に、領域解放部14の詳細について、図4を用いて説明する。領域解放部14は、図4(a)に示すように、拡張メモリ領域以外の領域が解放された場合、そのまま解放して空き領域とする。一方、領域解放部14は、図4(b)に示すように、拡張メモリ領域が解放された場合、解放された領域を未確保領域とする。   Next, details of the area release unit 14 will be described with reference to FIG. As shown in FIG. 4A, the area releasing unit 14 releases a free area as it is when an area other than the extended memory area is released. On the other hand, as shown in FIG. 4B, the area releasing unit 14 sets the released area as an unallocated area when the extended memory area is released.

このように、拡張メモリ領域が解放された場合、解放された拡張メモリ領域を未確保領域とすることで、最初の第1確保済領域のサイズを維持でき、メモリを効率的に使用できる。   Thus, when the extended memory area is released, the size of the first first reserved area can be maintained by setting the released extended memory area as an unsecured area, and the memory can be used efficiently.

(メモリ管理方法)
次に、図5に示すフローチャートを参照して、本発明の実施形態に係るメモリ管理方法の概要を説明する。
(Memory management method)
Next, an overview of the memory management method according to the embodiment of the present invention will be described with reference to the flowchart shown in FIG.

ステップS11において、領域確保部11は、図2に示すように、第1及び第2確保済領域を作成する。   In step S11, the area securing unit 11 creates first and second secured areas as shown in FIG.

ステップS12において、領域確保部11、空き領域判定部12、及び空き領域割り当て部13は、モジュール31,32,・・・からのメモリ要求に応じて、メモリ2の割り当て処理を行う。   In step S12, the area securing unit 11, the free area determining unit 12, and the free area allocating unit 13 perform the allocation process of the memory 2 in response to a memory request from the modules 31, 32,.

ステップS13において、領域解放部14は、モジュール31,32,・・・からの解放要求に応じて、メモリ2の解放処理を行う。   In step S13, the area release unit 14 performs a release process of the memory 2 in response to a release request from the modules 31, 32,.

次に、図6に示すフローチャートを参照して、図5のステップS12の詳細について説明する。   Next, the details of step S12 in FIG. 5 will be described with reference to the flowchart shown in FIG.

ステップS101において、モジュール31,32,・・・からメモリ要求を受け付けると、ステップS102に移行する。   In step S101, when a memory request is received from the modules 31, 32,..., The process proceeds to step S102.

ステップS102において、空き領域判定部12は、ステップS101で受信したメモリ要求の要求サイズに応じて、第1確保済領域及び第2確保済領域のいずれに割り当てを行うかを判定する。第1確保済領域に割り当てを行う場合、ステップS104に移行する。第2確保済領域に割り当てを行う場合、ステップS103に移行する。   In step S102, the free area determination unit 12 determines which of the first reserved area and the second reserved area is to be allocated according to the request size of the memory request received in step S101. When allocating to the 1st reserved area | region, it transfers to step S104. When allocating to the 2nd reserved area | region, it transfers to step S103.

ステップS104において、空き領域判定部12は、メモリ2の先頭アドレスから最後尾アドレスへ向けて空き領域を検索する。   In step S <b> 104, the free space determination unit 12 searches for free space from the first address to the last address of the memory 2.

ステップS105において、空き領域判定部12は、要求サイズ以上の空き領域が第1確保済領域内に存在するか否かを判定する。要求サイズ以上の空き領域が第1確保済領域内に存在する場合、ステップS107に移行する。要求サイズ以上の空き領域が第1確保済領域内に存在しない場合、ステップS108に移行する。   In step S105, the free space determination unit 12 determines whether or not a free space larger than the requested size exists in the first reserved region. If a free area larger than the requested size exists in the first reserved area, the process proceeds to step S107. If there is no free area larger than the requested size in the first reserved area, the process proceeds to step S108.

ステップS106において、領域確保部11は、未確保領域内に、第1確保済領域に連続して新たに小容量ブロックを1つ以上確保して、要求サイズ以上の空き領域を確保する。   In step S106, the area securing unit 11 secures one or more new small-capacity blocks in succession to the first secured area in the unsecured area, and secures a free area that is larger than the requested size.

ステップS107において、空き領域割り当て部13は、ステップS101で受け付けたメモリ要求に対して空き領域を割り当てる。   In step S107, the free area allocation unit 13 allocates a free area to the memory request received in step S101.

一方、ステップS103において、空き領域判定部12は、メモリ2の最後尾アドレスから先頭アドレスへ向けて空き領域を検索する。   On the other hand, in step S <b> 103, the free area determination unit 12 searches for a free area from the last address of the memory 2 toward the start address.

ステップS109において、空き領域判定部12は、要求サイズ以上の空き領域が第2確保済領域内に存在するか否かを判定する。要求サイズ以上の空き領域が第2確保済領域内に存在する場合、ステップS110に移行する。要求サイズ以上の空き領域が第2確保済領域内に存在しない場合、ステップS111に移行する。   In step S109, the free space determination unit 12 determines whether a free space larger than the requested size exists in the second secured region. If a free area larger than the requested size exists in the second reserved area, the process proceeds to step S110. If there is no free area larger than the requested size in the second reserved area, the process proceeds to step S111.

ステップS110において、領域確保部11は、未確保領域内に、第2確保済領域に連続して新たに大容量ブロックを1つ以上確保して、要求サイズ以上の空き領域を確保する。   In step S110, the area securing unit 11 secures one or more new large-capacity blocks in succession to the second secured area in the unsecured area, and secures a free area that is equal to or larger than the requested size.

ステップS111において、空き領域割り当て部13は、ステップS101で受け付けたメモリ要求に対して空き領域を割り当てる。   In step S111, the free area allocation unit 13 allocates a free area to the memory request received in step S101.

次に、図7に示すフローチャートを参照して、図5のステップS13の詳細について説明する。   Next, the details of step S13 in FIG. 5 will be described with reference to the flowchart shown in FIG.

ステップS201において、領域解放部14は、モジュール31,32,・・・からの解放要求を受け付ける。   In step S201, the area release unit 14 receives a release request from the modules 31, 32,.

ステップS202において、領域解放部14は、拡張メモリ領域が解放されたか否かを判定する。拡張メモリ領域が解放された場合、ステップS203に移行する。拡張メモリ領域以外の確保済領域が解放された場合、ステップS204に移行する。   In step S202, the area releasing unit 14 determines whether or not the extended memory area has been released. When the extended memory area is released, the process proceeds to step S203. When the reserved area other than the extended memory area is released, the process proceeds to step S204.

ステップS203において、領域解放部14は、開放された領域を未確保領域とする。   In step S203, the area releasing unit 14 sets the released area as an unsecured area.

ステップS204において、領域解放部14は、解放された領域を空き領域とする。   In step S204, the area releasing unit 14 sets the released area as a free area.

以上詳細に説明したように、本発明の実施形態によれば、要求されたサイズ以上の空き領域が確保済領域内に存在しない場合、未確保領域内に、確保済領域に連続して新たに固定長ブロックを1つ以上確保して、要求サイズ以上の空き領域を確保するので、連続した空き領域を確保して、メモリを効率的に使用可能とすると共に、断片化によるエラーを抑制することができる。   As described above in detail, according to the embodiment of the present invention, when there is no free area larger than the requested size in the reserved area, a new area is newly added in the reserved area. Secure one or more fixed-length blocks to secure a free space that is larger than the requested size, so that you can secure a continuous free space to efficiently use the memory and suppress errors caused by fragmentation. Can do.

(その他の実施形態)
上記のように、本発明は実施形態によって記載したが、この開示の一部をなす論述及び図面はこの発明を限定するものであると理解すべきではない。この開示から当業者には様々な代替実施形態、実施例及び運用技術が明らかとなる。
(Other embodiments)
As mentioned above, although this invention was described by embodiment, it should not be understood that the description and drawing which form a part of this indication limit this invention. From this disclosure, various alternative embodiments, examples and operational techniques will be apparent to those skilled in the art.

例えば、上述した実施形態においては、領域確保部11が、小容量ブロックからなる第1確保済領域と、大容量ブロックからなる第2確保済領域の2つの確保済領域を作成する一例を説明した。しかしながら、領域確保部11は、2つの確保済領域を作成せずに、1つの確保済領域のみを作成しても良い。   For example, in the embodiment described above, an example has been described in which the area securing unit 11 creates two secured areas, a first secured area composed of small capacity blocks and a second secured area composed of large capacity blocks. . However, the area securing unit 11 may create only one secured area without creating two secured areas.

あるいは、領域確保部11は、小容量ブロック及び大容量ブロックのそれぞれとサイズの異なる固定長ブロックからなる第3確保済領域をさらに作成しても良い。固定長ブロックのサイズを3パターン用意することにより、より効率的なメモリ管理が実現できる。   Alternatively, the area securing unit 11 may further create a third secured area composed of fixed-length blocks having different sizes from the small capacity block and the large capacity block. By preparing three patterns of fixed-length block sizes, more efficient memory management can be realized.

このように本発明は、ここでは記載していない様々な実施形態等を包含するということを理解すべきである。したがって、本発明はこの開示から妥当な特許請求の範囲の発明特定事項によってのみ限定されるものである。   Thus, it should be understood that the present invention includes various embodiments and the like not described herein. Therefore, the present invention is limited only by the invention specifying matters in the scope of claims reasonable from this disclosure.

本発明の実施形態に係るメモリ管理システムの構成例を示すブロック図である。It is a block diagram which shows the structural example of the memory management system which concerns on embodiment of this invention. 本発明の実施形態に係る領域確保部の機能を説明するための模式図である。It is a schematic diagram for demonstrating the function of the area | region securing part which concerns on embodiment of this invention. 本発明の実施形態に係る領域確保部及び空き領域割り当て部の機能を説明するための模式図である。It is a schematic diagram for demonstrating the function of the area reservation part which concerns on embodiment of this invention, and an empty area allocation part. 本発明の実施形態に係る領域解放部の機能を説明するための模式図である。It is a schematic diagram for demonstrating the function of the area | region release part which concerns on embodiment of this invention. 本発明の実施形態に係るメモリ管理方法の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the memory management method which concerns on embodiment of this invention. 本発明の実施形態に係るメモリ割り当て処理フローを示すフローチャートである。It is a flowchart which shows the memory allocation processing flow which concerns on embodiment of this invention. 本発明の実施形態に係るメモリ解放処理フローを示すフローチャートである。It is a flowchart which shows the memory release process flow which concerns on embodiment of this invention.

符号の説明Explanation of symbols

1…メモリ管理装置
2…メモリ
3…処理装置
5…ROM
6…通信装置
10…CPU
11…領域確保部
12…空き領域判定部
13…空き領域割り当て部
14…領域解放部
31,32,…モジュール
DESCRIPTION OF SYMBOLS 1 ... Memory management apparatus 2 ... Memory 3 ... Processing apparatus 5 ... ROM
6 ... Communication device 10 ... CPU
DESCRIPTION OF SYMBOLS 11 ... Area reservation part 12 ... Empty area determination part 13 ... Empty area allocation part 14 ... Area release part 31, 32, ... Module

Claims (4)

メモリ内の未確保領域内に、複数の第1固定長ブロックに分割された領域を確保する領域確保部と、
前記メモリの割り当て要求であって、割り当てるサイズの情報を含んだ要求を外部から受け付けた場合、要求されたサイズ以上の空き領域が前記確保した領域に存在するか否かを判定する空き領域判定部とを備え、
前記領域確保部は、前記要求されたサイズ以上の空き領域が前記確保した領域内に存在しない場合、前記未確保領域内に、前記確保した領域に連続して新たに前記第1固定長ブロックを1つ以上確保して、前記要求されたサイズ以上の空き領域を確保することを特徴とするメモリ管理装置。
An area securing unit for securing an area divided into a plurality of first fixed-length blocks in an unallocated area in the memory;
A free space determination unit that determines whether or not a free space larger than the requested size exists in the secured region when a request including allocation size information is received from the outside as the memory allocation request And
When there is no free area of the requested size or more in the reserved area, the area securing unit newly adds the first fixed-length block continuously to the secured area in the unsecured area. One or more memory management devices are provided, and a free space of the requested size or more is secured.
前記新たに確保した第1固定長ブロックの領域が解放された場合、前記解放された領域を未確保領域とする領域解放部をさらに備えることを特徴とする請求項1に記載のメモリ管理装置。   2. The memory management device according to claim 1, further comprising an area releasing unit that sets the released area as an unsecured area when the area of the newly secured first fixed-length block is released. 前記領域確保部は、前記未確保領域内に、さらに、複数の第2固定長ブロックに分割された領域を確保することを特徴とする請求項1又は2に記載のメモリ管理装置。   The memory management device according to claim 1, wherein the area securing unit reserves an area further divided into a plurality of second fixed-length blocks in the unsecured area. メモリ内の未確保領域内に、複数の第1固定長ブロックに分割された領域を確保するステップと、
前記メモリの割り当て要求であって、割り当てるサイズの情報を含んだ要求を外部から受け付けた場合、要求されたサイズ以上の空き領域が前記確保した領域に存在するか否かを判定するステップと、
前記要求されたサイズ以上の空き領域が前記確保した領域内に存在しない場合、前記未確保領域内に、前記確保した領域に連続して新たに前記第1固定長ブロックを1つ以上確保して、前記要求されたサイズ以上の空き領域を確保するステップ
とを含むことを特徴とするメモリ管理方法。
Securing an area divided into a plurality of first fixed-length blocks in an unsecured area in the memory;
Determining whether or not a free area larger than the requested size exists in the secured area when the memory allocation request is received from the outside and includes a request including size information to be allocated;
If a free area of the requested size or larger does not exist in the reserved area, one or more new first fixed-length blocks are continuously allocated in the unsecured area in succession to the reserved area. And a memory management method, comprising the step of securing a free area of the requested size or more.
JP2006209212A 2006-07-31 2006-07-31 Memory management device and memory management method Pending JP2008033838A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006209212A JP2008033838A (en) 2006-07-31 2006-07-31 Memory management device and memory management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006209212A JP2008033838A (en) 2006-07-31 2006-07-31 Memory management device and memory management method

Publications (1)

Publication Number Publication Date
JP2008033838A true JP2008033838A (en) 2008-02-14

Family

ID=39123145

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006209212A Pending JP2008033838A (en) 2006-07-31 2006-07-31 Memory management device and memory management method

Country Status (1)

Country Link
JP (1) JP2008033838A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010113380A1 (en) * 2009-03-31 2010-10-07 日本電気株式会社 Calculator system
US8812735B2 (en) 2009-10-15 2014-08-19 Sony Corporation Content reproduction system, content reproduction apparatus, program, content reproduction method, and providing content server
JP2014157952A (en) * 2013-02-18 2014-08-28 Nuflare Technology Inc Charged particle beam drawing device, and data storage method for buffer memory
DE102018114434B4 (en) 2017-06-19 2024-10-10 Toyota Jidosha Kabushiki Kaisha vehicle substructure

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11110281A (en) * 1997-10-06 1999-04-23 Canon Inc Image forming apparatus and memory management method
JP2000047933A (en) * 1998-07-30 2000-02-18 Nec Software Kobe Ltd Bidirectional memory securing management system
JP2002521749A (en) * 1998-07-24 2002-07-16 サン・マイクロシステムズ・インコーポレーテッド Method and apparatus for achieving deterministic memory allocation response in a computer system
JP2005044218A (en) * 2003-07-24 2005-02-17 Matsushita Electric Ind Co Ltd Memory management device for image display
JP2005316839A (en) * 2004-04-30 2005-11-10 Kyocera Corp Memory management device and portable terminal device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11110281A (en) * 1997-10-06 1999-04-23 Canon Inc Image forming apparatus and memory management method
JP2002521749A (en) * 1998-07-24 2002-07-16 サン・マイクロシステムズ・インコーポレーテッド Method and apparatus for achieving deterministic memory allocation response in a computer system
JP2000047933A (en) * 1998-07-30 2000-02-18 Nec Software Kobe Ltd Bidirectional memory securing management system
JP2005044218A (en) * 2003-07-24 2005-02-17 Matsushita Electric Ind Co Ltd Memory management device for image display
JP2005316839A (en) * 2004-04-30 2005-11-10 Kyocera Corp Memory management device and portable terminal device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010113380A1 (en) * 2009-03-31 2010-10-07 日本電気株式会社 Calculator system
US8812735B2 (en) 2009-10-15 2014-08-19 Sony Corporation Content reproduction system, content reproduction apparatus, program, content reproduction method, and providing content server
JP2014157952A (en) * 2013-02-18 2014-08-28 Nuflare Technology Inc Charged particle beam drawing device, and data storage method for buffer memory
DE102018114434B4 (en) 2017-06-19 2024-10-10 Toyota Jidosha Kabushiki Kaisha vehicle substructure

Similar Documents

Publication Publication Date Title
KR101355193B1 (en) An apparatus for managing memory of a realtime embedded system and methods for allocating/cancelling/managing memory thereof
US7590816B2 (en) Computer system, management computer and storage system, and storage area allocation amount controlling method
KR101733117B1 (en) Task distribution method on multicore system and apparatus thereof
KR102077149B1 (en) Method for managing memory and apparatus thereof
CN101853215B (en) A memory allocation method and device
CN107844372B (en) Memory allocation method and system
CN107209716A (en) Memory management device and method
KR20180045347A (en) Method for resource management of virtual environment
US7721065B2 (en) Reducing memory fragmentation by learning memory allocation patterns
JP2009181268A (en) Fixed length memory block management apparatus and control method thereof
US8352702B2 (en) Data processing system memory allocation
JP2008225520A (en) Memory resource arrangement control method for arranging memory resource in virtual machine environment, virtual machine system, and program
JP2008033838A (en) Memory management device and memory management method
JP2003196152A (en) Memory pool management method
KR102376474B1 (en) Method for allocating storage using buddy allocator
KR20220062072A (en) Systems and methods for allocating flash and RAM to reduce power consumption in a processor
US20100299672A1 (en) Memory management device, computer system, and memory management method
US9015418B2 (en) Self-sizing dynamic cache for virtualized environments
CN105243031B (en) Method and device for allocating free pages in a cache partition
JP2013140596A (en) Apparatus and method for dynamically reconfiguring operating system for many-core system
JP6191361B2 (en) Information processing system, information processing system control method, and control program
JP5641300B2 (en) Storage system and memory cache area control method for storage system
CN108009005A (en) A kind of thread pool management method and device
JP2010108216A (en) Memory management system, electronic equipment and memory management program
WO2012107988A1 (en) Memory management program, memory management method and information processing device

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20080801

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20080909

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090316

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20090930

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20091015

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111128

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120417