JPH10116230A - Memory management device and computer-readable recording medium - Google Patents

Memory management device and computer-readable recording medium

Info

Publication number
JPH10116230A
JPH10116230A JP20279097A JP20279097A JPH10116230A JP H10116230 A JPH10116230 A JP H10116230A JP 20279097 A JP20279097 A JP 20279097A JP 20279097 A JP20279097 A JP 20279097A JP H10116230 A JPH10116230 A JP H10116230A
Authority
JP
Japan
Prior art keywords
stability
memory
garbage collection
area
collection process
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP20279097A
Other languages
Japanese (ja)
Other versions
JP3868585B2 (en
Inventor
Nobuhiko Funato
信彦 舟渡
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP20279097A priority Critical patent/JP3868585B2/en
Publication of JPH10116230A publication Critical patent/JPH10116230A/en
Application granted granted Critical
Publication of JP3868585B2 publication Critical patent/JP3868585B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To actualize a garbage collection which is short in process time while prolonging the life of a rewrite-frequency limited type memory. SOLUTION: A stability setting part 12, sets the stability of a new object to 0 and the stability N of an object which is neither collected nor written while a garbage collecting process is performed by a specific number of times to (N+1). An object allocation part 14 allocates the objects of 0 and 1 in stability to a RAM 8 and allocates objects of 2 and 3 in stability to a flash memory 7. When there is no unused area, a garbage collection execution part 13 adds an area of higher stability from an area of 0 in stability and repeats the garbage collecting process. Thus, the frequency and time of the garbage collecting process are reduced and shortened to rewrites the flash memory 7 accompanying the garbage collection, thereby prolonging the life of the write-frequency limited type memory.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、書き換え回数に
制限のあるメモリの長寿命化を図りながら、メモリの利
用効率が高くて中断時間の短いガーベジコレクションの
実現を可能にするメモリ管理装置及びコンピュータ読み
取り可能な記録媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a memory management device and a computer for realizing a garbage collection with a high memory utilization efficiency and a short interruption time while extending the life of a memory having a limited number of rewrites. The present invention relates to a readable recording medium.

【0002】[0002]

【従来の技術】近年、PDA(Personal Di
gital Assistant)等のバッテリで動作
する携帯型の情報処理端末機器が実現化されている。上
記PDAのような端末は、少ないメモリ容量で動作する
ことや、低消費電力であることが強く要求される。上記
PDAでは、未使用時にシステムの状態を保存するため
に、バッテリでバックアップされたRAM(ランダム・
アクセス・メモリ)を搭載することが多い。そして更
に、低消費電力化を図るために、上記RAMのかなりの
部分を低消費電力のフラッシュメモリに置き換えるよう
になっている。
2. Description of the Related Art In recent years, a PDA (Personal Di) has been developed.
A portable information processing terminal device that operates on a battery, such as a digital assistant, has been realized. A terminal such as the above PDA is strongly required to operate with a small memory capacity and to have low power consumption. In the above PDA, in order to save the state of the system when not in use, the RAM backed up by a battery (random RAM)
Access memory). Further, in order to reduce the power consumption, a considerable part of the RAM is replaced with a low power consumption flash memory.

【0003】一方、メモリの利用効率を高めて、アプリ
ケーションプログラムの構築を容易にするメモリ管理手
法として、ガーベジコレクションが知られている。例え
ば、ニュートン(アップル社製)のオペレーティングシ
ステムは、上記ガーベジコレクションを主要なメモリ管
理手法として採用している。但し、上記ニュートンにお
いては、ガーベジコレクションの対象となるのはRAM
領域のみである。
On the other hand, garbage collection is known as a memory management method for increasing the efficiency of memory usage and facilitating the construction of application programs. For example, the operating system of Newton (made by Apple Inc.) adopts the garbage collection as a main memory management method. However, in the above Newton, the target of garbage collection is RAM
Area only.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上記従
来のガーベジコレクションには、上記PDAのような端
末システムのメモリ管理手法として用いた場合には以下
のような問題がある。
However, the conventional garbage collection has the following problems when used as a memory management method for a terminal system such as the PDA.

【0005】(1)実行の中断 上記ガーベジコレクションの実行中には、アプリケーシ
ョンを含む他のシステムの実行が中断させられる。その
ために、ある量以上のメモリに対するガーベジコレクシ
ョンの実行は、対話的な利用を前提とするPDAでは、
利用者に対する応答を悪化させることになる。
(1) Interruption of execution During execution of the garbage collection, execution of another system including an application is interrupted. Therefore, the execution of garbage collection for a certain amount of memory or more is performed on a PDA that assumes interactive use.
This will worsen the response to the user.

【0006】(2)メモリの頻繁な書き換え 上記ガーベジコレクションは、通常RAM上のメモリ管
理を前提としているため、例外なく、管理の対象となる
メモリ空間を頻繁に走査して書き換えるようにしてい
る。そのために、上記ガーベジコレクションを、フラッ
シュメモリのように書き換え回数に制限のあるメモリに
対してそのまま適用すると、メモリの寿命を著しく縮め
てしまう。
(2) Frequent rewriting of memory Since the above garbage collection normally presupposes memory management on a RAM, the memory space to be managed is frequently scanned and rewritten without exception. Therefore, if the garbage collection is directly applied to a memory having a limited number of times of rewriting such as a flash memory, the life of the memory is significantly shortened.

【0007】すなわち、上記PDAのように、フラッシ
ュメモリのごとく書き換え回数に制限のあるメモリを搭
載している計算機システムでガーベジコレクションを実
現するためには、ガーベジコレクション実行による他の
システムの実行の中断時間を短縮することと同時に、書
き換え回数制限型メモリの寿命を延ばすための対策を講
ずる必要がある。
That is, in order to realize garbage collection in a computer system equipped with a memory having a limited number of rewrites, such as a flash memory, as in the above-mentioned PDA, it is necessary to suspend execution of another system by executing garbage collection. At the same time as reducing the time, it is necessary to take measures to extend the life of the memory with a limited number of rewrites.

【0008】ガーベジコレクションの処理時間を短縮す
る手法は「実時間ガーベジコレクション」と呼ばれてお
り、多数提案されている。しかしながら、フラッシュメ
モリのような書き換え回数制限型メモリを搭載するシス
テムに対して、書き換え回数制限型メモリを含むメモリ
領域への適用を想定した実時間ガーベジコレクション
は、これまで知られていない。
A technique for reducing the processing time of garbage collection is called "real-time garbage collection", and many methods have been proposed. However, real-time garbage collection intended for a memory area including a memory with a limited number of rewrites for a system equipped with a memory with a limited number of rewrites such as a flash memory has not been known so far.

【0009】そこで、この発明の目的は、書き換え回数
に制限のあるメモリの長寿命化を図りながら、メモリの
利用効率が高くて処理時間の短いガーべジコレクション
の実現を可能にするメモリ管理装置を堤供することにあ
る。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a memory management device which can realize a garbage collection with a high use efficiency of a memory and a short processing time while extending the life of a memory having a limited number of rewrites. To provide

【0010】[0010]

【課題を解決するための手段】上記目的を達成するた
め、請求項1に係る発明は、書き換え回数制限型メモリ
とRAMと上記両メモリの論理アドレスを物理アドレス
に変換するアドレス変換部を有するシステムのメモリ管
理装置であって、上記書き換え回数制限型メモリあるい
はRAMの未使用領域が所定の大きさより小さい場合
に、この未使用領域が小さいメモリに対してガーベジコ
レクション処理を行うガーベジコレクション実行部と、
上記各メモリに対するデータの割り付け単位を表す情報
であるオブジェクトに対して、上記各メモリに対する新
規オブジェクトの割り付け時、あるいは、上記ガーベジ
コレクション処理実行時に、上記ガーベジコレクション
処理によって回収されず且つ当該ガーベジコレクション
処理時まで書き込みが行われなかった場合に増加する安
定度を設定する安定度設定部と、上記各メモリに対する
新規オブジェクトの割り付け時、あるいは、上記ガーベ
ジコレクション処理実行時に、上記安定度設定部によっ
て設定された安定度が所定値以下のオブジェクトを上記
RAMに割り付ける一方、上記安定度が上記所定値より
高いオブジェクトを上記書き換え回数制限型メモリに割
り付けるオブジェクト割付部を備えたことを特徴として
いる。
According to one aspect of the present invention, there is provided a system having a memory having a limited number of rewrites, a RAM, and an address converter for converting a logical address of both memories into a physical address. A garbage collection execution unit that performs a garbage collection process on a memory having a small unused area when the unused area of the memory with a limited number of rewrites or the RAM is smaller than a predetermined size;
When allocating a new object to each memory or executing the garbage collection process for an object which is information indicating a unit of data allocation to each memory, the garbage collection process does not collect the garbage collection process. And a stability setting unit for setting a stability that increases when writing has not been performed until the time when a new object is allocated to each memory or when the garbage collection process is performed. An object allocating unit that allocates an object whose stability is equal to or less than a predetermined value to the RAM, and allocates an object whose stability is higher than the predetermined value to the rewrite limit type memory.

【0011】上記構成において、書き換え回数制限型メ
モリあるいはRAMに対する新規オブジェクトの割り付
けが要求されると、安定度設定部によって新規オブジェ
クトの安定度が設定される。そして、オプジェクト割付
部によって、上記設定された安定度が所定値以下である
場合には、上記新規オブジェクトはRAMに割り付けら
れる。一方、上記安定度が上記所定値より高い場合に
は、上記新規オブジェクトが上記書き換え回数制限型メ
モリに割り付けられる。さらに、上記新規オブジェクト
を割り付ける際に、割り付け対象となる上記書き換え回
数制限型メモリあるいはRAMの未使用領域が所定の大
きさより小さい場合には、ガーベジコレクション実行部
によってガーベジコレクション処理が行われる。そし
て、上記安定度設定部によって、当該ガーべジコレクシ
ョン処理によって回収されず且つ当該ガーベジコレクシ
ョン処理時まで書き込みが行われなかったオブジェクト
の安定度が増加される。そして、上記設定された安定度
が上記所定値より高くなると、上記オブジェクト割付部
によって、当該オブジェクトは上記RAMから上記書き
換え回数制限型メモリに割り付け直される。
In the above configuration, when a new object is requested to be assigned to the memory of limited number of times of rewriting or the RAM, the stability of the new object is set by the stability setting section. When the set stability is equal to or less than a predetermined value, the new object is allocated to the RAM by the object allocation unit. On the other hand, when the stability is higher than the predetermined value, the new object is allocated to the rewrite frequency limited memory. Further, when allocating the new object, if the unused area of the rewrite limited memory or the RAM to be allocated is smaller than a predetermined size, the garbage collection execution unit performs garbage collection processing. Then, the stability setting unit increases the stability of an object that has not been collected by the garbage collection process and has not been written until the garbage collection process. Then, when the set stability becomes higher than the predetermined value, the object is re-allocated from the RAM to the rewrite limit type memory by the object allocation unit.

【0012】こうして、常に、上記安定度が所定値以下
のオブジェクトを上記RAMに割り付ける一方、上記安
定度が上記所定値より高いオブジェクトを上記書き換え
回数制限型メモリに割り付けることによって、上記ガー
ベジコレクション処理によって回収されにくく且つ書き
込みが起こりにくいオブジェクト群が上記書き換え回数
制限型メモリに割り付けられる。その結果、上記書き換
え回数制限型メモリに対する書き換えや書き込みが押さ
えられて、上記書き換え回数制限型メモリの長寿命化が
図られる。
In this way, while always allocating an object whose stability is equal to or less than a predetermined value to the RAM, and allocating an object having a stability higher than the predetermined value to the memory for limiting the number of times of rewriting, the garbage collection process is performed. An object group that is difficult to collect and hard to write is allocated to the memory of limited number of times of rewriting. As a result, rewriting and writing to the limited number of times of rewriting memory are suppressed, and the life of the limited number of times of rewriting memory can be extended.

【0013】また、請求項2に係る発明は、請求項1に
かかる発明のメモリ管理装置において、上記ガーベジコ
レクション実行部は、上記未使用領域が所定の大きさよ
り小さいメモリに関して、上記安定度の高いオブジェク
トが割り付けられている領域よりも、上記安定度の低い
オブジェクトが割り付けられている領域に対して、高い
頻度で上記ガーベジコレクション処理を行うようになっ
ていることを特徴としている。
According to a second aspect of the present invention, in the memory management device according to the first aspect, the garbage collection execution unit is configured to provide the high stability with respect to the memory in which the unused area is smaller than a predetermined size. It is characterized in that the garbage collection process is performed more frequently in the area where the object with the lower stability is allocated than in the area where the object is allocated.

【0014】上記構成によれば、上記安定度の低いオブ
ジェクトが割り付けられている領域に対して高い頻度で
上記ガーベジコレクション処理が行われる。したがっ
て、上記ガーベジコレクション処理に付随する書き換え
は、上記安定度の低いオブジェクトが割り付けられてい
る上記RAMに対して頻繁に行われることになり、上記
書き換え回数制限型メモリの更なる長寿命化が図られ
る。さらに、上記安定度の低いオブジェクトが割り付け
られている領域に対して高い頻度で上記ガーベジコレク
ション処理が行われることによって、該当するメモリの
全領域に対して一様に上記ガーベジコレクション処理を
行う場合よりも上記ガーべジコレクション処理の時間が
短縮されて、他の処理の中断時間が短縮される。
According to the above configuration, the garbage collection process is performed with high frequency on the area to which the object with low stability is allocated. Therefore, rewriting associated with the garbage collection process is frequently performed on the RAM to which the object with low stability is allocated, and the life of the memory with limited number of rewriting can be further extended. Can be Furthermore, the garbage collection process is performed with high frequency on the area to which the object with the low stability is allocated, so that the garbage collection process is performed uniformly on the entire area of the corresponding memory. Also, the time of the garbage collection process is shortened, and the interruption time of other processes is shortened.

【0015】また、請求項3に係る発明は、請求項2に
かかる発明のメモリ管理装置において、上記ガーベジコ
レクション実行部は、上記未使用領域が所定の大きさよ
り小さいメモリに関して、上記所定の大きさの未使用領
域が得られるまで,最も低い安定度のオブジェクト群が
割り付けられている領域に順次高い安定度のオブジェク
ト群が割り付けられている領域を加えて上記ガーベジコ
レクション処理を行うようになっていることを特徴とし
ている。
According to a third aspect of the present invention, in the memory management device according to the second aspect, the garbage collection execution unit is configured to determine that the unused area is smaller than the predetermined size with respect to the memory having a size smaller than the predetermined size. Until an unused area is obtained, the above-mentioned garbage collection process is performed by sequentially adding an area to which an object group having a higher stability is allocated to an area to which an object group having the lowest stability is allocated. It is characterized by:

【0016】上記構成によれば、上記安定度が低いオブ
ジェクト群が割り付けられている領域程上記ガーベジコ
レクション処理の回数が多くなり、上記安定度の高いオ
ブジェクトが割り付けられている上記書き換え回数制限
型メモリに対する上記ガーベジコレクション処理に付随
する書き換えが少なくなる。こうして、上記書き換え回
数制限型メモリの更なる長寿命化が図られる。さらに、
上記未使用領域が所定の大きさより小さいメモリの全領
域に対して一様にガーベジコレクション処理を行う場合
よりも処理時間が短縮されて、他の処理の中断時間が短
縮される。
According to the above-mentioned structure, the number of times of the garbage collection process increases in the area where the object group with the low stability is allocated, and the rewrite frequency limited memory in which the object with the high stability is allocated. For the garbage collection process is reduced. In this way, the life of the memory with limited number of rewrites can be further extended. further,
The processing time is reduced as compared with the case where the garbage collection processing is uniformly performed on the entire area of the memory in which the unused area is smaller than the predetermined size, and the interruption time of other processing is reduced.

【0017】また、請求項4に係る発明は、請求項1に
係る発明のメモリ管理装置において、上記安定度設定部
は、上記新規オブジェクトの割り付け時には,新規オブ
ジェクトの安定度を最小値に設定し、上記ガーベジコレ
クション処理実行時には,当該ガーベジコレクション処
理によって,処理対象領域に在る同一安定度のオブジェ
クトに対するガーベジコレクション処理回数が上記安定
度になってから所定回数になった場合に,上記処理対象
領域に在るオブジェクトであって上記所定回数のガーベ
ジコレクション処理が行われる間に書き込みが行われな
かったオブジェクトの安定度を所定値だけ増加するよう
になっていることを特徴としている。
According to a fourth aspect of the present invention, in the memory management device of the first aspect, the stability setting unit sets the stability of the new object to a minimum value when the new object is allocated. When the garbage collection process is executed, if the number of garbage collection processes performed on objects having the same stability in the process target region reaches a predetermined number of times after the garbage collection process reaches the stability, the garbage collection process is performed. The stability of an object which is not written during the predetermined number of garbage collection processes is increased by a predetermined value.

【0018】上記構成によれば、新規オブジェクトの安
定度が最小値に設定されるので、殆どが短期間のうちに
他のオブジェクトとの参照関係が成立しないゴミと化す
新規オブジェクトが上記ガーベジコレクション処理回数
の多い上記RAMに割り付けられる。こうして、メモリ
の利用効率が高められる。さらに、書き込みが行われに
くいオブジェクトの安定度が増加されるので、上記書き
換え回数制限型メモリには書き込みが行われないと予測
されるオブジェクトが割り付けられることになる。こう
して、上記書き換え回数制限型メモリの更なる長寿命化
が図られる。
According to the above configuration, since the stability of the new object is set to the minimum value, the new object which is mostly turned into garbage that cannot establish a reference relationship with another object in a short period of time is subjected to the garbage collection processing. It is allocated to the RAM that is frequently used. In this way, the memory utilization efficiency is improved. Further, since the stability of an object to which writing is difficult is increased, an object which is predicted not to be written is assigned to the memory of limited number of times of rewriting. In this way, the life of the memory with limited number of rewrites can be further extended.

【0019】また、請求項5に係る発明は、請求項1に
係る発明のメモリ管理装置において、上記アドレス変換
部は、上記書き換え回数制限型メモリ上におけるアドレ
ス変換の単位領域としてのぺージであって書き込み禁止
であるページに対して書き込みが要求されて発生するア
クセス例外を検知するアクセス例外検知手段を備えて、
上記アクセス例外検知手段によってアクセス例外が検知
された場合には、書き込みが要求された論理アドレス空
間上の論理ページが写像された上記書き換え回数制限型
メモリの物理アドレス空間上の物理ページの内容を上記
RAMの物理アドレス空間上の未使用の物理ページにコ
ピーし、このコピーされた上記RAMの物理ページを上
記書き込みが要求された論理ページに対応付けるように
なっていることを特徴としている。
According to a fifth aspect of the present invention, in the memory management device according to the first aspect of the present invention, the address conversion unit is a page as a unit area of the address conversion on the memory with a limited number of rewrites. Access exception detecting means for detecting an access exception that occurs when a write is requested for a write-protected page,
When an access exception is detected by the access exception detecting means, the contents of the physical page on the physical address space of the memory for limiting the number of rewrites onto which the logical page on the logical address space requested to be written is mapped The RAM is copied to an unused physical page in a physical address space of the RAM, and the copied physical page of the RAM is associated with the logical page requested to be written.

【0020】上記構成によれば、上記書き換え回数制限
型メモリ上における書き込み禁止ぺージに対して書き込
みが要求されるアクセス例外が発生した場合には、書き
込みが要求された論理アドレス空間上の論理ページが上
記RAMの物理アドレス空間上の物理ページに写像され
るので、以後上記書き換え回数制限型メモリ上における
書き込み禁止ぺージに対する書き込みが可能となる。さ
らに、上記書き換え回数制限型メモリ上における論理ペ
ージに発生した書き込みが上記RAMに対して行われる
ことなり、結果として上記書き換え回数制限型メモリの
更なる長寿命化が図られる。
According to the above configuration, when an access exception requiring a write to a write-inhibited page on the memory with a limited number of rewrites occurs, the logical page in the logical address space for which the write is requested is generated. Is mapped to a physical page on the physical address space of the RAM, so that writing to a write-inhibited page on the memory with limited number of rewrites can be performed thereafter. Furthermore, the writing that has occurred in the logical page on the memory with limited number of rewrites is performed on the RAM, and as a result, the life of the memory with limited number of rewrites can be further extended.

【0021】また、請求項6に係る発明は、請求項1乃
至請求項5の何れか一つに係る発明のメモリ管理装置に
おいて、上記書き換え回数制限型メモリは、フラッシュ
メモリであることを特徴としている。
According to a sixth aspect of the present invention, in the memory management device according to any one of the first to fifth aspects, the memory for limiting the number of times of rewriting is a flash memory. I have.

【0022】また、請求項7に係る発明は、書き換え回
数制限型メモリとランダム・アクセス・メモリと上記両
メモリの論理アドレスを物理アドレスに変換するアドレ
ス変換部を有するシステムのメモリ管理装置として機能
させるためのプログラムを記録したコンピュータ読み取
り可能な記録媒体であって、上記書き換え回数制限型メ
モリあるいはランダム・アクセス・メモリの未使用領域
が所定の大きさより小さい場合に、この未使用領域が小
さいメモリに対してガーベジコレクション処理を行うガ
ーベジコレクション実行部と、上記各メモリに対するデ
ータの割り付け単位を表す情報であるオブジェクトに対
して、上記各メモリに対する新規オブジェクトの割り付
け時、あるいは、上記ガーベジコレクション処理実行時
に、上記ガーベジコレクション処理によって回収されず
且つ当該ガーベジコレクション処理時まで書き込みが行
われなかった場合に増加する安定度を設定する安定度設
定部と、上記各メモリに対する新規オブジェクトの割り
付け時、あるいは、上記ガーベジコレクション処理実行
時に、上記安定度設定部によって設定された安定度が所
定値以下のオブジェクトを上記ランダム・アクセス・メ
モリに割り付ける一方、上記安定度が上記所定値より高
いオブジェクトを上記書き換え回数制限型メモリに割り
付けるオブジェクト割付部として機能させるためのプロ
グラムを記録したことを特徴としている。
According to a seventh aspect of the present invention, a memory management device for a system having a memory having a limited number of rewrites, a random access memory, and an address conversion unit for converting logical addresses of both memories into physical addresses. Computer-readable recording medium on which a program for storing a program for rewriting is limited, and when the unused area of the memory for limiting the number of rewrites or the random access memory is smaller than a predetermined size, A garbage collection execution unit that performs garbage collection processing, and when allocating a new object to each memory or for an object that is information indicating a unit of data allocation to each memory, Garbage A stability setting unit for setting a stability that is increased when the data is not collected by the collection processing and writing is not performed until the garbage collection processing; and when a new object is allocated to each of the memories, or when the garbage collection processing is performed. At the time of execution, an object whose stability set by the stability setting unit is equal to or less than a predetermined value is allocated to the random access memory, and an object whose stability is higher than the predetermined value is allocated to the rewrite limit memory. It is characterized by recording a program for functioning as an object allocating unit.

【0023】[0023]

【発明の実施の形態】以下、この発明を図示の実施の形
態により詳細に説明する。図1は本実施の形態のメモリ
管理装置が搭載された計算機システムにおけるブロック
図である。尚、本実施の形態においては、書き換え回数
に制限のあるEEPROMとしてフラッシュメモリが使
用されているものとする。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, the present invention will be described in detail with reference to the illustrated embodiments. FIG. 1 is a block diagram of a computer system equipped with the memory management device according to the present embodiment. In this embodiment, it is assumed that a flash memory is used as an EEPROM having a limited number of rewrites.

【0024】図1に示す計算機システム1は、本実施の
形態の特徴であるメモリ管理装置2と、データ用メモリ
が登載されたメモリ部5と、メモリ管理装置2における
管理情報に従ってプログラムやデータ上のメモリアドレ
ス(論理アドレス)をハードウェア上のメモリアドレス
(物理アドレス)に変換するメモリ管理ユニット(以
下、MMUと略称する)4と、メモリ管理装置2,MM
U4およびメモリ部5を制御して上記アドレス変換やガ
ーベジコレクション等を行うCPU(中央演算処理装
置)3で概略構成される。
The computer system 1 shown in FIG. 1 has a memory management device 2 which is a feature of the present embodiment, a memory unit 5 in which a data memory is mounted, and a program and data according to management information in the memory management device 2. Memory management unit (hereinafter abbreviated as MMU) 4 for converting a memory address (logical address) of the memory device into a memory address (physical address) on hardware;
A CPU (Central Processing Unit) 3 that controls the U4 and the memory unit 5 to perform the above-described address conversion, garbage collection, and the like.

【0025】上記メモリ部5に登載されたデータ用メモ
リは、書き換え回数制限型メモリであるフラッシュメモ
リ7と読み書き可能なRAM8から構成されている。上
記メモリ管理装置2は、アドレス変換表格納部9,物理
アドレス空間管理部10,論理アドレス空間管理部l
l,安定度設定部12,ガーベジコレクション実行部1
3およびオブジェクト割付部14から構成されている。
The data memory mounted on the memory unit 5 is composed of a flash memory 7 which is a memory for limiting the number of rewrites and a readable / writable RAM 8. The memory management device 2 includes an address conversion table storage unit 9, a physical address space management unit 10, a logical address space management unit l.
1, stability setting unit 12, garbage collection execution unit 1
3 and an object allocation unit 14.

【0026】上記アドレス変換表格納部9はRAMで構
成されて、上記論理アドレスと物理アドレスとの対応を
示すアドレス変換表が格納されている。このアドレス変
換表は、MMU4が上記アドレス変換を行う際に参照さ
れる。上記物理アドレス空間管理部10は、物理アドレ
ス空間上の使用領域と未使用領域を管理する。上記論理
アドレス空間管理部llは、論理アドレス空間上の使用
領域と未使用領域を管理する。
The address conversion table storage section 9 is constituted by a RAM, and stores an address conversion table indicating the correspondence between the logical addresses and the physical addresses. The address conversion table is referred to when the MMU 4 performs the address conversion. The physical address space management unit 10 manages a used area and an unused area in the physical address space. The logical address space management unit 11 manages a used area and an unused area in the logical address space.

【0027】上記安定度設定部12は、アプリケーショ
ンプログラムが要求するデータの割り付け単位を表す情
報(オブジェクト)に対して、「ガーベジコレクション
による回収されにくさ」と「書き込みの起こりにくさ」
とを合わせた指標(数値)である「安定度」を設定す
る。ここで、上記「回収」とは、後に詳述するように、
ガーベジコレクションを実行する際に、あるオブジェク
トがゴミとなって引き上げられることである。
The above-mentioned stability setting unit 12 provides information on the information (object) indicating the unit of data allocation requested by the application program, such as "the difficulty of being collected by garbage collection" and the "the difficulty of writing."
Set "stability" which is an index (numerical value) obtained by combining. Here, the “recovery” means, as described in detail later,
When performing garbage collection, an object becomes garbage and is lifted.

【0028】上記「安定度」の設定は、以下のように行
われる。 ・新規に割り付けられたオブジェクトの安定度を最小
(本実施の形態では「0」)にする。 ・ある安定度を有するオブジェクト群については、上記
安定度になってから、上記安定度に対して定められてい
る所定回数だけガーベジコレクションが施された後に、
上記安定度を(本実施の形態では「l」だけ)増加す
る。但し、その所定回数のガーベジコレクションの間に
書き込みが行われたオブジェクトに関しては、上記安定
度の増加を抑制する。
The setting of the "stability" is performed as follows. -Minimize the stability of the newly allocated object ("0" in the present embodiment). For an object group having a certain degree of stability, after the above-mentioned degree of stability, after the garbage collection is performed a predetermined number of times determined for the degree of stability,
The above-mentioned stability is increased (in this embodiment, by “l”). However, with respect to the objects written during the predetermined number of garbage collections, the increase in the stability is suppressed.

【0029】上記ガーベジコレクション実行部13は、
上記データ用メモリの未使用領域が減少したときにガー
ベジコレクションを実行する。また、オブジェクト割付
部14は、新規オブジェクトを論理アドレス空間に割り
付けたり、ガーべジコレクション処理の際に安定度が変
化したオブジェクトを新たな安定度の領域に割り付け直
したりする。
The garbage collection execution unit 13
Garbage collection is performed when the unused area of the data memory decreases. Further, the object allocating unit 14 allocates a new object to a logical address space, or reallocates an object whose stability has changed during the garbage collection process to a new stability area.

【0030】上記構成の計算機システム1は、以下のよ
うに動作する。ここで、上記メモリ部5のフラッシュメ
モリ7には低安定度(安定度0と安定度1)のオブジェ
クトが設定される一方、RAM8には高い安定度(安定
度2と安定度3)のオブジェクトが設定されている。先
ず、上記CPU3によって新規オブジェクトの割り付け
要求がなされると、安定度設定部12によって新規オブ
ジェクトの安定度が最低安定度「0」に設定され、オブ
ジェクト割付部14によって論理アドレス空間管理部l
lの管理情報が参照されてRAM8用の論理アドレス空
間上の未使用領域に割り付けられる。その際に、上記R
AM8用の論理アドレス空間上に新規オブジェクトを割
り付け可能な程度の未使用領域が無い場合には、ガーベ
ジコレクション実行部13によって論理アドレス空間上
における安定度「0」のオブジェクト群が連続して設定
されている領域に対してガーベジコレクション処理を実
行して十分な未使用領域を得る。尚、十分な未使用領域
が得られない場合には、十分な未使用領域が得られるま
でより高い安定度の領域を順次加えながらガーベジコレ
クション処理を行う。こうして、常時論理アドレス空間
の総ての領域に対して一様にガーベジコレクション処理
を実行するよりも少ないガーベジコレクション回数で処
理時間の短縮を図り、早い時期にゴミとなってしまう低
安定度のオブジェクトに対するガーベジコレクション処
理の頻度を高くしてオブジェクトの回収率を高める。
The computer system 1 having the above configuration operates as follows. Here, objects of low stability (stability 0 and stability 1) are set in the flash memory 7 of the memory unit 5, while objects of high stability (stability 2 and stability 3) are set in the RAM 8. Is set. First, when a new object allocation request is made by the CPU 3, the stability of the new object is set to the minimum stability "0" by the stability setting unit 12, and the logical address space management unit 1 is set by the object allocation unit 14.
1 is referred to and allocated to an unused area in the logical address space for the RAM 8. At this time, the above R
When there is no unused area in the logical address space for AM8 to such an extent that a new object can be allocated, the garbage collection executing unit 13 continuously sets an object group having a stability of “0” in the logical address space. The garbage collection process is performed on the existing area to obtain a sufficient unused area. If a sufficient unused area cannot be obtained, the garbage collection process is performed while sequentially adding areas with higher stability until a sufficient unused area is obtained. In this way, the processing time can be reduced with a smaller number of garbage collections than when the garbage collection processing is performed uniformly for all areas of the logical address space at all times, and low-stability objects that become garbage at an early stage are reduced. The frequency of the garbage collection process is increased to increase the object collection rate.

【0031】上記安定度設定部12は、ガーベジコレク
ション実行部13によって論理アドレス空間の安定度N
の領域に所定回数XNだけガーベジコレクション処理が
行われた際に、他のオブジェクトとの参照関係が成立す
るためにゴミとなって回収されることがなく、且つ、そ
れまでに書き込みが行われなかったオブジェクトの安定
度を(N+1)に増加させる。そして、安定度が「l」
から「2」に増加されるオブジェクトは、オブジェクト
割付部14によって、上記XN回目のガーベジコレクシ
ョン処理の際にRAM8側からフラッシュメモリ7側に
割り付け直される。こうして、書き込みが行われないと
予測される安定したオブジェクトのみをガーベジコレク
ション処理に伴う書き換えの頻度が少ないフラッシュメ
モリ7側に集めることによって、フラッシュメモリ7の
長寿命化を図るのである。
The stability setting unit 12 controls the stability N of the logical address space by the garbage collection execution unit 13.
In the area when the only garbage collection process has been performed for a predetermined number of times X N, is that there is no the recovered a waste for reference relationships with other objects is satisfied, and the write is performed so far The stability of the missing object is increased to (N + 1). And the stability is "l"
Objects to be increased to "2" from the by the object allocation unit 14, is re allocated to the flash memory 7 side from the RAM8 side when the X N-th garbage collection process. In this manner, the life of the flash memory 7 is extended by collecting only stable objects predicted not to be written in the flash memory 7 where rewriting is less frequently performed in the garbage collection process.

【0032】以下、上記MMU4,安定度設定部12,
ガーベジコレクション実行部13およびオブジェクト割
付部14の動作についてより詳細に説明する。図2は、
上記オブジェクトの構成を示す概念図である。上記オブ
ジェクトは、一つの連続した論理アドレス空間上に低位
番地から高位番地に向かって順次配列されている。そし
て、一つのオブジェクトの構成は、ガーベジコレクショ
ン実行部13によってガーベジコレクション処理を実行
するために、以下のような特徴を有している。 (A)上記オブジェクトは、先頭を表すヘッダ21,参
照するオブジェクトの数22および参照するオブジェク
トのポインタ23,23,…の情報格納領域から成り、
各情報格納領域は夫々1ワードの大きさを持つ。そし
て、ヘッダ21の先頭には1ビットの書き込みフラグ2
4が設定され、次の1ビットにはマークフラグ25が設
定されている。これらのフラグは何れも負論理であっ
て、初期値は「1」である。上記書き込みフラグ24に
は、当該オブジェクトに書き込みが行われた場合に
「0」が書き込まれる(以下、このことを「セットす
る」と言う)。そして、当該オブジェクトにガーベジコ
レクション処理が実行される際に「1」にクリアされ
る。したがって、書き込みフラグ24を監視すること
で、安定度を増加するのに必要な上記所定回数のガーベ
ジコレクションの間に、当該オブジェクトに書き込みが
行われたが否かを知ることができるのである。上記マー
クフラグ25には、当該オブジェクトが他のオブジェク
トから参照されている場合に、ガーベジコレクションの
際に「0」が書き込まれる(以下、このことを「セット
する」と言う)。上記フラッシュメモリ7は、各ブロッ
クのデータを消去した後には全ワードの各ビットに
「1」が書き込まれており、各ビットの「1」を「0」
に書き換えることは可能(逆は不可)である。そこで、
フラッシュメモリ7上に設定された論理アドレス空間に
配置されたオブジェクトの場合にも、書き込みフラグ2
4やマークフラグ25を実現できるのである。本実施の
形態においては、フラッシュメモリ上のオブジェクトに
関しては、マークフラグ25のみを設定する。
Hereinafter, the MMU 4, the stability setting unit 12,
The operations of the garbage collection execution unit 13 and the object allocation unit 14 will be described in more detail. FIG.
FIG. 3 is a conceptual diagram showing a configuration of the object. The objects are sequentially arranged in one continuous logical address space from a lower address to a higher address. The configuration of one object has the following features in order for the garbage collection execution unit 13 to execute the garbage collection process. (A) The object includes a header 21 representing the head, a number 22 of objects to be referenced, and an information storage area of pointers 23, 23,.
Each information storage area has a size of one word. At the head of the header 21, a 1-bit write flag 2
4 is set, and the mark flag 25 is set in the next one bit. Each of these flags has negative logic, and the initial value is “1”. In the write flag 24, “0” is written when writing is performed on the object (hereinafter, this is referred to as “set”). Then, it is cleared to “1” when the garbage collection process is performed on the object. Therefore, by monitoring the write flag 24, it is possible to know whether or not writing has been performed on the object during the predetermined number of garbage collections necessary for increasing the stability. When the object is referenced from another object, “0” is written to the mark flag 25 at the time of garbage collection (hereinafter, this is referred to as “set”). In the flash memory 7, "1" is written to each bit of all words after erasing data of each block, and "1" of each bit is changed to "0".
It is possible to rewrite to (the reverse is not possible). Therefore,
In the case of an object located in the logical address space set on the flash memory 7, the write flag 2
4 and the mark flag 25 can be realized. In the present embodiment, only the mark flag 25 is set for an object on the flash memory.

【0033】(B)上記ポインタ23には、参照される
他のオブジェクトの先頭(ヘッダ21)の論理アドレス
が書き込まれる。 (C)オブジェクトの途中のワードを指す論理アドレス
から当該オブジェクトの先頭の論理アドレスを知ること
ができる。これは、ヘッダ21に、参照するオブジェク
トの数22に書き込まれる「数」の情報あるいはオブジ
ェクトのポインタ23に書き込まれる「ポインタ」の情
報と識別可能なパターンを呈する情報を付加し、オブジ
ェクトの途中のワードを指す論理アドレスから低位番地
の方に上記パターンを呈する情報を検索することによっ
て可能となる。
(B) In the pointer 23, the logical address of the head (header 21) of another object to be referred to is written. (C) The head logical address of the object can be known from the logical address indicating a word in the middle of the object. This is done by adding, to the header 21, information indicating “number” written in the number 22 of the referenced object or information indicating a pattern identifiable with the information of “pointer” written in the pointer 23 of the object, This can be achieved by searching for information exhibiting the above pattern from a logical address indicating a word to a lower address.

【0034】本実施の形態においては、図2に示すよう
に、同じ安定度を有するオブジェクトを同一論理アドレ
ス空間上に連続して配置する。そして、論理アドレス空
間管理部llで、各論理アドレス空間に配置されたオブ
ジェクト群の安定度と、その安定度を持つオブジェクト
群が配置されている領域の論理アドレス上の範囲を管理
しておく。こうすることによって、安定度設定部12
は、論理アドレス空間管理部llにオブジェクト群の先
頭アドレスを問い合わせることによって、各オブジェク
トに付与された安定度を知ることができるのである。
In this embodiment, as shown in FIG. 2, objects having the same degree of stability are continuously arranged on the same logical address space. Then, the logical address space management unit 11 manages the stability of the object group arranged in each logical address space and the range on the logical address of the area where the object group having the stability is arranged. By doing so, the stability setting unit 12
Can inquire the stability given to each object by inquiring the logical address space management unit 11 about the head address of the object group.

【0035】図3は、上記CPU3によって書き込みが
要求された際に、MMU4によって行われるアドレス変
換の一例の様子を示す概念図である。図3に示すよう
に、論理アドレス空間には、フラッシュメモリ7用に設
定された連続空間と、RAM8用に設定された連続空間
とがある。尚、他にROM6用の連続空間もあるが、本
実施の形態においては省略する。同様に、物理アドレス
空間にも、フラッシュメモリ7上に設定された連続空間
と、RAM8上に設定された連続空間とがある。
FIG. 3 is a conceptual diagram showing an example of address conversion performed by the MMU 4 when a write is requested by the CPU 3. As shown in FIG. 3, the logical address space includes a continuous space set for the flash memory 7 and a continuous space set for the RAM 8. Note that there is another continuous space for the ROM 6, but this is omitted in the present embodiment. Similarly, the physical address space includes a continuous space set on the flash memory 7 and a continuous space set on the RAM 8.

【0036】通常、上記MMU4によるアドレス変換
は、バックアップ用の2次記憶装置を用いて、大きな論
理アドレス空間を小さな物理アドレス空間に写像する
「仮想記憶」のために用いられることが多い。しかしな
がら、本実施の形態においては、説明の都合上、ディス
ク等の2次記憶装置を持たず、RAM8に関しては設定
された物理アドレス空間よりも論理アドレス空間の方が
小さいものとする。
Usually, the address conversion by the MMU 4 is often used for "virtual storage" in which a large logical address space is mapped to a small physical address space by using a secondary storage device for backup. However, in the present embodiment, for the sake of explanation, it is assumed that no secondary storage device such as a disk is provided, and the logical address space of the RAM 8 is smaller than the set physical address space.

【0037】図3において、オブジェクトaはフラッシ
ュメモリ7側に在って、アドレス変換の単位領域(以
下、ページと言う)Pより小さい領域を有している。オ
ブジェクトbはフラッシュメモリ7側に在って、ページ
Pより大きい領域を有している。オブジェクトcはRA
M8側に在って、べージPより小さい領域を有してい
る。オブジェクトdはRAM8側に在って、べージPよ
り大きい領域を有している。
In FIG. 3, the object a is located on the flash memory 7 side and has an area smaller than a unit area (hereinafter, referred to as a page) P for address conversion. The object b is located on the flash memory 7 side and has an area larger than the page P. Object c is RA
On the M8 side, it has an area smaller than the page P. The object d is located on the RAM 8 side and has an area larger than the page P.

【0038】上記MMU4は、主にフラッシュメモリ7
に写像されるフラッシュメモリ7側の論理アドレス空間
上のぺージであって、アドレス変換表格納部9に格納さ
れたアドレス変換表において「書き込み禁止」がエント
リされているページに対して、書き込みを行おうとする
「アクセス例外」を検知するアクセス例外検知手段15
を有している。そして、上記MMU4は、アクセス例外
検知手段15によって上記アクセス例外が検知された場
合には、この書き込み禁止のぺージが写像されたフラッ
シュメモリ7上の物理アドレス空間におけるぺージ(以
下、物理ページと略称する)の内容をRAM8上の物理
アドレス空間における未使用ページにコピーし、このコ
ピーされたRAM8上の物理ページを写像元のフラッシ
ュメモリ7側の論理アドレス空間におけるぺージ(以
下、論理ぺージと略称する)に対応付け直すのである。
こうすることによって、以後、書き込み禁止であった論
理ぺージに対して書き込みが可能になる。すなわち、上
記書き込み禁止が指定されるようなフラッシュメモリ7
をデータ用メモリとしても使用可能になるのである。
The MMU 4 mainly includes the flash memory 7
Is written on the page in the logical address space on the flash memory 7 side mapped to the page and for which "write inhibit" is entered in the address conversion table stored in the address conversion table storage unit 9. Access exception detecting means 15 for detecting an “access exception” to be performed
have. When the access exception detection unit 15 detects the access exception, the MMU 4 reads a page in the physical address space on the flash memory 7 onto which the write-protected page is mapped (hereinafter, referred to as a physical page). The abbreviated name) is copied to an unused page in the physical address space on the RAM 8, and the copied physical page on the RAM 8 is copied to a page (hereinafter referred to as a logical page) in the logical address space on the flash memory 7 side of the mapping source. ).
By doing so, it becomes possible to write to a logical page for which writing was prohibited thereafter. That is, the flash memory 7 in which the above-mentioned write prohibition is designated
Can also be used as a data memory.

【0039】図4は、上記アクセス例外発生時に行われ
るアドレス変換の様子を示す概念図である。図4におい
ては、フラッシュメモリ7用に設定された論理アドレス
空間上に在る上記オブジェクトbの最初の論理ぺージに
書き込み禁止が指定されており、この論理ページに対し
てCPU3によって書き込みが要求された場合に、MM
U4によって行われるオブジェクトbのアドレス変換の
様子を示している。
FIG. 4 is a conceptual diagram showing how the address conversion is performed when the access exception occurs. In FIG. 4, write protection is designated for the first logical page of the object b in the logical address space set for the flash memory 7, and writing is requested by the CPU 3 for this logical page. MM
The state of address conversion of the object b performed by U4 is shown.

【0040】上記アクセス例外時におけるアドレス変換
処理は以下のようにして行われる。図5は、上記MMU
4によって行われるアクセス例外アドレス変換処理動作
のフローチャートである。以下、図5に従って、上記ア
クセス例外時におけるアドレス変換処理について詳細に
説明する。
The address conversion process at the time of the above-mentioned access exception is performed as follows. FIG.
4 is a flowchart of an access exception address conversion processing operation performed by Step No. 4; Hereinafter, the address conversion processing at the time of the access exception will be described in detail with reference to FIG.

【0041】上記MMU4のアクセス例外検知手段15
によって上記アクセス例外が検知されると、アクセス例
外アドレス変換処理動作がスタートする。ステップS1
で、上記物理アドレス空間管理部10の管理情報に基づ
いて、RAM8上の物理アドレス空間からの未使用物理
ページの取得が行われる。ステップS2で、上記ステッ
プS1において未使用の物理ページが取得できたか否か
が判別される。その結果、取得できた場合にはステップ
S3に進み、取得できなかった場合にはステップS7に
進む。
The access exception detecting means 15 of the MMU 4
When the access exception is detected, the access exception address conversion operation starts. Step S1
Then, an unused physical page is obtained from the physical address space on the RAM 8 based on the management information of the physical address space management unit 10. In step S2, it is determined whether an unused physical page has been obtained in step S1. As a result, if it can be obtained, the process proceeds to step S3, and if it cannot be obtained, the process proceeds to step S7.

【0042】ステップS3で、上記ステップS2におい
て取得されたRAM8上の未使用物理ページに、アクセ
ス例外を起こしたフラッシュメモリ7上の物理ページ
(図3におけるフラッシュメモリ7上の物理ページ3
1)の内容がコピーされる。ステップS4で、上記物理
アドレス空間管理部10に対して、アクセス例外を起こ
したフラッシュメモリ7上の物理ページ31が未使用に
なったことが通知される。
In step S3, the unused physical page in the RAM 8 obtained in step S2 is replaced with the physical page on the flash memory 7 where the access exception has occurred (the physical page 3 on the flash memory 7 in FIG. 3).
The contents of 1) are copied. In step S4, the physical address space management unit 10 is notified that the physical page 31 on the flash memory 7 in which the access exception has occurred has become unused.

【0043】ステップS5で、上記ステップS3におい
てコピーされたRAM8上の物理ページ32にアクセス
例外を起こしたフラッシュメモリ7上の物理ページの元
の論理アドレスが対応付けられて書き込み可能になるよ
うに、上記アドレス変換表のエントリが書き換えられ
る。ステップS6で、上記アクセス例外を起こしたフラ
ッシュメモリ7側の論理ページ31が属するオブジェク
トbのへッダ21の書き込みフラグ24が「0」にセッ
トされる。そうした後、アクセス例外アドレス変換処理
動作を終了する。
At step S5, the physical page 32 on the RAM 8 copied at step S3 is made writable in association with the original logical address of the physical page on the flash memory 7 that caused the access exception. The entry in the address conversion table is rewritten. In step S6, the write flag 24 of the header 21 of the object b to which the logical page 31 of the flash memory 7 in which the access exception has occurred belongs is set to "0". After that, the access exception address conversion processing operation ends.

【0044】ここで、上述のように、上記RAM8に関
しては設定された物理アドレス空間よりも論理アドレス
空間の方が小さいので、物理アドレス空間には余分な領
域33(図4参照)が生ずる。そこで、上記ステップS
lにおいては、この余分な領域33から未使用物理ペー
ジの取得が行われて、論理アドレスと物理アドレスとの
割り付けの変更が行われるのである。そして、やがて余
分な領域33に未使用物理ページがなくなると、上記ス
テップS2において未使用物理ページが取得できないと
判別されて、ステップS7に進む。
Here, as described above, since the logical address space of the RAM 8 is smaller than the set physical address space, an extra area 33 (see FIG. 4) is generated in the physical address space. Therefore, step S
In 1, an unused physical page is obtained from the extra area 33, and the allocation between the logical address and the physical address is changed. When no unused physical pages are left in the extra area 33, it is determined in step S2 that an unused physical page cannot be acquired, and the process proceeds to step S7.

【0045】ステップS7で、例えば、「CPUのキャ
ッシュ」や「仮想記憶」の分野で公知の「LRUアルゴ
リズム(Least Recent Used Algorithm)」を用い
て、過去に上記ステップS1において取得されて使用さ
れている(つまり、フラッシュメモリ7用の論理アドレ
ス空間に割り付けられている)RAM8上の物理ぺージ
の中で、現時点から最も長い問アクセスされていない物
理ぺージが選出される。ステップS8で、上記物理アド
レス空間管理部10の管理情報に基づいて、フラッシュ
メモリ7上の物理アドレス空間から未使用の物理ぺージ
が選出される。ステップS9で、上記ステップS8にお
いて選出されたフラッシュメモリ7上の未使用物理ペー
ジのブロックデータが消去される。そうした後、この消
去された物理ぺージに、上記ステップS7において選出
されたRAM8上の最も長い問アクセスされていない物
理ぺージの内容がコピーされる。こうして、上記フラッ
シュメモリ7上の未使用の物理ページを再利用すること
によって、上記ステップS4において物理アドレス空間
管理部10に対して未使用の登録がなされたアクセス例
外を起こしたフラッシュメモリ7側の物理ぺージ31も
再使用されることになる。
In step S7, for example, using the "LRU algorithm (Least Recent Used Algorithm)" known in the fields of "cache of CPU" and "virtual memory", it was previously obtained and used in step S1. Among the physical pages on the RAM 8 that are located (ie, allocated to the logical address space for the flash memory 7), the physical page that has not been accessed for the longest time from the present time is selected. In step S8, an unused physical page is selected from the physical address space on the flash memory 7 based on the management information of the physical address space management unit 10. In step S9, the block data of the unused physical page on the flash memory 7 selected in step S8 is erased. After that, the content of the longest unaccessed physical page on the RAM 8 selected in step S7 is copied to the erased physical page. In this way, by reusing the unused physical page on the flash memory 7, the unused memory page in the flash memory 7 which has caused the access exception registered in the physical address space management unit 10 in step S4. The physical page 31 will also be reused.

【0046】ステップS10で、上記ステップS9にお
いてコピーされたフラッシュメモリ7上の物理ぺージに
上記ステップS7において選出されたRAM8上の物理
ぺージの元の論理アドレスが対応付けられるように、上
記アドレス変換表のエントリが書き換えられる。ステッ
プS11で、上記物理アドレス空間管理部10に対し
て、上記ステップS7において選出されたRAM8上の
物理ページが未使用になったことが通知される。そうし
た後、上記ステップSlに戻り、上記ステップS1にお
いて未使用が登録されたRAM8上の物理ぺージが取得
され、上記ステップS3においてアクセス例外を起こし
たフラッシュメモリ7上の物理ページの内容がコピーさ
れ、上記ステップS5において上記アドレス変換表のエ
ントリが書き換えられ、上記ステップS6において書き
込みフラグ24がセットされると、アクセス例外アドレ
ス変換処理動作を終了する。
At step S10, the physical page on the flash memory 7 copied at step S9 is associated with the original logical address of the physical page on the RAM 8 selected at step S7. The entry in the conversion table is rewritten. In step S11, the physical address space management unit 10 is notified that the physical page on the RAM 8 selected in step S7 has become unused. After that, the process returns to the step S1, the physical page in the RAM 8 registered as unused in the step S1 is obtained, and the content of the physical page in the flash memory 7 in which the access exception has occurred in the step S3 is copied. When the entry in the address conversion table is rewritten in step S5 and the write flag 24 is set in step S6, the access exception address conversion processing operation is terminated.

【0047】以上のようにして、アクセス例外アクセス
変換処理動作が終了した後は、図4に示すように、フラ
ッシュメモリ7側の論理アドレス空間上のオブジェクト
bにおけるアクセス例外を起こした論理ページの物理ペ
ージがRAM8上に割り付けられている。したがって、
書き込み禁止であったオブジェクトbの最初の論理ペー
ジに対して書き込み処理を継続できるのである。
As described above, after the access exception access conversion processing operation is completed, as shown in FIG. 4, the physical page of the logical page in which the access exception has occurred in the object b in the logical address space of the flash memory 7 side. Pages are allocated on the RAM 8. Therefore,
The writing process can be continued for the first logical page of the object b for which writing was prohibited.

【0048】ここで、厳密には、上記フラッシュメモリ
7のブロックサイズと物理ページのサイズが異なる場合
がある。すなわち、昨今の典型的な両サイズは1Kバイ
ト〜4Kバイト程度で同じであるが、一般的なフラッシ
ュメモリと32ビットCPU用MMUとに関しては、ブ
ロックサイズ≧ページサイズである。もし、ブロックサ
イズ>ページサイズである場合には、本来はブロックサ
イズ/ページサイズ分の物理ページをRAM8上に取得
することになるが、本実施の形態においては、簡単のた
めにブロックサイズ=ページサイズであるとする。
Here, strictly speaking, the block size of the flash memory 7 may be different from the physical page size. In other words, the two typical sizes are the same in the range of about 1 KB to 4 KB, but the block size ≧ the page size is satisfied for the general flash memory and the MMU for the 32-bit CPU. If the block size is larger than the page size, the physical pages corresponding to the block size / page size are originally acquired in the RAM 8, but in the present embodiment, the block size is equal to the page size for simplicity. Let's say the size.

【0049】次に、上記ガーベジコレクション実行部1
3によって行われるガーベジコレクションについて説明
する。図6は、上記論理アドレス空間上に新規のオブジ
ェクトが割り付けられる際の論理アドレス空間の様子を
示す。ここで、本実施の形態においては、上記RAM8
用の論理アドレス空間に設定されたオブジェクトの安定
度は、フラッシュメモリ7用の論理アドレス空間に設定
されたオブジェクトの安定度よりも低く定めてある。以
下、RAM8用の論理アドレス空間に配置されるオブジ
ェクトの安定度は「安定度0」と「安定度1」とであ
り、フラッシュメモリ7用の論理アドレス空間に配置さ
れるオブジェクトの安定度は「安定度2」と「安定度
3」とであるとする。
Next, the garbage collection execution unit 1
3 will be described. FIG. 6 shows a state of the logical address space when a new object is allocated on the logical address space. Here, in the present embodiment, the RAM 8
The stability of the object set in the logical address space for the flash memory 7 is set lower than the stability of the object set in the logical address space for the flash memory 7. Hereinafter, the stability of the objects arranged in the logical address space for the RAM 8 is “stability 0” and “stability 1”, and the stability of the objects arranged in the logical address space for the flash memory 7 is “stability 1”. It is assumed that "stability 2" and "stability 3".

【0050】図6において、上記CPU3によってメモ
リ管理装置2に対して、新規のオブジェクトに対する論
理アドレスの割り付けが要求されると、オブジェクト割
付部14によって、RAM8用の論理アドレス空間上の
安定度0の領域における未使用領域35の先頭(使用領
域36の最後尾の次ぎ)のアドレスからの新規オブジェ
クトのメモリ領域が割り付けられる。図7は、上記オブ
ジェクト割付部14によって行われる論理アドレス空間
上における安定度Nの領域に対するメモリ領域割り付け
処理動作のフローチャートである。ステップS21で、
上記論理アドレス空間上における安定度Nの未使用領域
に新規オブジェクトのメモリ領域が割り付け可能であ
り、且つ、新規オブジェクトのメモリ領域が割り付けら
れた後の未使用領域に所定の大きさ以上の領域が残るが
否かが判別される。その結果、割り付け可能で、且つ、
所定の大きさ以上の未使用領域が残る場合にはステップ
S23に進む。一方、そうでない場合(すなわち、割り
付け不可能である場合か、割り付け後に上記所定の大き
さ以上の領域が残らない場合)にはステップS22に進
む。ステップS22で、上記ガーベジコレクション実行
部13が起動されて、後に詳述するようにしてガーベジ
コレクション処理が実行される。そうした後、上記ステ
ップS21に戻り、割り付け可能であり、且つ、割り付
け後に上記所定の大きさ以上の領域が残ると判別される
とステップS23に進む。ステップS23で、上記論理
アドレス空間上における安定度Nの未使用領域の先頭か
ら新規オブジェクトのメモリ領域が割り付けられる。そ
うした後、メモリ領域割り付け処理動作を終了する。
In FIG. 6, when the CPU 3 requests the memory management device 2 to allocate a logical address to a new object, the object allocating unit 14 determines that the stability of the logical address space for the RAM 8 is zero. A memory area for a new object from the start address of the unused area 35 in the area (following the end of the used area 36) is allocated. FIG. 7 is a flowchart of the memory area allocation processing operation for the area of stability N in the logical address space performed by the object allocation section 14. In step S21,
A memory area of a new object can be allocated to an unused area of the stability N on the logical address space, and an area having a predetermined size or more is allocated to an unused area after the memory area of the new object is allocated. It is determined whether or not it remains. As a result, it is allocatable and
If an unused area equal to or larger than the predetermined size remains, the process proceeds to step S23. On the other hand, if not (ie, if allocation is not possible or no area larger than the predetermined size remains after allocation), the process proceeds to step S22. In step S22, the garbage collection execution unit 13 is started, and garbage collection processing is executed as described later in detail. After that, the process returns to the step S21, and if it is determined that the area can be allocated and the area larger than the predetermined size remains after the allocation, the process proceeds to the step S23. In step S23, a memory area for a new object is allocated from the top of the unused area of the stability N in the logical address space. After that, the memory area allocation processing operation ends.

【0051】上記メモリ領域割り付け処理動作のフロー
チャートにおける上記ステップS22において実行され
るガーベジコレクション処理は、特に限定されるもので
はないが、本実施の形態においては、スライディング・
コンパクション方式によるガーベジコレクション(Wegb
reit,B:「A generalized compactifiying garbagecol
lector」,Computer Journal,Vol.15,No.3,pp.20
4−208)によって行うものとする。
The garbage collection processing executed in step S22 in the flowchart of the memory area allocation processing operation is not particularly limited.
Garbage collection by compaction method (Wegb
reit, B: "A generalized compactifiying garbagecol
lector ", Computer Journal, Vol. 15, No. 3, pp. 20
4-208).

【0052】図8は、上記スライディング・コンパクシ
ョン方式によるガーベジコレクション処理による論理ア
ドレス空間の変遷を示す。このガーベジコレクション処
理は以下の手順によって行われる。 (1)マーク付け 図8(a)に示すように、参照関係の基準となり、且
つ、ゴミとなって回収されないような特定のオブジェク
ト(以下、ルートと言う)37から、参照するオブジェ
クトのポインタ23(図2参照)を走査して、参照され
ているオブジェクトを順次辿りながら、上記参照されて
いるオブジェクトのマークフラグ25(図2参照)に
「0」をセットする。尚、上記ルート37の存在領域
は、何れの論理アドレス空間の何れの安定度の領域であ
っても構わない。図8(a)の場合には、ルート37に
よってオブジェクトAが参照され、オブジェクトAによ
ってオブジェクトCとオブジェクトEとが参照されてい
る。したがって、オブジェクトA,C,Eのマークフラ
グ25がセットされ、オブジェクトB,Dのマークフラ
グ25はセットされない。
FIG. 8 shows the transition of the logical address space by the garbage collection process by the above-mentioned sliding compaction method. This garbage collection process is performed according to the following procedure. (1) Marking As shown in FIG. 8A, a pointer 23 of a reference object from a specific object (hereinafter referred to as a root) 37 which is a reference of a reference relationship and is not collected as garbage. The mark flag 25 (see FIG. 2) of the referenced object is set to “0” while scanning (see FIG. 2) the reference object sequentially. The area where the route 37 exists may be an area of any stability in any logical address space. In the case of FIG. 8A, the object A is referred to by the route 37, and the object C and the object E are referred to by the object A. Therefore, the mark flags 25 of the objects A, C, and E are set, and the mark flags 25 of the objects B and D are not set.

【0053】(2)移動量計算 図8(b)に示すように、マークフラグ25がセットさ
れないオブジェクトB,Dは使用されずにゴミとなるの
で、このゴミとなるオブジェクトB,Dのメモリ領域を
ゴミとはならないオブジェクトC,Eで詰めるために、
オブジェクトC,Eの移動量(つまり、論理アドレスの
変化量)を計算する。図8(b)の場合には、上記オブ
ジェクトCをゴミとなるオブジェクトBの位置に詰める
ための移動量(論理アドレスの変化量x)と、移動後の
オブジェクトCの直後の位置にオブジェクトEを詰める
ための移動量(論理アドレスの変化量y)が計算され
る。
(2) Calculation of Movement Amount As shown in FIG. 8B, objects B and D for which the mark flag 25 is not set are not used and become dust, so that the memory area of the dust objects B and D is used. Is packed with objects C and E that do not become garbage.
The movement amount of the objects C and E (that is, the change amount of the logical address) is calculated. In the case of FIG. 8B, the movement amount (the change amount x of the logical address) for packing the object C to the position of the garbage object B and the object E at the position immediately after the moved object C are set. The amount of movement (the amount of change y of the logical address) for packing is calculated.

【0054】(3)ポインタ補正 図8(c)に示すように、上記計算値に基づいて上記参
照関係において参照する側のオブジェクトAのポインタ
23の内容を参照される側のオブジェクトC,Eの移動
後の先頭論理アドレスに補正する。図8(c)の場合に
は、上記オブジェクトAにおけるオブジェクトEヘのポ
インタ23の内容が、移動後のオブジェクトEの先頭の
論理アドレス(論理アドレスβ―変化量y)に補正され
る。同様に、オブジェクトAにおけるオブジェクトCへ
のポインタ23の内容が、移動後のオブジェクトCの先
頭の論理アドレス(論理アドレスα―変化量x)に補正
される。
(3) Pointer Correction As shown in FIG. 8 (c), the contents of the pointer 23 of the object A referred to in the reference relationship in the reference relationship are calculated based on the calculated values of the objects C and E of the referred side. Correct to the head logical address after moving. In the case of FIG. 8C, the content of the pointer 23 to the object E in the object A is corrected to the logical address (logical address β-variation y) at the head of the moved object E. Similarly, the content of the pointer 23 to the object C in the object A is corrected to the first logical address (logical address α-variation x) of the moved object C.

【0055】(4)詰め合わせ 図8(d)に示すように、上記計算値に基づいて、ゴミ
とはならないオブジェクトC,Eを実際に詰める。図8
(d)の場合には、上記オブジェクトCがゴミとなるオ
ブジェクトBの位置に移動され、移動後のオブジェクト
Cの直後の位置にオブジェクトEが移動される。
(4) Packing As shown in FIG. 8D, objects C and E that do not become dust are actually packed based on the above calculated values. FIG.
In the case of (d), the object C is moved to the position of the object B that becomes dust, and the object E is moved to a position immediately after the moved object C.

【0056】上述のような手順で行われる上記スライデ
ィング・コンパクション方式によるガーベジコレクショ
ン処理では、論理アドレス空間上における処理の対象と
なる同一安定度の領域に対して2回〜3回の走査を要す
るが、ガーベジコレクション処理後に使用領域が詰め合
わせられるために小さな未使用領域を一つにまとめるこ
とができる。
In the garbage collection process according to the sliding compaction method performed in the above-described procedure, two or three scans are required for an area of the same stability to be processed in the logical address space. Since the used areas are packed after the garbage collection process, small unused areas can be combined into one.

【0057】ここで、上記論理アドレス空間上における
ガーベジコレクション処理の対象となる領域が安定度N
の領域であって、安定度M(M>N)の領域に存在する
オブジェクトによって参照されているオブジェクトが安
定度Nの領域に存在する場合には、安定度Nの領域に存
在する上記参照されているオブジェクトも、ガーベジコ
レクションの際に上記ルートとして扱う必要がある。こ
のようなルートを、安定度Mの領域に存在するオブジェ
クト群を走査せずに認識するために、本実施の形態にお
いては、以下のようにしている。
Here, the area to be subjected to the garbage collection process in the logical address space is the stability N
If the object referred to by the object existing in the area of the stability M (M> N) is present in the area of the stability N, the above-mentioned reference existing in the area of the stability N Must be treated as the above root during garbage collection. In order to recognize such a route without scanning the object group existing in the area of the stability M, the present embodiment is configured as follows.

【0058】すなわち、図9に示すように、上記論理ア
ドレス空間管理部llは、管理表として安定度間参照表
16を有している。そして、ガーベジコレクション処理
のマーク付けにおいて、フラッシュメモリ7側に在る高
い安定度M(=2)の参照オブジェクト38のポインタ
23にRAM8側に在る低い安定度N(=0)の被参照
オブジェクト39の先頭の論理アドレスを書き込む際
に、論理アドレス空間管理部llの安定度間参照表16
に参照オブジェクト38の先頭の論理アドレスと当該論
理アドレスが書き込まれたポインタ23のワード番号と
を書き込むのである。
That is, as shown in FIG. 9, the logical address space management unit 11 has an inter-stability reference table 16 as a management table. Then, in the marking of the garbage collection process, the pointer 23 of the reference object 38 of high stability M (= 2) on the flash memory 7 side is referred to as the referenced object of low stability N (= 0) on the RAM 8 side. When writing the first logical address of 39, the inter-stability reference table 16 of the logical address space management unit 11
Then, the head logical address of the reference object 38 and the word number of the pointer 23 in which the logical address is written are written.

【0059】こうすることによって、上記RAM8側の
論理アドレス空間における安定度0の領域に対してガー
ベジコレクション処理を実行する場合には、ガーベジコ
レクション実行部13は、先ず、論理アドレス空間管理
部llの安定度間参照表16を検索して、安定度間参照
表16で指定された論理アドレスにある参照オブジェク
ト38の指定されたワード番号のポインタ23を見る。
こうして、処理対象の安定度0よりも高い安定度M(=
1,2,3)の領域に存在する参照オブジェクト38に
よって参照されているオブジェクトであって、安定度0
の領域に存在する被参照オブジェクト39を検索する。
そして、得られた被参照オブジェクト39をガーベジコ
レクション実行の際に上記ルートとして扱うのである。
By doing so, when executing the garbage collection process on the area of the stability 0 in the logical address space on the RAM 8 side, the garbage collection execution unit 13 firstly executes the garbage collection process of the logical address space management unit 11. The inter-stability reference table 16 is searched to see the pointer 23 of the specified word number of the reference object 38 at the logical address specified in the inter-stability reference table 16.
In this way, the stability M (= higher than the stability 0 of the processing target)
An object that is referenced by the reference object 38 existing in the area of (1, 2, 3) and has a stability of 0
Is searched for the referenced object 39 existing in the area of.
Then, the obtained referenced object 39 is treated as the above-mentioned route when the garbage collection is executed.

【0060】尚、上述のような処理対象となる領域の安
定度Nより高い安定度Mの領域に存在する参照オブジェ
クト38によって参照されている被参照オブジェクト3
9を上記ルートとして扱う手法は、従来より知られてい
る(Ungar D:Generationscavenging : A non-di
sruptive high-performance storage reclamationalgor
ithm,ACM SIGPLAN Notices vol.19,no.5,1987)。
It is to be noted that the referenced object 3 referred to by the reference object 38 existing in the region having the stability M higher than the stability N of the region to be processed as described above.
The method of treating No. 9 as the above route is conventionally known (Ungar D: Generationscavenging: A non-di).
sruptive high-performance storage reclamationalgor
ithm, ACM SIGPLAN Notics vol.19, no.5, 1987).

【0061】上記ガーベジコレクション実行部13は、
上述のようにしてガーベジコレクション処理を行うので
あるが、例えば安定度0の領域に対してガーベジコレク
ション処理を行った結果、あまり回収が行われず、十分
な未使用領域を回復できなかったと判定した場合には、
一つ上の安定度「1」の領域を加えた安定度0の領域と
安定度1の領域とにガーベジコレクション処理を行うの
である。それでも十分な未使用領域を回復できない場合
には、さらに高い安定度の領域を加えてガーベジコレク
ション処理を行うのである。図10は、上記ガーベジコ
レクション実行部13によって行われるより高い安定度
の領域を順次加えて行われるガーベジコレクション処理
動作のフローチャートである。
The garbage collection execution unit 13
The garbage collection process is performed as described above. For example, as a result of performing the garbage collection process on the area of stability 0, when it is determined that the collection is not performed much and a sufficient unused area cannot be recovered. In
The garbage collection process is performed on the area of stability 0 and the area of stability 1 by adding the area of stability “1” one level higher. If a sufficient unused area cannot be recovered, a garbage collection process is performed by adding an area with higher stability. FIG. 10 is a flowchart of the garbage collection processing operation performed by the garbage collection execution unit 13 and sequentially adding higher stability areas.

【0062】ステップS31で、上記RAM8用の論理
アドレス空間における安定度0の領域に対してガーベジ
コレクション・サブルーチンが実行される。ステップS
32で、上記ステップS31の結果、十分な未使用領域
が回復できたか否かが判別される。その結果、十分な未
使用領域が回復できなかった場合にはステップS33に
進み、回復できた場合にはガーベジコレクション処理動
作を終了する。ステップS33で、上記RAM8用の論
理アドレス空間における安定度0および安定度1の領域
に対してガーベジコレクション・サブルーチンが実行さ
れる。ステップS34で、上記ステップS33の結果、
十分な未使用領域が回復できたか否かが判別される。そ
の結果、十分な未使用領域が回復できなかった場合には
ステップS35に進み、回復できた場合にはガーベジコ
レクション処理動作を終了する。ステップS35で、上
記RAM8用の論理アドレス空間における安定度0およ
び安定度1の領域と、フラッシュメモリ7用の論理アド
レス空間における安定度2の領域とに対して、ガーベジ
コレクション・サブルーチンが実行される。ステップS
36で、上記ステップS35の結果、十分な未使用領域
が回復できたか否かが判別される。その結果、十分な未
使用領域が回復できなかった場合にはステップS37に
進み、回復できた場合にはガーベジコレクション処理動
作を終了する。ステップS37で、上記RAM8用の論
理アドレス空間における安定度0および安定度1の領域
と、フラッシュメモリ7用の論理アドレス空間における
安定度2および安定度3の領域とに対して、ガーベジコ
レクション・サブルーチンが実行される。そうした後、
ガーベジコレクション処理動作を終了する。
In step S31, a garbage collection subroutine is executed for an area having a stability of 0 in the logical address space for the RAM 8. Step S
At 32, it is determined whether or not a sufficient unused area has been recovered as a result of the above step S31. As a result, if a sufficient unused area cannot be recovered, the process proceeds to step S33, and if recovered, the garbage collection processing operation ends. In step S33, a garbage collection subroutine is executed for the stability 0 and stability 1 areas in the logical address space for the RAM 8. In step S34, as a result of step S33,
It is determined whether a sufficient unused area has been recovered. As a result, if a sufficient unused area cannot be recovered, the process proceeds to step S35, and if recovered, the garbage collection processing operation ends. In step S35, a garbage collection subroutine is executed for the areas of stability 0 and 1 in the logical address space for the RAM 8 and the area of stability 2 in the logical address space for the flash memory 7. . Step S
At 36, it is determined whether or not a sufficient unused area has been recovered as a result of the step S35. As a result, if a sufficient unused area cannot be recovered, the process proceeds to step S37, and if recovered, the garbage collection processing operation ends. In step S37, the garbage collection subroutine is performed on the areas of stability 0 and stability 1 in the logical address space for the RAM 8 and the areas of stability 2 and stability 3 in the logical address space for the flash memory 7. Is executed. After that,
The garbage collection processing operation ends.

【0063】上述のように、本実施の形態においては、
上記ガーベジコレクション実行部13は、最も安定度の
低い領域からガーベジコレクション処理を行い、十分な
未使用領域が回復できなかった場合には、十分な未使用
領域が回復できるまで順次高い安定度の領域を加えてガ
ーベジコレクション処理を続行するようにしている。し
たがって、常時総ての論理アドレス空間に対して一様に
ガーベジコレクション処理を実行する場合に比して、ガ
ーベジコレクション処理の回数とガーベジコレクション
処理時間とを短縮でき、ガーベジコレクション処理によ
る他のシステムの実行の中断時間を短縮できるのであ
る。また、上述のごとく、安定度0と安定度1との低い
安定度の領域はRAM8用の論理アドレス空間に配置さ
れる一方、安定度2と安定度3との高い安定度の領域は
フラッシュメモリ7用の論理アドレス空間に配置されて
いる。したがって、ガーベジコレクションに付随して実
行される書き換えは、書き換え回数制限型メモリではな
いRAM8に対して頻繁に行われ、書き換え回数制限型
メモリであるフラッシュメモリ7に対しては少ない回数
で行われることになる。したがって、フラッシュメモリ
7の長寿命化が図られるのである。また、大部分のオブ
ジェクトが比較的短時間にゴミになる性質があることに
着目して、安定度の低い領域(つまり、安定度の低いオ
ブジェクト群)に対して高い頻度でガーベジコレクショ
ン処理を行うことによって、オブジェクトの回収率を上
げてメモリの利用効串を高めることができるのである。
As described above, in the present embodiment,
The garbage collection execution unit 13 performs the garbage collection process from the lowest stability area, and if a sufficient unused area cannot be recovered, the areas having higher stability are sequentially increased until a sufficient unused area can be recovered. To continue the garbage collection process. Therefore, the number of garbage collection processes and the garbage collection processing time can be reduced as compared with the case where the garbage collection process is performed uniformly for all logical address spaces at all times, and the garbage collection process of other systems can be shortened. The execution interruption time can be shortened. As described above, the low stability areas of the stability 0 and the stability 1 are arranged in the logical address space for the RAM 8, while the high stability areas of the stability 2 and the stability 3 are the flash memory. 7 in the logical address space. Therefore, the rewriting executed in conjunction with the garbage collection is frequently performed on the RAM 8 which is not the limited number of rewriting memories, and is performed with a small number of times on the flash memory 7 which is the limited number of rewriting memories. become. Therefore, the life of the flash memory 7 can be extended. Also, paying attention to the fact that most objects tend to become garbage in a relatively short time, garbage collection processing is performed with high frequency on regions with low stability (that is, a group of objects with low stability). By doing so, it is possible to increase the collection rate of the objects and increase the use efficiency of the memory.

【0064】上記安定度設定部12は、総ての論理アド
レス空間における各安定度N(N=0,1,2)の領域
毎に、ガーベジコレクション実行部13によって実行さ
れたガーベジコレクション処理回数を管理している。そ
して、安定度Nの領域に対するガーベジコレクション処
理回数が安定度N毎に設定されている所定回数XN(N
=1,2,3)に達すると、その安定度Nの領域に存在
するガーベジコレクション処理に付随する書き換え以外
の書き込みも上記回収も行われなかったオブジェクトの
安定度を(N+1)に設定する。ここで、本実施の形態
においては、上述したごとく、同じ安定度を有するオブ
ジェクトは同一論理アドレス空間上に連続して配置する
ようにしている。したがって、上述のように安定度Nの
領域中に在って安定度が(N+1)となったオブジェク
トは、安定度(N+1)の領域に移動させる必要があ
る。そこで、ガーベジコレクション実行部13によって
行われる実際のガーベジコレクション処理では、図8に
示す手順に加えて、当該ガーベジコレクション処理後に
安定度が(N+1)になるオブジェクトを安定度(N+
1)の領域に移動させる手順を要する。
The stability setting section 12 calculates the number of garbage collection processes executed by the garbage collection execution section 13 for each area of stability N (N = 0, 1, 2) in all logical address spaces. Managing. Then, the number of times of the garbage collection process for the area of the stability N is a predetermined number X N (N
= 1, 2, 3), the stability of the object existing in the area of the stability N and not subjected to the writing other than the rewriting associated with the garbage collection process and the collection is set to (N + 1). Here, in the present embodiment, as described above, objects having the same stability are arranged continuously in the same logical address space. Therefore, an object whose stability is (N + 1) in the area of stability N as described above needs to be moved to the area of stability (N + 1). Therefore, in the actual garbage collection process performed by the garbage collection execution unit 13, in addition to the procedure shown in FIG. 8, the object whose stability becomes (N + 1) after the garbage collection process is converted to the stability (N +
A procedure for moving to the area of 1) is required.

【0065】図llは、図10に示すガーベジコレクシ
ョン処理動作のフローチャートにおける上記ステップS
31,S33,S35,S37において実行されるガー
ベジコレクション・サブルーチンのフローチャートであ
る。図10に示すガーベジコレクション処理動作のフロ
ーチャートにおいて、安定度0の領域に対するガーベジ
コレクション処理が指令されるが、上記ステップS3
2,S34,S36において十分な未使用領域を回復で
きなかったと判別されると、ガーベジコレクション・サ
ブルーチンがスタートする。
FIG. 11 is a flow chart of the garbage collection processing operation shown in FIG.
It is a flowchart of a garbage collection subroutine executed in 31, S33, S35, S37. In the flowchart of the garbage collection processing operation shown in FIG. 10, the garbage collection processing is instructed for the area having the stability of 0.
If it is determined in S2 and S34 that a sufficient unused area cannot be recovered, the garbage collection subroutine starts.

【0066】ステップS41で、上記ルート37から、
ポインタ23を走査して参照されているオブジェクトを
順次辿りながら、参照されているオブジェクトのマーク
フラグ25がセットされる。ステップS42で、ゴミに
なるオブジェクトのメモリ領域をゴミにならないオブジ
ェクトで詰めるためのオブジェクトの移動量が計算され
る。ステップS43で、上記論理アドレス空間管理部l
lの管理情報を参照して、安定度が(N+1)となるオ
ブジェクトが存在するか否かが判別される。その結果、
存在する場合にはステップS44に進む一方、存在しな
い場合にはステップS47に進む。
In step S41, from the route 37,
The mark flag 25 of the referenced object is set while scanning the pointer 23 and sequentially tracing the referenced object. In step S42, the movement amount of the object for filling the memory area of the object that becomes dust with the object that does not become dust is calculated. In step S43, the logical address space management unit l
With reference to the management information 1, it is determined whether or not there is an object whose stability is (N + 1). as a result,
If it exists, the process proceeds to step S44. If it does not exist, the process proceeds to step S47.

【0067】ステップS44で、上記ステップS43に
おいて安定度が(N+1)となると判別された一つのオ
ブジェクトの移動量が、安定度(N+1)の領域におけ
る未使用領域の先頭への移動量に更新される。ステップ
S45で、上記ステップS43において安定度が(N+
1)となると判別された総てのオブジェクトに対する移
動量の更新が柊了したか否かが判別される。その結果、
終了していればステップS47に進み、終了していなけ
ればステップS46に進む。ステップS46で、上記安
定度(N+1)の領域に次のオブジェクトを移動可能な
だけの未使用領域が存在するが否かが判別される。その
結果、存在する場合には上記ステップS44に戻って次
のオブジェクトの移動量更新に移行する。一方、存在し
ない場合には、ステップS47に進む。
In step S44, the movement amount of one object determined to have the stability (N + 1) in step S43 is updated to the movement amount of the unused area in the area of the stability (N + 1) to the head. You. At step S45, the stability at step S43 is (N +
It is determined whether or not the update of the movement amount for all the objects determined to be 1) has been completed. as a result,
If the processing has been completed, the process proceeds to step S47, and if not, the process proceeds to step S46. In step S46, it is determined whether or not there is an unused area where the next object can be moved in the area of the stability (N + 1). As a result, if it exists, the flow returns to step S44 to shift to the movement amount update of the next object. On the other hand, if not present, the process proceeds to step S47.

【0068】ステップS47で、上記ステップS42に
おいて算出された移動量あるいは上記ステップS44に
おいて更新された移動量に基づいて、参照オブジェクト
のポインタ23の内容が被参照オブジェクトの移動後の
先頭論理アドレスに補正される。ステップS48で、上
記算出された移動量あるいはその後更新された移動量に
基づいて、ゴミとはならないオブジェクトの詰め合わせ
が行われる。その際に、安定度(N+1)の領域に移動
すべきオブジェクトがある場合には、オブジェクト割付
部14が起動されて、該当するオブジェクトの割り付け
直しが行われる。ステップS49で、上記ステップS4
6における判別結果に基づいて、上記ステップS43に
おいて安定度が(N+1)となると判別された総てのオ
ブジェクトが安定度(N+1)の領域に移動できるか否
かが判別される。その結果、総てのオブジェクトが移動
できればステップS50に進み、そうでなければステッ
プS51に進む。
In step S47, based on the movement amount calculated in step S42 or the movement amount updated in step S44, the content of the pointer 23 of the reference object is corrected to the head logical address after movement of the referenced object. Is done. In step S48, objects that do not become dust are packed based on the calculated movement amount or the movement amount updated thereafter. At this time, if there is an object to be moved in the area of stability (N + 1), the object allocating unit 14 is activated, and the relevant object is reallocated. In step S49, the above step S4
6, it is determined whether or not all the objects determined to have the stability (N + 1) in step S43 can move to the area of the stability (N + 1). As a result, if all objects can be moved, the process proceeds to step S50; otherwise, the process proceeds to step S51.

【0069】ステップS50で、例えば、(処理後の未
使用領域/処理前の未使用領域)の値と所定確との比較
によって、上記ステップS48の結果、十分な未使用領
域が回復できたか否かが判別される。その結果、十分な
未使用領域が回復できなかった場合にはステップS51
に進み、回復できた場合にはガーべジコレクション・サ
ブルーチンを終了して、図10に示すガーベジコレクシ
ョン処理動作のフローチャートにリターンする。ステッ
ブS51で、上記ガーベジコレクション実行部13内に
設定された回復フラグに「1」がセットされて、十分な
未使用領域が回復できなかったことが表示される。そう
した後、ガーベジコレクション・サブルーチンを終了し
て、図10に示すガーベジコレクション処理動作のフロ
ーチャートにリターンする。
In step S50, for example, by comparing the value of (unused area after processing / unused area before processing) with a predetermined probability, as a result of step S48, it is determined whether or not a sufficient unused area has been recovered. Is determined. As a result, if a sufficient unused area cannot be recovered, step S51
If the recovery is successful, the garbage collection subroutine ends, and the process returns to the flowchart of the garbage collection processing operation shown in FIG. At step S51, the recovery flag set in the garbage collection execution unit 13 is set to "1", indicating that a sufficient unused area could not be recovered. After that, the garbage collection subroutine ends, and the process returns to the flowchart of the garbage collection processing operation shown in FIG.

【0070】上述のように、上記ガーベジコレクション
・サブルーチンにおいては、安定度(N+1)の領域に
次のオブジェクトを移動可能なだけの未使用領域が存在
しない場合には、移動量の更新を中止して、そのまま詰
め合わせを行うようにしている。したがって、そのよう
な場合には、安定度Nの領域内に安定度(N+1)のオ
ブジェクトが混在することなる。しかしながら、そのよ
うな場合には、十分な未使用領域が回復できなかったと
して、上記回復フラグに「1」をセットするので、図1
0に示すガーベジコレクション処理動作のフローチャー
トにリターンした際に、上記ステップS32,S34,
S36において上記回復フラグが参照されて、十分な未
使用領域が回復できなかったと判別される。その結果、
次のステップで、安定度(N+1)のオブジェクトが混
在している安定度Nの領域と安定度(N+1)の領域と
に対してガーベジコレクション・サブルーチンが実行さ
れて、安定度(N+1)の領域に対する未使用領域の回
復が行われるのである。
As described above, in the garbage collection subroutine, if there is no unused area in which the next object can be moved in the area of stability (N + 1), updating of the movement amount is stopped. And assort them as they are. Therefore, in such a case, objects of the stability (N + 1) are mixed in the area of the stability N. However, in such a case, it is determined that a sufficient unused area cannot be recovered, and the recovery flag is set to “1”.
When returning to the flowchart of the garbage collection processing operation shown in FIG.
In S36, the recovery flag is referred to, and it is determined that a sufficient unused area cannot be recovered. as a result,
In the next step, the garbage collection subroutine is executed for the area of stability N and the area of stability (N + 1) in which objects of stability (N + 1) are mixed, and the area of stability (N + 1) is obtained. Of the unused area is recovered.

【0071】上述のように、本実施の形態においては、
上記オブジェクトに対して「ガーベジコレクションによ
る回収されにくさ」と「書き込みの起こりにくさ」とを
合わせ持つ「安定度」を設定する安定度設定部12を有
する。また、メモリ部5にデータ用メモリとしてのフラ
ッシュメモリ(書き換え回数制限メモリ)7とRAM8
とを設け、オブジェクト割付部14によって、フラッシ
ュメモリ7側の論理アドレス空間上には安定度が「0」
と「1」のオブジェクトを割り付ける一方、RAM8側
の論理アドレス空間上には安定度が「2」と「3」のオ
ブジェクトを割り付ける。
As described above, in the present embodiment,
The object has a stability setting unit 12 for setting “stability” having both “hardness of collection by garbage collection” and “hardness of writing”. A flash memory (memory for limiting the number of rewrites) 7 as a data memory and a RAM 8
The stability is “0” in the logical address space on the flash memory 7 side by the object allocating unit 14.
And the object of “1” are allocated, while the objects of stability “2” and “3” are allocated in the logical address space on the RAM 8 side.

【0072】そして、上記フラッシュメモリ7側の論理
アドレス空間上およびRAM8側の論理アドレス空間上
に割り付けられたオブジェクトに対して、CPU3から
書き込みが要求されると、MMU4によって、アドレス
変換表格納部9に格納されたアドレス変換表が参照され
てアドレス変換が行われて、図3に示すように、論理ア
ドレス空間上における当該オブジェクトの論理ページが
物理アドレス空間上に写像されて、この写像された物理
ページに従って書き込みが行われる。
When the CPU 3 requests writing of the objects allocated in the logical address space of the flash memory 7 and the logical address space of the RAM 8, the MMU 4 causes the address conversion table storage unit 9 to operate. The address conversion table stored in the logical address space is referred to, the address conversion is performed, and as shown in FIG. 3, the logical page of the object in the logical address space is mapped on the physical address space. Writing is performed according to the page.

【0073】また、上記MMU4のアクセス例外検知手
段15によって、CPU3から要求された書き込みがア
クセス例外であることが検知されると、MMU4は、書
き込み禁止の論理ページが写像されたフラッシュメモリ
7上の物理ページの内容をRAM8上の物理アドレス空
間における未使用ページにコピーし、このコピーされた
物理ページを写像元のフラッシュメモリ7側の論理ペー
ジに対応付け直す。このようにして、書き込み禁止であ
った論理ページを書き込み可能にすることによって、以
後の当該書き込み禁止のオブジェクトに対する書き込み
はRAM8上の物理ページに対して行われることとな
る。その結果、書き換え回数制限型のフラッシュメモリ
7に対する書き込み回数が減少されることになる。
When the access exception detecting means 15 of the MMU 4 detects that the write requested by the CPU 3 is an access exception, the MMU 4 reads the write-protected logical page on the flash memory 7 on which the logical page is mapped. The content of the physical page is copied to an unused page in the physical address space on the RAM 8, and the copied physical page is re-associated with the logical page on the flash memory 7 side of the mapping source. In this way, by making the write-protected logical page writable, subsequent writing to the write-protected object is performed on the physical page on the RAM 8. As a result, the number of times of writing to the flash memory 7 of the limited number of times of rewriting is reduced.

【0074】ここで、上記CPU3によって新規のオブ
ジェクトに対する論理アドレスの割り付けが要求される
と、安定度設定部12によって、上記新規オブジェクト
の安定度が最小値「0」に設定され、オブジェクト割付
部14によってRAM8用の論理アドレス空間上の安定
度0の領域の未使用領域の先頭に割り付けられる。その
際に、上記安定度0の領域に新規オブジェクトを割り付
けるだけの未使用領域が存在しない場合には、ガーベジ
コレクション実行部13によって、最も安定度の低いR
AM8の安定度0の領域に対してガーベジコレクション
が実行される。そして、十分な未使用領域が回復できな
い場合には、十分な未使用領域が回復できるまで順次高
い安定度の領域を加えてガーベジコレクション処理を繰
り返すのである。
Here, when the CPU 3 requests allocation of a logical address to a new object, the stability setting section 12 sets the stability of the new object to the minimum value “0”, and the object allocation section 14 Is assigned to the head of an unused area in the area of stability 0 in the logical address space for the RAM 8. At this time, if there is no unused area for allocating a new object to the area with the stability 0, the garbage collection execution unit 13 causes the garbage collection execution unit 13 to execute the R operation with the lowest stability.
Garbage collection is performed on the area of the stability level 0 of AM8. If a sufficient unused area cannot be recovered, the garbage collection process is repeated by sequentially adding areas of higher stability until a sufficient unused area can be recovered.

【0075】こうして、大部分のオブジェクトが比較的
短時間にゴミになる性質があることに着目して、RAM
8側の安定度の低い領域に対して高い頻度でガーベジコ
レクションを行うことによって、以下のような効果を奏
することができるのである。 ・ガーベジコレクション処理の回数と時間とを短縮で
き、他のシステムの実行の中断時間を短縮できる。 ・ガーベジコレクションに付随する書き換えを書き換え
回数制限型メモリであるフラッシュメモリ7に対して少
ない回数で行って、フラッシュメモリ7の長寿命化を図
ることができる。 ・オブジェクトの回収率を上げてメモリの利用効率を高
めることができる。
Focusing on the fact that most objects have the property of becoming dust in a relatively short time, the RAM
By performing garbage collection at a high frequency on the low stability area on the 8-side, the following effects can be obtained. The number and time of the garbage collection process can be reduced, and the interruption time of execution of other systems can be reduced. Rewriting associated with garbage collection is performed a small number of times on the flash memory 7 which is a memory with a limited number of rewritings, so that the life of the flash memory 7 can be extended. The memory collection efficiency can be improved by increasing the object collection rate.

【0076】また、上記安定度設定部12は、安定度N
の領域に対するガーベジコレクション処理回数が所定回
数XN(N=1,2,3)に達すると、その安定度Nの
領域に存在する書き込み(ガーベジコレクション処理に
付随する書き換え以外の書き込み)も上記回収も行われ
なかったオブジェクトの安定度を(N+1)に設定す
る。そして、ガーベジコレクション実行部13は、安定
度Nの領域に対してガーベジコレクション処理を行う際
に安定度が(N+1)に変更されるオブジェクトがあれ
ばそのオブジェクトを安定度(N+1)の領域に移動す
る。こうして、上記安定度毎に設定された所定回数のガ
ーベジコレクション処理が行われる間に上記書き込みが
行われない比較的安定したオブジェクトの安定度を増加
することによって、安定度が「2」以上と高いために書
き込み頻度が少ないと予測されるオブジェクトのみがフ
ラッシュメモリ7側に設定でき、フラッシュメモリ7の
更なる長寿命化を図ることができる。
The stability setting section 12 determines the stability N
When the number of times of garbage collection processing for the area reaches a predetermined number of times X N (N = 1, 2, 3), the write existing in the area of the stability N (write other than rewriting accompanying the garbage collection processing) is also collected. The stability of the object that has not been performed is set to (N + 1). Then, the garbage collection executing unit 13 moves the object to the area of the stability (N + 1) if there is an object whose stability is changed to (N + 1) when performing the garbage collection process on the area of the stability N. I do. Thus, by increasing the stability of a relatively stable object that is not written while the garbage collection process is performed a predetermined number of times set for each stability, the stability is as high as “2” or more. Therefore, only objects predicted to be less frequently written can be set in the flash memory 7, and the life of the flash memory 7 can be further extended.

【0077】また、書き込まれる可能性の高いオブジェ
クトは、被参照オブジェクトが変化することによってゴ
ミを発生する可能性が高い。そこで、上記安定度が
「2」であるオブジェクトは、所定回数X2にわたるガ
ーベジコレクション処理によって回収されなくとも、そ
の間に書き込みが行われた場合には安定度は「3」には
ならないようにして最もガーベジコレクション処理の頻
度の高い安定度「2」の領域に止め置くのである。つま
り、フラッシュメモリ7側にあるオブジェクトであって
も書き込まれる可能性の高いオブジェクトは最もガーべ
ジコレクション処理の頻度の高い領域に止め置くことに
よって、発生されたゴミがガーべジコレクション処理に
よって回収され易くなって、オブジェクトの回収率を更
に上げることができるのである。
An object that is highly likely to be written is more likely to generate dust due to a change in the referenced object. Therefore, even if the object having the stability of “2” is not collected by the garbage collection process for the predetermined number of times X2, if the writing is performed during that time, the stability does not become “3”. The garbage collection process is stopped in the area of high stability "2". In other words, even if the object is on the flash memory 7 side, the object that is likely to be written is stopped in the area where the garbage collection process is most frequent, and the generated garbage is collected by the garbage collection process. Therefore, the collection rate of the object can be further increased.

【0078】なお、上述したメモリ管理装置として機能
させるために、その処理を実行するためのプログラムを
フロッピーディスクやCDROM等のコンピュータ読み
取り可能な記録媒体に予め記録させておいて、必要に応
じてコンピュータにインストールさせて用いてもよい。
In order to function as the above-described memory management device, a program for executing the processing is recorded in a computer-readable recording medium such as a floppy disk or a CD-ROM in advance, and the computer is used as necessary. May be installed and used.

【0079】[0079]

【発明の効果】以上より明らかなように、請求項1に係
る発明のメモリ管理装置または請求項7に係る発明のコ
ンピュータ読み取り可能な記録媒体によれば、書き換え
回数制限型メモリあるいはRAMに対する新規オブジェ
クトの割り付け時、および、ガーベジコレクション実行
部によるガーベジコレクション処理実行時に、安定度設
定部によって、オブジェクトに対して、上記ガーベジコ
レクション処理によって回収されず且つ当該ガーベジコ
レクション処理時まで書き込みが行われなかった場合に
増加する安定度を設定し、オブジェクト割付部によっ
て、上記設定された安定度が所定値以下であるオブジェ
クトをRAMに割り付ける一方、上記安定度が上記所定
値より高いオブジェクトを上記書き換え回数制限型メモ
リに割り付けるので、ガーベジコレクション処理によっ
て回収されにくく、且つ、書き込みが起こりにくいオブ
ジェクト群が上記書き換え回数制限型メモリに割り付け
られる。したがって、この発明によれば、上記書き換え
回数制限型メモリに対する書き換えや書き込みを押さえ
て、上記書き換え回数制限型メモリの長寿命化を図るこ
とができる。
As is apparent from the above description, according to the memory management device of the first aspect or the computer-readable recording medium of the seventh aspect, a new object for a memory with a limited number of rewrites or a RAM can be provided. When the garbage collection process is performed by the stability setting unit when the garbage collection process is performed by the stability setting unit when the garbage collection process is performed by the garbage collection process and when writing is not performed until the garbage collection process. The object allocating unit allocates an object whose stability is equal to or less than a predetermined value to a RAM, and assigns an object whose stability is higher than the predetermined value to the memory for limiting the number of times of rewriting. Because it is assigned to Hardly recovered by garbage collection process, and the write is unlikely object group is assigned to the rewritable count limited memory. Therefore, according to the present invention, the life of the memory with limited number of rewrites can be prolonged by suppressing rewriting and writing to the memory with limited number of rewrites.

【0080】また、請求項2に係る発明のメモリ管理装
置におけるガーベジコレクション実行部は、上記安定度
の高いオブジェクトが割り付けられている領域よりも、
上記安定度の低いオブジェクトが割り付けられている領
域に対して、高い頻度で上記ガーベジコレクション処理
を行うので、上記ガーベジコレクション処理に付随する
書き換えは、上記安定度の低いオブジェクトが割り付け
られている上記RAMに対して頻繁に行われることにな
る。したがって、上記書き換え回数制限型メモリの更な
る長寿命化を図ることができる。また、上記安定度が低
く、ゴミ化しやすいオブジェクト群に対して高い頻度で
上記ガーベジコレクション処理を行うことによって、オ
ブジェクトの回収率を上げてメモリの利用効率を高める
ことができる。さらに、上記安定度の低いオブジェクト
が割り付けられている領域に対して高い頻度で上記ガー
ベジコレクション処理が行われるので、全領域に対して
一様に上記ガーべジコレクション処理を実行する場合よ
りも処理時間を短縮でき、他の処理の中断時間を短縮で
きる。したがって、利用者に対する応答性がよくなる。
Further, the garbage collection execution unit in the memory management device according to the second aspect of the present invention is arranged such that the garbage collection execution unit sets
Since the garbage collection process is performed with high frequency on the area to which the low-stability object is allocated, rewriting accompanying the garbage collection process is performed in the RAM to which the low-stability object is allocated. Will be performed frequently. Therefore, it is possible to further extend the life of the memory of the rewrite limit type. In addition, by performing the garbage collection process on a group of objects having low stability and easily becoming garbage at a high frequency, it is possible to increase the object collection rate and increase the memory use efficiency. Further, since the garbage collection process is performed with high frequency on the area where the object with low stability is allocated, the processing is performed more efficiently than when the garbage collection processing is uniformly performed on the entire area. The time can be reduced, and the interruption time of other processing can be reduced. Therefore, responsiveness to the user is improved.

【0081】また、請求項3に係る発明のメモリ管理装
置におけるガーベジコレクション実行部は、所定の大き
さ以上の未使用領域が得られるまで、最も低い安定度の
オブジェクト群が割り付けられている領域に順次高い安
定度のオブジェクト群が割り付けられている領域を加え
て上記ガーベジコレクション処理を行うので、上記安定
度が低い程上記ガーベジコレクション処理の回数が多く
なる。したがって、上記安定度の高いオブジェクトが割
り付けられている上記書き換え回数制限型メモリに対す
る上記ガーベジコレクション処理に付随する書き換えを
少なくして、上記書き換え回数制限型メモリの更なる長
寿命化を図ることができる。また、ゴミ化しやすい低安
定度のオブジェクト群に対する上記ガーベジコレクショ
ン処理の頻度を上げてオブジェクトの回収率を高めるこ
とができる。さらに、上記未使用領域が所定の大きさよ
り少ないメモリの全領域に対して一様にガーベジコレク
ション処理を行う場合よりも処理時間を短縮して、他の
処理の中断時間を短縮できる。
Further, the garbage collection execution unit in the memory management device according to the third aspect of the present invention, the garbage collection execution unit sets an object area having the lowest stability until an unused area of a predetermined size or more is obtained. Since the garbage collection process is performed by sequentially adding the area to which the object group having the higher stability is allocated, the number of the garbage collection processes increases as the stability decreases. Therefore, it is possible to reduce the number of rewrites accompanying the garbage collection process for the limited number of rewrites memory to which the highly stable object is allocated, and to further extend the life of the limited number of rewrites memory. . In addition, the frequency of the garbage collection process for a low-stability object group that easily becomes garbage can be increased to increase the object collection rate. Furthermore, the processing time can be reduced as compared with the case where the garbage collection process is performed uniformly over the entire area of the memory where the unused area is smaller than the predetermined size, and the interruption time of other processing can be reduced.

【0082】また、請求項4に係る発明のメモリ管理装
置における安定度設定部は、上記新規オブジェクトの割
り付け時には、新規オブジェクトの安定度を最小値に設
定するので、殆どが短期間のうちにゴミと化する新規オ
ブジェクトを上記ガーベジコレクション処理回数の多い
上記RAMに割り付けて上記ガーベジコレクション処理
によって回収することができる。したがって、メモリの
利用効率を高めることができる。さらに、上記ガーベジ
コレクション処理実行時には、ガーベジコレクション処
理回数が所定回数になったオブジェクトであって上記所
定回数のガーベジコレクション処理の間に書き込みが行
われなかったオブジェクトの安定度を所定値だけ増加す
るので、上記書き換え回数制限型メモリには書き込みが
行われないと予測される安定したオブジエクトが割り付
けられることになる。したがって、上記書き換え回数制
限型メモリの更なる長寿命化を図ることができる。
Further, the stability setting section in the memory management device according to the fourth aspect of the present invention sets the stability of the new object to the minimum value when the new object is allocated. Can be allocated to the RAM where the number of garbage collection processes is large, and can be collected by the garbage collection process. Therefore, the use efficiency of the memory can be improved. Further, at the time of executing the garbage collection process, the stability of an object having the garbage collection process number of a predetermined number of times and not being written during the predetermined number of garbage collection processes is increased by a predetermined value. Thus, a stable object which is predicted not to be written is assigned to the memory of limited number of rewrites. Therefore, it is possible to further extend the life of the memory of the rewrite limit type.

【0083】また、請求項5に係る発明のメモリ管理装
置におけるアドレス変換部は、アクセス例外検知手段に
よってアクセス例外が検知された場合には、書き込みが
要求された論理アドレス空間上の論理ページが写像され
た上記書き換え回数制限型メモリの物理アドレス空間上
の物理ページの内容をRAMの物理アドレス空間上の未
使用の物理ページにコピーし、このコピーされた上記R
AMの物理ページを上記書き込みが要求された論理アド
レス空間上の論理ページに対応付けるので、書き込みが
要求された論理アドレス空間上の論理ページを上記RA
Mの物理アドレス空間上の物理ページに対応付け直すこ
とができる。したがって、以後は、上記書き換え回数制
限型メモリ上における書き込み禁止ページに対する書き
込みが可能となる。つまり、上記書き換え回数制限型メ
モリを通常のデータ用メモリとして使用できるのであ
る。
In the memory management device according to the fifth aspect of the present invention, when the access exception is detected by the access exception detecting means, the logical page on the logical address space requested to be written is mapped. The contents of the physical page in the physical address space of the limited number of times of rewriting type memory are copied to an unused physical page in the physical address space of the RAM.
Since the physical page of the AM is associated with the logical page on the logical address space for which the write is requested, the logical page on the logical address space for which the write is requested is associated with the RA.
It can be re-associated with a physical page in the M physical address space. Therefore, thereafter, writing to the write-protected page on the memory for limiting the number of times of rewriting becomes possible. In other words, the above-described memory with limited number of rewrites can be used as a normal data memory.

【0084】さらに、上述の結果、上記書き換え回数制
限型メモリ上における論理ページに発生した書き込みが
上記RAMに対して行われることなり、結果として上記
書き換え回数制限型メモリの更なる長寿命化を図ること
ができるのである。
Further, as a result of the above, writing that has occurred in a logical page on the memory for limiting the number of times of rewriting is performed to the RAM, and as a result, the life of the memory for limiting the number of times of rewriting is further extended. You can do it.

【0085】また、請求項6に係る発明のメモリ管理装
置は、上記書き換え回数制限型メモリとしてフラッシュ
メモリを用いるので、消費電力の低下を図ることができ
る。
Further, in the memory management device according to the present invention, since a flash memory is used as the memory for limiting the number of times of rewriting, power consumption can be reduced.

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

【図1】この発明のメモリ管理装置が登載された計算機
システムにおけるブロック図である。
FIG. 1 is a block diagram of a computer system on which a memory management device of the present invention is mounted.

【図2】オブジェクトの構成を示す概念図である。FIG. 2 is a conceptual diagram illustrating a configuration of an object.

【図3】図1におけるMMUによって行われるアドレス
変換の一例の様子を示す概念図である。
FIG. 3 is a conceptual diagram showing an example of an address conversion performed by an MMU in FIG. 1;

【図4】アクセス例外時におけるアドレス変換の様子を
示す概念図である。
FIG. 4 is a conceptual diagram showing a state of address conversion at the time of an access exception.

【図5】図1におけるMMUによって行われるアクセス
例外アドレス変換処理動作のフローチャートである。
FIG. 5 is a flowchart of an access exception address conversion processing operation performed by the MMU in FIG. 1;

【図6】新規のオブジェクトが割り付けられる際の論理
アドレス空間の様子を示す概念図である。
FIG. 6 is a conceptual diagram showing a state of a logical address space when a new object is allocated.

【図7】図1におけるオブジェクト割付部によって行わ
れるメモリ領域割り付け処理動作のフローチャートであ
る。
FIG. 7 is a flowchart of a memory area allocation processing operation performed by an object allocation unit in FIG. 1;

【図8】スライディング・コンパクション方式によるガ
ーベジコレクション処理による論理アドレス空間の変遷
を示す図である。
FIG. 8 is a diagram showing a transition of a logical address space by a garbage collection process by a sliding compaction method.

【図9】図1における論理アドレス空間管理部の安定度
間参照表の説明図である。
FIG. 9 is an explanatory diagram of an inter-stability reference table of the logical address space management unit in FIG. 1;

【図10】図1におけるガーベジコレクション実行部に
よって行われるガーベジコレクション処理動作のフロー
チャートである。
FIG. 10 is a flowchart of a garbage collection processing operation performed by a garbage collection execution unit in FIG. 1;

【図ll】図10のガーべジコレクション処理動作中に
おいて実行されるガーベジコレクション・サブルーチン
のフローチャートである。
FIG. 11 is a flowchart of a garbage collection subroutine executed during the garbage collection processing operation of FIG. 10;

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

1…計算機システム、 2…メモリ管理装
置、3…CPU、 4…MMU、
5…メモリ部、 7…フラッシュメ
モリ、8…RAM、 9…アクセ
ス変換表格納部、10…物理アドレス空間管理部、
ll…論理アドレス空間管理部、12…安定度設定部、
13…ガーベジコレクション実行部、1
4…オブジェクト割付部、 15…アクセス例外
検知手段、16…安定度間参照表、 23…
ポインタ、24…書き込みフラグ、 25…
マークフラグ、37…ルート。
DESCRIPTION OF SYMBOLS 1 ... Computer system, 2 ... Memory management device, 3 ... CPU, 4 ... MMU,
5 memory unit, 7 flash memory, 8 RAM, 9 access conversion table storage unit, 10 physical address space management unit,
11: logical address space management unit, 12: stability setting unit
13: Garbage collection execution unit, 1
4 ... object allocation unit 15 ... access exception detection means 16 ... stability reference table 23 ...
Pointer, 24 ... write flag, 25 ...
Mark flag, 37 ... route.

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 書き換え回数制限型メモリとランダム・
アクセス・メモリと上記両メモリの論理アドレスを物理
アドレスに変換するアドレス変換部を有するシステムの
メモリ管理装置であって、 上記書き換え回数制限型メモリあるいはランダム・アク
セス・メモリの未使用領域が所定の大きさより小さい場
合に、この未使用領域が小さいメモリに対してガーベジ
コレクション処理を行うガーベジコレクション実行部
と、 上記各メモリに対するデータの割り付け単位を表す情報
であるオブジェクトに対して、上記各メモリに対する新
規オブジェクトの割り付け時、あるいは、上記ガーベジ
コレクション処理実行時に、上記ガーベジコレクション
処理によって回収されず且つ当該ガーベジコレクション
処理時まで書き込みが行われなかった場合に増加する安
定度を設定する安定度設定部と、 上記各メモリに対する新規オブジェクトの割り付け時、
あるいは、上記ガーベジコレクション処理実行時に、上
記安定度設定部によって設定された安定度が所定値以下
のオブジェクトを上記ランダム・アクセス・メモリに割
り付ける一方、上記安定度が上記所定値より高いオブジ
ェクトを上記書き換え回数制限型メモリに割り付けるオ
ブジェクト割付部を備えたことを特徴とするメモリ管理
装置。
A memory for limiting the number of rewrites and a random access memory;
A memory management device for a system having an access memory and an address conversion unit for converting a logical address of each of said memories into a physical address, wherein an unused area of said memory with limited number of rewrites or a random access memory has a predetermined size. A garbage collection execution unit that performs a garbage collection process on the memory having a small unused area when the size of the unused area is small; and a new object for each of the memories for an object that is information indicating a unit of data allocation to each of the memories. At the time of allocation of the garbage collection process, or at the time of execution of the garbage collection process, and a stability setting unit for setting a stability that increases when the garbage collection process does not collect and the writing is not performed until the garbage collection process. Each method When the allocation of new objects for Li,
Alternatively, when the garbage collection process is performed, an object whose stability set by the stability setting unit is equal to or less than a predetermined value is allocated to the random access memory, and an object whose stability is higher than the predetermined value is rewritten. A memory management device comprising an object allocating unit for allocating to a limited-time memory.
【請求項2】 請求項1に記載のメモリ管理装置におい
て、 上記ガーベジコレクション実行部は、上記未使用領域が
所定の大きさより小さいメモリに関して、上記安定度の
高いオブジェクトが割り付けられている領域よりも、上
記安定度の低いオブジェクトが割り付けられている領域
に対して、高い頻度で上記ガーベジコレクション処理を
行うようになっていることを特徴とするメモリ管理装
置。
2. The memory management device according to claim 1, wherein the garbage collection executing unit is configured to execute the garbage collection with respect to a memory in which the unused area is smaller than a predetermined size than an area in which the object with high stability is allocated. A memory management device for performing the garbage collection process with high frequency on an area to which the object with low stability is allocated.
【請求項3】 請求項2に記載のメモリ管理装置におい
て、 上記ガーべジコレクション実行部は、上記未使用領域が
所定の大きさより小さいメモリに関して、上記所定の大
きさ以上の未使用領域が得られるまで、最も低い安定度
のオブジェクト群が割り付けられている領域に順次高い
安定度のオブジェクト群が割り付けられている領域を加
えて上記ガーベジコレクション処理を行うようになって
いることを特徴とするメモリ管理装置。
3. The memory management device according to claim 2, wherein the garbage collection execution unit obtains an unused area equal to or larger than the predetermined size for a memory having the unused area smaller than a predetermined size. Memory, wherein the garbage collection process is performed by sequentially adding an area to which an object group having a high stability is allocated to an area to which an object group having the lowest stability is allocated Management device.
【請求項4】 請求項1に記載のメモリ管理装置におい
て、 上記安定度設定部は、 上記新規オブジェクトの割り付け時には、新規オブジェ
クトの安定度を最小値に設定し、 上記ガーベジコレクション処理実行時には、当該ガーベ
ジコレクション処理によって、処理対象領域に在る同一
安定度のオブジェクトに対するガーベジコレクション処
理回数が上記安定度になってから所定回数になった場合
に、上記処理対象領域に在るオブジェクトであって上記
所定回数のガーベジコレクション処理が行われる間に書
き込みが行われなかったオブジェクトの安定度を所定値
だけ増加するようになっていることを特徴とするメモリ
管理装置。
4. The memory management device according to claim 1, wherein the stability setting unit sets the stability of the new object to a minimum value when allocating the new object, and sets the stability when executing the garbage collection process. When the number of garbage collection processes performed on the object having the same stability in the processing target area reaches a predetermined number of times after the stability, the object in the processing target area and the predetermined A memory management device characterized in that the stability of an object that has not been written during the number of garbage collection processes is increased by a predetermined value.
【請求項5】 請求項1に記載のメモリ管理装置におい
て、 上記アドレス変換部は、 上記書き換え回数制限型メモリ上におけるアドレス変換
の単位領域としてのべージであって書き込み禁止である
べージに対して書き込みが要求されて発生するアクセス
例外を検知するアクセス例外検知手段を備えて、 上記アクセス例外検知手段によって上記アクセス例外が
検知された場合には、書き込みが要求された論理アドレ
ス空間上の論理ページが写像された上記書き換え回数制
限型メモリの物理アドレス空間上の物理ページの内容
を、上記ランダム・アクセス・メモリの物理アドレス空
間上の未使用の物理べージにコピーし、このコピーされ
た上記ランダム・アクセス・メモリの物理べージを上記
書き込みが要求された論理ページに対応付けるようにな
っていることを特徴とするメモリ管理装置。
5. The memory management device according to claim 1, wherein the address conversion unit is a page as a unit area of the address conversion on the memory for limiting the number of times of rewriting and which is write-protected. Access exception detecting means for detecting an access exception that occurs when a write is requested to the logical address space where the write is requested when the access exception is detected by the access exception detecting means. Copy the contents of the physical page on the physical address space of the memory for limiting the number of rewrites onto which the logical page is mapped to an unused physical page on the physical address space of the random access memory, The physical page of the random access memory is associated with the logical page requested to be written. A memory management device, comprising:
【請求項6】 請求項1乃至請求項5の何れか、一つに
記載のメモリ管理装置において、 上記書き換え回数制限型メモリは、フラッシュメモリで
あることを特徴とするメモリ管理装置。
6. The memory management device according to claim 1, wherein the memory for limiting the number of times of rewriting is a flash memory.
【請求項7】 書き換え回数制限型メモリとランダム・
アクセス・メモリと上記両メモリの論理アドレスを物理
アドレスに変換するアドレス変換部を有するシステムの
メモリ管理装置として機能させるためのプログラムを記
録したコンピュータ読み取り可能な記録媒体であって、 上記書き換え回数制限型メモリあるいはランダム・アク
セス・メモリの未使用領域が所定の大きさより小さい場
合に、この未使用領域が小さいメモリに対してガーベジ
コレクション処理を行うガーベジコレクション実行部
と、 上記各メモリに対するデータの割り付け単位を表す情報
であるオブジェクトに対して、上記各メモリに対する新
規オブジェクトの割り付け時、あるいは、上記ガーベジ
コレクション処理実行時に、上記ガーベジコレクション
処理によって回収されず且つ当該ガーベジコレクション
処理時まで書き込みが行われなかった場合に増加する安
定度を設定する安定度設定部と、 上記各メモリに対する新規オブジェクトの割り付け時、
あるいは、上記ガーベジコレクション処理実行時に、上
記安定度設定部によって設定された安定度が所定値以下
のオブジェクトを上記ランダム・アクセス・メモリに割
り付ける一方、上記安定度が上記所定値より高いオブジ
ェクトを上記書き換え回数制限型メモリに割り付けるオ
ブジェクト割付部として機能させるためのプログラムを
記録したコンピュータ読み取り可能な記録媒体。
7. A memory having a limited number of rewrites and a random access memory.
A computer-readable recording medium storing a program for functioning as a memory management device of a system having an access memory and an address conversion unit for converting a logical address of each of the memories into a physical address, wherein the number of times of rewriting is limited. When an unused area of the memory or the random access memory is smaller than a predetermined size, a garbage collection execution unit that performs a garbage collection process on the memory having a small unused area, and a data allocation unit for each of the above memories. At the time of allocating a new object to each of the memories or executing the garbage collection process, the object which is not represented by the garbage collection process and written until the garbage collection process. And stability setting unit for setting a stability that increases when the write is not performed, when the allocation of a new object for each memory,
Alternatively, when the garbage collection process is performed, an object whose stability set by the stability setting unit is equal to or less than a predetermined value is allocated to the random access memory, and an object whose stability is higher than the predetermined value is rewritten. A computer-readable recording medium in which a program for functioning as an object allocating unit for allocating to a limited-time memory is recorded.
JP20279097A 1996-07-30 1997-07-29 Memory management device and computer-readable recording medium Expired - Fee Related JP3868585B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20279097A JP3868585B2 (en) 1996-07-30 1997-07-29 Memory management device and computer-readable recording medium

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP20010796 1996-07-30
JP8-200107 1996-07-30
JP20279097A JP3868585B2 (en) 1996-07-30 1997-07-29 Memory management device and computer-readable recording medium

Publications (2)

Publication Number Publication Date
JPH10116230A true JPH10116230A (en) 1998-05-06
JP3868585B2 JP3868585B2 (en) 2007-01-17

Family

ID=26511973

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20279097A Expired - Fee Related JP3868585B2 (en) 1996-07-30 1997-07-29 Memory management device and computer-readable recording medium

Country Status (1)

Country Link
JP (1) JP3868585B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100742849B1 (en) * 1998-06-30 2007-07-25 소니 가부시끼 가이샤 Data storage, data processing system, data processing method and data processing apparatus
US7774541B2 (en) 2005-12-27 2010-08-10 Samsung Electronics Co., Ltd. Storage apparatus using non-volatile memory as cache and method of managing the same
US7953920B2 (en) 2007-12-28 2011-05-31 Kabushiki Kaisha Toshiba Semiconductor storage device with volatile and nonvolatile memories, method of controlling the same, controller and information processing apparatus
JP2017111476A (en) * 2015-12-14 2017-06-22 株式会社東芝 Memory system and control method

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100742849B1 (en) * 1998-06-30 2007-07-25 소니 가부시끼 가이샤 Data storage, data processing system, data processing method and data processing apparatus
US7774541B2 (en) 2005-12-27 2010-08-10 Samsung Electronics Co., Ltd. Storage apparatus using non-volatile memory as cache and method of managing the same
US8782331B2 (en) 2007-12-28 2014-07-15 Kabushiki Kaisha Toshiba Semiconductor storage device with volatile and nonvolatile memories to allocate blocks to a memory and release allocated blocks
US7962688B2 (en) 2007-12-28 2011-06-14 Kabushiki Kaisha Toshiba Semiconductor storage device with nonvolatile and volatile memories, method of controlling the same, controller and information processing apparatus
US8065470B2 (en) 2007-12-28 2011-11-22 Kabushiki Kaisha Toshiba Semiconductor storage device with volatile and nonvolatile memories
US8065471B2 (en) 2007-12-28 2011-11-22 Kabushiki Kaisha Toshiba Semiconductor device having a volatile semiconductor memory and a nonvolatile semiconductor memory which performs read/write using different size data units
US7953920B2 (en) 2007-12-28 2011-05-31 Kabushiki Kaisha Toshiba Semiconductor storage device with volatile and nonvolatile memories, method of controlling the same, controller and information processing apparatus
US9134924B2 (en) 2007-12-28 2015-09-15 Kabushiki Kaisha Toshiba Semiconductor storage device with volatile and nonvolatile memories to allocate blocks to a memory and release allocated blocks
US9703486B2 (en) 2007-12-28 2017-07-11 Kabushiki Kaisha Toshiba Semiconductor storage device with volatile and nonvolatile memories to allocate blocks to a memory and release allocated blocks
US10248317B2 (en) 2007-12-28 2019-04-02 Toshiba Memory Corporation Semiconductor storage device with volatile and nonvolatile memories to allocate blocks to a memory and release allocated blocks
US10845992B2 (en) 2007-12-28 2020-11-24 Toshiba Memory Corporation Semiconductor storage device with volatile and nonvolatile memories to allocate blocks to a memory and release allocated blocks
US11513682B2 (en) 2007-12-28 2022-11-29 Kioxia Corporation Semiconductor storage device with volatile and nonvolatile memories to allocate blocks to a memory and release allocated blocks
US11960719B2 (en) 2007-12-28 2024-04-16 Kioxia Corporation Semiconductor storage device with volatile and nonvolatile memories to allocate blocks to a memory and release allocated blocks
JP2017111476A (en) * 2015-12-14 2017-06-22 株式会社東芝 Memory system and control method

Also Published As

Publication number Publication date
JP3868585B2 (en) 2007-01-17

Similar Documents

Publication Publication Date Title
US7010555B2 (en) System and method for compacting a computer system heap
JP2564483B2 (en) A computer storage device having a parallel garbage collection function independent of the processor of the connected user.
US6173294B1 (en) Method for combining card marking with remembered set for generational garbage collection with more than two generations
US7085879B2 (en) Dynamic data structures for tracking data stored in a flash memory device
US6862674B2 (en) Methods and apparatus for performing a memory management technique
US6434577B1 (en) Scalable-remembered-set garbage collection
US6148310A (en) Method for combining card marking with remembered sets for old area of a memory heap
US6226653B1 (en) Method and apparatus for performing generational garbage collection using remembered set counter
US7469324B2 (en) System and method for concurrent compacting self pacing garbage collection using loaded value and access barriers
US6950838B2 (en) Locating references and roots for in-cache garbage collection
US6510440B1 (en) Method and apparatus for performing generational garbage collection using barrier bits
US6105040A (en) Method and apparatus for managing stored objects
US20060173939A1 (en) Garbage collection and compaction
EP0940755A1 (en) Methods and apparatus for generational dynamic management of computer memory
JP2002506550A (en) Bounded pause garbage collection systems and methods including write barriers for source and destination instances of partially relocated objects
JP2002506548A (en) Bounded pause garbage collection system having read and write barriers associated with a partially relocated object instance and garbage collection method thereof
JPS61112256A (en) Virtual memory monitoring
JPH07105691A (en) Method of writing/erasing and controlling storage
JP2004013895A (en) File system for flash memory
KR20100030602A (en) Information processing device including memory management device managing access from processor to memory and memory management method
JPH0638242B2 (en) Memory block compression method in request page virtual address space
US6470361B1 (en) Method and apparatus for performing generational garbage collection using middle-aged objects
JP2011022933A (en) Information processing apparatus including memory management device, and memory management method
US6427154B1 (en) Method of delaying space allocation for parallel copying garbage collection
KR20080104815A (en) Apparatus and method of processing data of non-volatile memory

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040518

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040518

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20040518

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061002

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20061010

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061011

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091020

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101020

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees