JP2000339214A - Real time memory management system and real time memory managing method - Google Patents

Real time memory management system and real time memory managing method

Info

Publication number
JP2000339214A
JP2000339214A JP11150466A JP15046699A JP2000339214A JP 2000339214 A JP2000339214 A JP 2000339214A JP 11150466 A JP11150466 A JP 11150466A JP 15046699 A JP15046699 A JP 15046699A JP 2000339214 A JP2000339214 A JP 2000339214A
Authority
JP
Japan
Prior art keywords
memory
task
time
periodic
cycle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP11150466A
Other languages
Japanese (ja)
Inventor
Minoru Kuroiwa
実 黒岩
Yosuke Takano
陽介 高野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP11150466A priority Critical patent/JP2000339214A/en
Publication of JP2000339214A publication Critical patent/JP2000339214A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System (AREA)

Abstract

PROBLEM TO BE SOLVED: To prevent interruption of a processing of a periodic task for which real time property is required by a garbage recovery processing. SOLUTION: A real time system including the periodic task 102 with time restriction is executed as a preprocessing of each period of the periodic task 102 and provided with a garbage collector 109 to perform a recovery processing of garbage on a memory, a relative starting time storage part 110 to hold execution starting time of the garbage collector 109 by relative time on the basis of each starting time of the periodic task 102 and a garbage collector scheduler 112 to schedule execution of the garbage collector 109 by referring to the relative starting time storage part 110. In this case, the garbage collector 109 is executed as the preprocessing of each period of the periodic task 102 by the garbage collector scheduler 112.

Description

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

【発明の属する技術分野】本発明は、実時間メモリ管理
システムに関し、特にガーベジコレクタを使用する実時
間メモリ管理システム及び実時間メモリ管理方法に関す
る。
The present invention relates to a real-time memory management system, and more particularly, to a real-time memory management system using a garbage collector and a real-time memory management method.

【従来の技術】従来、この種の実時間メモリ管理システ
ムは、時間制約を有する実時間タスクを含む実時間シス
テムにおいて、アプリケーションプログラムの開発効率
向上および信頼性向上を目的として用いられている。例
えば、特開平4−281539号公報には、インクリメ
ンタル・ガーベジコレクタとマークアンドスイープ・ガ
ーベジコレクタとを併用する技術が記載されている。ガ
ーベジコレクタを用いたメモリ管理システムでは、タス
クに割り当てられているメモリが必要なくなった場合、
アプリケーションプログラムで明示的にメモリ解放要求
を行う必要はなく、オペレーティング・システムまたは
実行時ライブラリが自動的に不必要なメモリ(ガーベ
ジ)を検出し、解放する。そのため、アプリケーション
プログラムの開発効率が向上し、不必要なメモリを解放
し忘れることに起因するメモリの枯渇といったバグが発
生せず、信頼性が向上する。しかし、マークアンドスイ
ープ・ガーベジコレクタなどでは、ガーベジコレクタが
全てのガーベジを回収するまでは他のタスクを実行でき
ないため、ガーベジコレクタ実行中に実時間タスクを実
行すべき時刻になっても、ガーベジコレクタによるガー
ベジ回収が終了するまで実行が延期され、結果としてそ
の実時間タスクの時間制約を満たせないという問題が生
じる。それに対して、インクリメンタル・ガーベジコレ
クタでは、ガーベジ回収処理を一旦中断し、他のタスク
を実行した後にガーベジ回収処理を再開することが可能
である。そのため、ガーベジコレクタ実行中に実時間タ
スクを実行すべき時刻になった場合、すみやかにその実
時間タスクを実行することができ、実時間タスクの時間
制約を満たすことが可能となる。また、特開平6−16
8143号公報には、実時間システムに含まれる各タス
クに対して周期あたりの最大メモリ割り当て量を定め、
その最大メモリ割り当て量を越えてメモリ割り当てを要
求するタスクは次の周期まで実行を延期する技術が記載
されている。実時間システムでは、実時間タスクがメモ
リ割り当て要求を行った場合、すみやかにメモリ割り当
て処理を終了する必要がある。そのためには、実時間タ
スクのメモリ割り当て要求時には必要量の空きメモリが
既に確保されている必要があり、メモリ割り当て要求時
にガーベジコレクタを実行したのでは実時間タスクの時
間制約を満たすことができない。最大メモリ割り当て量
を定める技術は、一定周期あたりの各タスクの最大メモ
リ割り当て量を定めることが可能な実時間システムにお
いて、非実時間タスクへのメモリ割り当て量を制限する
ことによって、実時間タスクに割り当てる空きメモリを
常時確保しておくことができる。
2. Description of the Related Art Conventionally, such a real-time memory management system has been used in a real-time system including a real-time task having a time constraint for the purpose of improving the development efficiency and reliability of an application program. For example, Japanese Patent Application Laid-Open No. 4-281538 describes a technique using both an incremental garbage collector and a mark-and-sweep garbage collector. In a memory management system using a garbage collector, when the memory allocated to a task is no longer needed,
There is no need for an explicit memory release request in the application program, and the operating system or the runtime library automatically detects and releases unnecessary memory (garbage). Therefore, the development efficiency of the application program is improved, and a bug such as a memory depletion caused by forgetting to release an unnecessary memory does not occur, thereby improving reliability. However, in the case of the mark and sweep garbage collector, other tasks cannot be executed until the garbage collector collects all garbage. The execution is postponed until the garbage collection is completed, resulting in a problem that the time constraint of the real-time task cannot be satisfied. On the other hand, in the incremental garbage collector, it is possible to temporarily suspend the garbage collection process and restart the garbage collection process after executing another task. Therefore, when it becomes time to execute a real-time task during execution of the garbage collector, the real-time task can be executed immediately, and the time constraint of the real-time task can be satisfied. Also, Japanese Patent Application Laid-Open No. 6-16 / 1994
No. 8143 defines a maximum memory allocation per cycle for each task included in a real-time system,
A technique is described in which the execution of a task that requests a memory allocation exceeding the maximum memory allocation amount is postponed until the next cycle. In a real-time system, when a real-time task issues a memory allocation request, it is necessary to end the memory allocation process immediately. For that purpose, when a memory allocation request of a real-time task is made, it is necessary to secure a necessary amount of free memory, and if the garbage collector is executed at the time of the memory allocation request, the time constraint of the real-time task cannot be satisfied. The technology that determines the maximum memory allocation is a real-time system that can determine the maximum memory allocation of each task per fixed period.In real-time systems, by limiting the memory allocation to non-real-time tasks, Free memory to be allocated can always be secured.

【発明が解決しようとする課題】上述したように従来の
実時間メモリ管理システム及び実時間メモリ管理方法で
は、以下に述べるような問題点があった。第1の問題点
は、インクリメンタル・ガーベジコレクタを使用して
も、実時間タスクの時間制約を満たせないことである。
その理由は、インクリメンタル・ガーベジコレクタは、
実時間タスクがメモリ割り当て要求を行った時点で、割
り当て要求された量の空きメモリが確保されていること
を保証していないからである。メモリ割り当てを要求さ
れた時点でガーベジ回収処理を行えば必要量の空きメモ
リは確保できるが、それでは実時間タスクの時間制約を
満たすことはできない。第2の問題点は、周期あたりの
最大メモリ割り当て量を定める技術は、メモリ利用率が
低いことである。第1の理由は、あるタスクの周期あた
りの最大メモリ割り当て量は、そのタスクの周期あたり
の最大使用中メモリ量よりも多いからである。ここでい
う使用中メモリ量とは、その周期に割り当てられたメモ
リのうちガーベジではないメモリ量のことである。例え
ば、ある周期において、まず2メガバイトのメモリが割
り当てられ、そのメモリがガーベジとなった後、再び2
メガバイトのメモリが割り当てられる場合は、使用中メ
モリ量は最大2メガバイトなのに対し、メモリ割り当て
量は4メガバイトとなる。第2の理由は、複数のタスク
が存在する場合、周期あたりの最大メモリ割り当て量の
総和は、周期あたりの最大使用中メモリ量の総和よりも
多いからである。例えば、ある周期において、あるタス
クに2メガバイトのメモリが割り当てられ、そのタスク
が周期の処理を終えて割り当てられたメモリがガーベジ
となり、その後別のタスクに2メガバイトのメモリが割
り当てられ、そのタスクも周期の処理を終えて割り当て
られたメモリがガーベジとなった場合、使用中メモリ量
は最大2メガバイトなのに対し、メモリ割り当て量は4
メガバイトとなる。本発明の目的は、周期的な実時間タ
スクの時間制約を満たす実時間メモリ管理システム及び
実時間メモリ管理方法を提供することにある。本発明の
他の目的は、周期的な実時間タスクを含む実時間システ
ムにおいて、メモリ利用率の高い実時間メモリ管理シス
テム及び実時間メモリ管理方法を提供することにある。
As described above, the conventional real-time memory management system and conventional real-time memory management method have the following problems. The first problem is that the use of an incremental garbage collector does not meet the time constraints of a real-time task.
The reason is that the incremental garbage collector
This is because when the real-time task issues a memory allocation request, it is not guaranteed that the requested amount of free memory has been secured. If a garbage collection process is performed at the time when the memory allocation is requested, a necessary amount of free memory can be secured, but this cannot satisfy the time constraint of the real-time task. The second problem is that the technology for determining the maximum memory allocation amount per cycle has a low memory utilization rate. The first reason is that the maximum memory allocation amount per cycle of a certain task is larger than the maximum used memory amount per cycle of the task. The in-use memory amount here refers to a memory amount that is not garbage among the memories allocated in the cycle. For example, in a certain cycle, 2 megabytes of memory is first allocated, and after that memory becomes garbage,
When megabytes of memory are allocated, the used memory amount is a maximum of 2 megabytes, while the memory allocation amount is 4 megabytes. The second reason is that when there are a plurality of tasks, the total sum of the maximum memory allocation amount per cycle is larger than the total sum of the maximum used memory amount per cycle. For example, in a certain cycle, 2 megabytes of memory are allocated to a certain task, the memory allocated after the task has been processed in the cycle becomes garbage, and then 2 megabytes of memory are allocated to another task, and the task is also allocated. When the allocated memory becomes garbage after the periodic processing, the used memory amount is a maximum of 2 megabytes, while the memory allocation amount is 4 megabytes.
It will be megabytes. An object of the present invention is to provide a real-time memory management system and a real-time memory management method that satisfy the time constraint of a periodic real-time task. It is another object of the present invention to provide a real-time memory management system and a real-time memory management method with high memory utilization in a real-time system including periodic real-time tasks.

【課題を解決するための手段】上記目的を達成するため
本発明の実時間メモリ管理システムは、時間制約を有す
る周期タスクを含む実時間システムにおいて、周期タス
クの各周期の前処理として実行され、メモリ上のガーベ
ジの回収処理を行なうガーベジコレクション手段と、ガ
ーベジコレクション手段の実行開始時刻を、周期タスク
の各開始時刻を基準とする相対的な時刻によって保持す
る相対開始時刻記憶手段と、相対開始時刻記憶手段を参
照して、ガーベジコレクション手段の実行をスケジュー
ルするガーベジコレクタスケジュール手段を備え、ガー
ベジコレクタスケジュール手段により、周期タスクの各
周期の前処理としてガーベジコレクション手段を実行す
ることを特徴とする。本発明によれば、ガーベジコクレ
タ相対開始時刻記憶部には、周期タスク用ガーベジコレ
クタが周期タスクの各周期でのメモリ割り当て量を確保
するのに十分な時間が設定されている。周期タスク用ガ
ーベジコレクタは、ガーベジを回収し、対応する周期タ
スクの周期開始時刻までに必要量の空きメモリを確保す
る。請求項2の本発明の実時間メモリ管理システムは、
周期タスクを複数含み、ガーベジコレクタスケジュール
手段が、周期タスク毎に個別にガーベジコレクション手
段を実行することを特徴とする。請求項3の本発明の実
時間メモリ管理システムは、周期タスクの一周期あたり
のメモリ割り当て量を保持するメモリ割り当て量記憶手
段と、指定された量の空きメモリを周期タスクに関連づ
けて予約する空きメモリ予約手段をさらに備え、ガーベ
ジコレクション手段が、メモリ割り当て量記憶手段に保
持される量の空きメモリが確保された時点で、空きメモ
リ予約手段に、メモリ割り当て量記憶手段に保持される
量の空きメモリを予約し、処理を終了することを特徴と
する。請求項4の本発明の実時間メモリ管理システム
は、周期タスクの実行開始後に、メモリ割り当て量記憶
手段が保持する値の設定又は変更を行なうメモリ割り当
て量設定手段を備えることを特徴とする。請求項5の本
発明の実時間メモリ管理システムは、周期タスクを複数
含み、メモリ割り当て量記憶手段が、各周期タスクの一
周期あたりのメモリ割り当て量を個別に保持し、空きメ
モリ予約手段が、各周期タスクに個別に空きメモリを予
約し、ガーベジコレクタスケジュール手段が、各周期タ
スクに対して個別にガーベジコレクション手段を実行す
ることを特徴とする。請求項6の本発明の実時間メモリ
管理システムは、周期タスクを複数含み、ガーベジコレ
クタスケジュール手段が、ガーベジコレクション手段
を、当該ガーベジコレクション手段に対応する周期タス
クよりも優先順位が低い周期タスク及び、当該周期タス
クに対応するガーベジコレクション手段よりも優先して
実行することを特徴とする。請求項7の本発明の実時間
メモリ管理システムは、ガーベジコレクション手段が、
対応する周期タスクの周期開始時刻までに、メモリ割り
当て量記憶手段が保持する量の空きメモリを確保できな
かった場合に、周期タスクのその周期の実行をキャンセ
ルする周期キャンセル手段を備えることを特徴とする請
求項1乃至請求項6記載の実時間メモリ管理システム。
請求項8の本発明の実時間メモリ管理システムは、ガー
ベジコレクション手段が、対応する周期タスクの周期開
始時刻までに、メモリ割り当て量記憶手段が保持する量
の空きメモリを確保できなかった場合に、必要量の空き
メモリが確保できなかったことを対応する周期タスク、
あるいは任意のタスクに通知する空きメモリ不足通知手
段を備えることを特徴とする。請求項9の本発明の実時
間メモリ管理システムは、空きメモリ不足手段は確保で
きた空きメモリ量を対応する周期タスク、あるいは任意
のタスクに通知する手段を併せて有する空きメモリ不足
量通知手段を備えることを特徴とする。請求項10の本
発明の実時間メモリ管理方法は、時間制約を有する周期
タスクを含む実時間システムにおいて、周期タスクの各
周期の前処理としてガーベジコレクション処理を実行
し、周期タスクの各周期開始時刻までに当該周期で割り
当てられるメモリ量以上の空きメモリを確保することを
特徴とする。請求項11の本発明の実時間メモリ管理方
法は、同期タスクを複数含み、同期タスク毎に個別にガ
ーベジコレクション処理を実行することを特徴とする。
請求項12の本発明の実時間メモリ管理方法は、同期タ
スクを複数含み、ガーベジコレクション処理を当該ガー
ベジコレクション処理に対応する同期タスクよりも優先
順位が低い同期タスク及び、当該同期タスクに対応する
ガーベジコレクション処理よりも優先して実行すること
を特徴とする。請求項13の本発明の実時間メモリ管理
方法は、周期タスクの各周期の前処理としてガーベジコ
レクション処理を実行し、周期タスクの各周期開始時刻
までにその周期で割り当てられるメモリ量以上の空きメ
モリを確保し、確保した空きメモリをその周期タスクに
関連づけて予約し、その後周期タスクの周期開始時刻ま
で他のタスクを実行することを特徴とする。請求項14
の本発明の実時間メモリ管理方法は、ガーベジコレクシ
ョン処理で、対応する周期タスクの周期開始時刻までに
その周期で割り当てられるメモリ量以上の空きメモリを
確保できなかった場合に、当該周期の実行をキャンセル
することを特徴とする。請求項15の本発明の実時間メ
モリ管理方法は、ガーベジコレクション処理が、対応す
る周期タスクの周期開始時刻までにその周期で割り当て
られるメモリ量以上の空きメモリを確保できなかった場
合に、周期タスク又は他のタスクに、必要量の空きメモ
リが確保できなかったこと、又は確保できた空きメモリ
量を通知することを特徴とする。
In order to achieve the above object, a real-time memory management system according to the present invention is executed as preprocessing of each cycle of a periodic task in a real-time system including a periodic task having a time constraint. Garbage collection means for performing garbage collection processing on the memory; relative start time storage means for holding the execution start time of the garbage collection means as a relative time with respect to each start time of the periodic task; A garbage collector scheduler for scheduling the execution of the garbage collector with reference to the storage means, wherein the garbage collector scheduler executes the garbage collector as a pre-processing of each cycle of the periodic task. According to the present invention, in the garbage collector's relative start time storage unit, a time sufficient for the periodic task garbage collector to secure a memory allocation amount in each cycle of the periodic task is set. The periodic task garbage collector collects garbage and secures a necessary amount of free memory by the cycle start time of the corresponding periodic task. The real-time memory management system according to the second aspect of the present invention comprises:
It includes a plurality of periodic tasks, and the garbage collector scheduling means executes the garbage collection means individually for each periodic task. According to a third aspect of the present invention, there is provided a real-time memory management system, comprising: a memory allocation storage means for storing a memory allocation per cycle of a periodic task; and a free space for reserving a specified amount of free memory in association with the periodic task. The apparatus further comprises a memory reservation unit, and when the garbage collection unit secures an amount of free memory held in the memory allocation amount storage unit, the garbage collection unit notifies the free memory reservation unit of the amount of free space held in the memory allocation amount storage unit. The memory is reserved and the process is terminated. A real-time memory management system according to a fourth aspect of the present invention is characterized in that the real-time memory management system further includes a memory allocation setting unit that sets or changes a value held by the memory allocation storage after the execution of the periodic task is started. The real-time memory management system according to the fifth aspect of the present invention includes a plurality of periodic tasks, wherein the memory allocation storage unit individually stores a memory allocation per cycle of each periodic task, and the free memory reservation unit includes: Free memory is individually reserved for each periodic task, and the garbage collector scheduling means executes the garbage collection means individually for each periodic task. The real-time memory management system according to claim 6 includes a plurality of periodic tasks, wherein the garbage collector scheduling means sets the garbage collection means to have lower priority than the periodic tasks corresponding to the garbage collection means, and It is characterized in that it is executed prior to the garbage collection means corresponding to the periodic task. In the real-time memory management system according to the present invention, the garbage collection means may include:
If a sufficient amount of free memory held by the memory allocation amount storage unit cannot be secured by the cycle start time of the corresponding periodic task, a cycle cancellation unit that cancels the execution of the cycle of the periodic task is provided. 7. The real-time memory management system according to claim 1, wherein:
In the real-time memory management system according to the present invention, when the garbage collection unit cannot secure the amount of free memory held by the memory allocation amount storage unit by the cycle start time of the corresponding periodic task, A periodic task that responds that the required amount of free memory could not be secured,
Alternatively, a free memory shortage notifying means for notifying an arbitrary task is provided. In the real-time memory management system according to the present invention, the free memory shortage means includes a free memory shortage notifying means having a means for notifying the secured periodic memory amount to a corresponding periodic task or an arbitrary task. It is characterized by having. In a real-time memory management method according to the present invention, in a real-time system including a periodic task having a time constraint, a garbage collection process is executed as preprocessing of each period of the periodic task, and each cycle start time of the periodic task is executed. Until then, an empty memory larger than the memory amount allocated in the cycle is secured. The real-time memory management method according to the eleventh aspect of the present invention is characterized in that a plurality of synchronization tasks are included, and the garbage collection process is executed individually for each synchronization task.
According to a twelfth aspect of the present invention, there is provided a real-time memory management method according to the twelfth aspect, wherein the garbage collection process includes a plurality of synchronization tasks, and the garbage collection process has a lower priority than the synchronization task corresponding to the garbage collection process. It is characterized in that it is executed prior to collection processing. 14. The real-time memory management method according to claim 13, wherein a garbage collection process is executed as a pre-process of each cycle of the periodic task, and a free memory equal to or larger than a memory amount allocated in the cycle by each cycle start time of the periodic task. And reserves the reserved free memory in association with the periodic task, and thereafter executes another task until the cycle start time of the periodic task. Claim 14
In the real-time memory management method of the present invention, in the garbage collection process, when it is not possible to secure a free memory equal to or more than the memory amount allocated in the cycle by the cycle start time of the corresponding periodic task, the execution of the cycle is performed. The feature is to cancel. The real-time memory management method according to the present invention, wherein the garbage collection processing is performed when a free memory equal to or more than the memory amount allocated in the cycle cannot be secured by the cycle start time of the corresponding cycle task. Alternatively, another task is notified that a required amount of free memory could not be secured, or the secured free memory amount was notified.

【発明の実施の形態】次に、本発明の第1の実施の形態
について図面を参照して詳細に説明する。図1は、本発
明の第1の実施の形態による実時間メモリ管理システム
の構成を示すブロック図である。図1を参照すると、本
発明の第1の実施の形態による実時間メモリ管理システ
ムは、時間制約を持つ周期タスク102と複数の非実時
間タスク103からなるアプリケーションタスク群10
1と、非実時間タスク103に対応するガーベジコレク
タ109と、周期タスク102に対応する周期タスク用
ガーベジコレクタ108と、アプリケーションタスク群
101からのメモリ割り当て要求に対してメモリ104
をアプリケーションタスク群101に割り当て、周期タ
スク用ガーベジコレクタ108およびガーベジコレクタ
109からのメモリ解放要求に対してアプリケーション
タスク群101に割り当てられているメモリ104を解
放するメモリ管理部107と、周期タスク用ガーベジコ
レクタ108の開始時刻を周期タスク102の各周期開
始時刻に対する相対値で保持するガーベジコレクタ相対
開始時刻記憶部110と、ガーベジコレクタ相対開始時
刻記憶部110を参照して周期タスク用ガーベジコレク
タ108の実行をスケジュールするガーベジコレクタス
ケジューラを有し、CPU106をアプリケーションタ
スク群101に割り当てるタスクスケジューラ111か
ら構成される。時間制約を持つ周期タスク102は、非
実時間タスク103よりも優先して実行される。アプリ
ケーションタスク群101は実行時にメモリ割り当て要
求を行い、不必要になったメモリは、周期タスク用ガー
ベジコレクタ108およびガーベジコレクタ109によ
って自動的に解放される。アプリケーションタスク群1
01は、実行時にメモリ割り当てを行うメモリ空間を共
有するか、あるいは独立したメモリ空間を持つ。また、
それらの組み合わせも考えられる。アプリケーションタ
スク群101は、アプリケーションタスク群101の使
用中メモリ量の総和がメモリ管理部107がアプリケー
ションタスク群101に割り当て可能な全メモリ量を上
回らないように設計されている。ここでいう使用中メモ
リ量とは、メモリ管理部107がアプリケーションタス
ク群101に割り当てたメモリのうちガーベジではない
メモリの量のことである。よって、アプリケーションタ
スク群101がメモリ割り当て要求を行った時点では必
要量の空きメモリが存在しない場合でも、その時点でガ
ーベジ回収処理を行うことによって必要量の空きメモリ
を確保できる。メモリ管理部107は、通常のオペレー
ティング・システムのメモリ管理部と同様の機能を提供
しており、公知の様々な方法で実現可能である。ガーベ
ジコレクタ109は、参照カウンタ方式などのインクリ
メンタル・ガーベジコレクタが望ましい。その理由は、
ガーベジコレクタ109の処理中に周期タスク用ガーベ
ジコレクタ108の開始時刻に到達した場合、十分に短
い遅延時間で周期タスク用ガーベジコレクタ108を起
動できるからである。ガーベジコレクタ109の起動タ
イミングは、周期的に起動する方法、アプリケーション
タスク群101がメモリ割り当て要求を行った時に、必
要量の空きメモリが存在しないか、あるいは、なんらか
のガーベジコレクタ起動条件を満たした場合に起動する
方法、低い優先順位で常時実行する方法、アプリケーシ
ョンタスク群からの明示的な起動要求によって起動する
方法、これらの方法を組み合わせる方法など、公知の方
法が適用できる。周期タスク用ガーベジコレクタ108
は、周期タスク102の各周期の前処理としてガーベジ
コレクタスケジューラ112によって起動される。そし
て、全てのガーベジの回収が終了した時点で終了する
か、または、周期開始時刻に到達した時点でガーベジコ
レクタスケジューラ112によって終了させられる。周
期タスク用ガーベジコレクタ108は、ガーベジコレク
タ109と同様にインクリメンタル・ガーベジコレクタ
が望ましい。その理由は、周期タスク102の周期開始
時刻に、十分に短い遅延時間で周期タスク102を起動
できるからである。周期タスク用ガーベジコレクタ10
8およびガーベジコレクタ109は、周期タスク102
に割り当てられたメモリと非実時間タスク103に割り
当てられたメモリの両方をガーベジ回収対象とする。た
だし、それぞれのガーベジ回収対象をどちらかに限定し
ても構わない。タスクスケジューラ111がアプリケー
ションタスク群101をスケジュールする方法は、公知
の様々な方法を適用できる。例えば、固定優先度CPU
横取り可能方式や、周期がより短い周期タスクをより優
先するレートモノトニック方式などが考えられる。ガー
ベジコレクタスケジューラ112は、周期タスク102
の各周期の前処理として、周期タスク102の周期開始
時刻からガーベジコレクタ相対開始時刻記憶部110が
保持する時間を減算して得た時刻に周期タスク用ガーベ
ジコレクタ108を起動し、周期タスク102の周期開
始時刻に周期タスク用ガーベジコレクタ108がまだ処
理中の場合は、それを終了させた後、周期タスク102
を実行する。ガーベジコレクタスケジューラ112は、
周期タスク用ガーベジコレクタ108の開始時刻に非実
時間タスク103またはガーベジコレクタ109が実行
中の場合は、周期タスク用ガーベジコレクタ108を優
先して実行する。ガーベジコレクタ相対開始時刻記憶部
110の値は、周期タスク102が実行を開始する前に
設定する。例えば、システム起動時に値を設定しておけ
ばよい。また、周期タスク102の実行開始後に動的に
変更することも可能である。ガーベジコレクタ相対開始
時刻記憶部110の値は、周期タスク用ガーベジコレク
タ108が、周期タスク102が各周期において割り当
てるメモリ量に相当するガーベジを回収可能な時間を設
定する。例えば、周期タスク102が各周期において1
0メガバイトのメモリ割り当てを行うとき、周期タスク
用ガーベジコレクタ108が10ミリ秒で1メガバイト
のガーベジを回収する能力を持つならば、ガーベジコレ
クタ相対開始時刻記憶部110の値を100ミリ秒に設
定すればよい。また、例えば、周期タスク102が各周
期において10メガバイトのメモリ割り当てを行うと
き、周期タスク用ガーベジコレクタ108の時間あたり
のガーベジ回収能力は見積もれないが、200ミリ秒で
全てのガーベジを回収できることがわかっているなら
ば、ガーベジコクレタ相対開始時刻記憶部110の値を
200ミリ秒に設定すればよい。次に、図1から図5を
参照して本実施の形態による実時間メモリ管理システム
の動作について詳細に説明する。図2から図5は、本実
施の形態による実時間メモリ管理システムにおけるガー
ベジコレクタスケジューラ112の動作を示したフロー
チャートであり、図2は周期タスク用ガーベジコレクタ
108の開始時刻における動作、図3は周期タスク10
2の周期開始時刻における動作、図4は周期タスク10
2の周期終了時の動作、図5はCPU割り当て処理の動
作を示している。なお、タスクスケジューラ111の周
期タスク102および非実時間タスク103をスケジュ
ールする動作については公知であり、本発明に特に関係
しない部分は説明を省略している。図2を参照すると、
周期タスク用ガーベジコレクタ108の開始時刻に到達
すると、タイマ105からの割り込みなどによってガー
ベジコレクタスケジューラ112が動作し、周期タスク
用ガーベジコレクタ108を実行可能状態にし(ステッ
プ201)、CPU割り当て処理を行う。図3を参照す
ると、周期タスク102の周期開始時刻に到達すると、
タイマ105からの割り込みなどによってガーベジコレ
クタスケジューラ112が動作し、まず周期タスク用ガ
ーベジコレクタ108がまだ処理中かどうかを検査し
(ステップ202)、処理中の場合は周期タスク用ガー
ベジコレクタ108の処理を終了させる(ステップ20
3)。その後、周期タスク102を実行可能状態にし
(ステップ204)、CPU割り当て処理を行う。図4
を参照すると、周期タスク終了時にガーベジコレクタス
ケジューラ112が動作し、周期タスク102の次の周
期開始時刻からガーベジコレクタ相対開始時刻記憶部1
10が保持する時間を減算することによって周期タスク
用ガーベジコレクタ108の開始時刻を算出し(ステッ
プ205)、周期タスク用ガーベジコレクタ108の開
始時刻にガーベジコレクタスケジューラ112が動作す
るようにタイマ105を設定し(ステップ206)、C
PU割り当て処理を行う。図5を参照すると、CPU割
り当て処理では、実行可能状態の周期タスク102、実
行可能状態の非実時間タスク103、実行可能状態の周
期タスク用ガーベジコレクタ108、または実行可能状
態のガーベジコレクタ109が存在するかどうかを検査
し(ステップ207)、存在する場合は、その中で最も
優先順位が高いものにCPU106を割り当てる(ステ
ップ208)。ここでいう優先順位は、タスクスケジュ
ーラ111のスケジューリングシステムに依存するもの
であり、特に固定優先度方式における優先度などに限る
ものではない。なお、周期タスク用ガーベジコレクタ1
08が周期タスク102の周期開始時刻以前に処理を終
了した場合は、周期タスク102の周期開始時刻までの
期間は他の実行可能状態のタスクまたはガーベジコレク
タにCPU106を割り当てない。以上説明したよう
に、本実施の形態による実時間メモリ管理システムで
は、周期タスク用ガーベジコレクタ108が周期タスク
102の各周期開始時刻までにその周期に割り当てられ
る空きメモリを確保し、その後周期開始時刻まで他の非
実時間タスク103は実行されないので、周期タスク1
02のメモリ割り当て要求はすみやかに処理され、周期
タスク102の時間制約を満たすことが可能となる。ま
た、本実施の形態による実時間メモリ管理システムで
は、周期タスク用ガーベジコレクタ108を周期タスク
102の各周期の直前に前処理として実行するため、周
期タスク102の各周期が終了してから次周期の前処理
の周期タスク用ガーベジコレクタ108が起動するまで
の期間は、全ての空きメモリを他の非実時間タスク10
3に割り当てることが可能であり、メモリ利用率が向上
する。次に、第1の実施の形態を適応した好ましい実施
例について説明する。図6は、本実施例の構成を示すブ
ロック図である。図6に示すように、情報端末314
は、ハードディスク312から文書データを読み込みプ
リンタ311に出力する文書プリントタスク301と、
ハードディスク312から動画像データを読み込み液晶
ディスプレイ313に表示する周期的な動画像表示タス
ク302と、文書プリントタスク301と動画像表示タ
スク302からのメモリ割り当て要求に対して、それら
のタスクにメモリ305を割り当てるメモリ管理部30
6と、メモリ割り当て要求時に必要量の空きメモリが存
在しない場合にメモリ管理部306から呼び出される参
照カウンタ方式のガーベジコレクタ304と、ひとつの
タスクとして実装され、動画像表示タスクの前処理とし
て起動される参照カウンタ方式の周期タスク用ガーベジ
コレクタ303と、周期タスク用ガーベジコレクタ30
3の開始時刻を動画像表示タスクの各周期開始時刻に対
する相対値として保持する相対開始時刻記憶部309
と、タイマ307を使用して時刻情報を取得し、各タス
クにCPU308を割り当てる固定優先度CPU横取り
可能方式のタスクスケジューラ310から構成される。
メモリ管理部306の動的メモリ割り当ての対象となる
メモリは10メガバイト存在する。文書プリントタスク
301は、特に時間制約を有するわけではないが、早い
プリント出力の終了が好ましい非実時間タスクである。
文書プリントタスク301は、文書を一旦格納するバッ
ファとして、文書の大きさに応じて2メガバイトのメモ
リ割り当てを何回か要求する。ただし同時に使用するメ
モリは最大でも2メガバイトである。動画像表示タスク
302は1秒間に10枚のフレームを液晶ディスプレイ
313に表示する。動画像表示タスク302は、1周期
で1フレームを表示する周期タスクとして実現されてお
り、周期が100ミリ秒、各周期の処理時間は30ミリ
秒である。また、動画像表示タスク302はスムーズな
動画像表示を実現する必要があるため、周期実行中にガ
ーベジ回収処理を行うことができない。動画像表示タス
ク302は、画像を一旦格納するバッファとして、各周
期の先頭で8メガバイトのメモリ割り当て要求を行う。
ただし、このメモリは周期終了後は使用されない。動画
像表示タスク302には、文書プリントタスク301よ
りも高い優先度が与えられており、周期タスク用ガーベ
ジコレクタ303には動画像表示タスク302と同じ優
先度が与えられている。CPU308は各タスクを実行
するのに十分な処理能力を有しており、タイマ307は
各タスクを実行するのに十分な粒度と精度を有してい
る。周期タスク用ガーベジコレクタ303は、動的メモ
リ割り当ての対象となる10メガバイトのメモリ内の全
てのガーベジを20ミリ秒で回収する能力を有してい
る。相対開始時刻記憶部309の値は、周期タスク用ガ
ーベジコレクタ303が、動画像表示タスク302が各
周期において割り当てるメモリ量である8メガバイトの
ガーベジを回収可能な時間を設定すればよい。本実施例
では全ガーベジを回収可能な20ミリ秒に設定する。図
7の(A)は、本実施例における各タスクの起動タイミ
ングを示すタイミングチャートであり、図7の(B)は
各時刻における総メモリ割り当て量を示すグラフであ
る。図7の(A)において、文書プリントタスク301
の実行は棒403で示されており、文書プリントタスク
301のメモリ割り当て要求時に必要量の空きメモリが
存在しない時に呼び出されるガーベジコレクタ304の
実行は棒404で示されており、動画像表示タスク30
2の実行は棒401で示されており、動画像表示タスク
302の各周期の前処理として実行される周期タスク用
ガーベジコレクタ303の実行は棒402で示されてい
る。図7の(A)を参照すると、文書プリントタスク3
01は、時刻70ミリ秒に起動され、時刻240ミリ秒
に処理を終了している。動画像表示タスク302の各周
期は、時刻100ミリ秒と時刻200ミリ秒に開始さ
れ、それぞれ時刻130ミリ秒と時刻230ミリ秒に終
了している。周期タスク用ガーベジコレクタ303は、
時刻80ミリ秒と時刻180ミリ秒に開始され、それぞ
れ時刻100ミリ秒と時刻200ミリ秒に終了してい
る。文書プリントタスク301は、時刻70ミリ秒、時
刻140ミリ秒および時刻160ミリ秒に、それぞれ2
メガバイトのメモリ割り当て要求を行う。動画像表示タ
スクは、周期開始時刻である時刻100ミリ秒および時
刻200ミリ秒にそれぞれ8メガバイトのメモリ割り当
て要求を行う。図7の(B)を参照すると、まず時刻7
0ミリ秒に文書プリントタスク301に2メガバイトの
メモリが割り当てられる。時刻80ミリ秒に周期タスク
用ガーベジコレクタ303が起動されるが、ガーベジが
存在しないため総メモリ割り当て量は変化しない。次
に、時刻100ミリ秒に動画像表示タスク302に8メ
ガバイトのメモリが割り当てられる。その時点で、総メ
モリ割り当て量は10メガバイトとなり、全メモリが割
り当てられたことになる。次に、時刻140ミリ秒に文
書プリントタスク301が2メガバイトのメモリ割り当
て要求を行うが、既に全メモリが割り当てられているた
めガーベジコレクタ304が呼び出されガーベジの回収
を行う。時刻145ミリ秒に、必要な2メガバイトの空
きメモリを確保したガーベジコレクタ304の処理は終
了し、文書プリントタスク301に2メガバイトのメモ
リが割り当てられる。時刻160ミリ秒にも同様にガー
ベジコレクタ304が呼び出された後、時刻165ミリ
秒に文書プリントタスク301に2メガバイトのメモリ
が割り当てられる。次に、時刻180ミリ秒に周期タス
ク用ガーベジコレクタ303が起動されてガーベジの回
収を行う。この時点で実際に使用されているメモリは、
時刻165ミリ秒に文書プリントタスク301に割り当
てられた2メガバイトのメモリだけであり、時刻200
ミリ秒までに8メガバイトのガーベジを回収する。次
に、時刻200ミリ秒に動画像表示タスクに8メガバイ
トのメモリが割り当てられる。このように、動画像表示
タスク302の起動時間である時刻100ミリ秒および
時刻200ミリ秒には、前処理として実行される周期タ
スク用ガーベジコレクタ303が全ガーベジの回収を終
了し、各周期で割り当てられる8メガバイトの空きメモ
リを確保しているため、動画像表示タスク302のメモ
リ割り当て要求はすみやかに処理されることがわかる。
また、動画像表示タスク302の周期終了時刻である時
刻130ミリ秒から周期タスク用ガーベジコレクタ30
3の開始時刻である時刻180ミリ秒までの期間は、全
ての空きメモリを文書プリントタスク301に割り当て
ることが可能であり、本実施例では4メガバイトが割り
当てられている。各周期における最大割り当て量を制限
する方法では、動画像表示タスク302に8メガバイト
のメモリ割り当てを保証するためには、文書プリントタ
スク301の各周期における最大割り当て量を2メガバ
イトに設定する必要があり、文書プリントタスク301
の時刻165ミリ秒から時刻180ミリ秒までの期間の
処理は時刻240ミリ秒以降に延期されることになる。
つまり、本発明によって文書プリントタスク301の処
理はより早く終了することができる。また、メモリ利用
率も向上している。次に、本発明の第2の実施の形態に
ついて図面を参照して詳細に説明する。図8は、本発明
の第2の実施の形態による実時間メモリ管理システムの
構成を示すブロック図である。図8を参照すると、本発
明の第2の実施の形態による実時間メモリ管理システム
は、図1に示された第1の実施の形態による実時間メモ
リ管理システムに比べて、メモリ管理部107に空きメ
モリ予約手段501が加わったこと、周期タスク102
が周期あたりに割り当てるメモリ量を保持するメモリ割
り当て量記憶部503とメモリ割り当て量記憶部503
の値を実行時に設定、変更するメモリ割り当て量設定手
段502が加わったこと、タスクスケジューラ111に
周期タスク102の特定の周期の実行をキャンセルする
周期キャンセル手段504が加わったことが異なる。図
9は、空きメモリ予約手段501を含むメモリ管理部1
07の構成を示すブロック図である。メモリ管理部10
7はメモリ104をページ単位に管理する方式を採用し
ており、要求された量のメモリをアプリケーションタス
ク群101に割り当てるメモリ割り当て手段601と、
周期タスク用ガーベジコレクタ108およびガーベジコ
レクタ109から呼び出されて、アプリケーションタス
ク群101に割り当てられているメモリを解放するメモ
リ解放手段602と、周期タスク用ガーベジコレクタ1
08から呼び出されて、要求された量の空きメモリを指
定された周期タスクに関連づけて予約する空きメモリ予
約手段603と、非実時間タスク103に割り当て可能
な空きページ量を保持する空きページ量記憶部604
と、非実時間タスク103に割り当て可能なページ60
6をリスト形式で保持する空きページリスト605と、
各周期タスク102ごとに予約されているページ量を保
持する予約済ページ量記憶部607と、各周期タスク1
02ごとに予約されている予約済ページ609を各周期
タスク102ごとにリスト形式で保持する予約済ページ
リスト608とから構成される。なお、図9は空きメモ
リ予約手段501の実現方法の一例を示したものであ
り、本発明はこの実現方法に制限されるものではない。
メモリ管理の実現方法は、対象とするハードウェアやオ
ペレーティング・システムに多分に依存したものであ
り、空きメモリ予約手段501はシステム環境に適した
方法で実現可能である。本実施の形態における周期タス
ク用ガーベジコレクタ108は、周期タスク102の前
処理としてガーベジコレクタスケジューラ112によっ
て起動され、周期タスク102の周期開始時刻に終了さ
せられることは第1の実施の形態と同様だが、一部のガ
ーベジを回収した結果、メモリ割り当て量記憶部503
に保持される量の空きメモリを確保できた場合には、そ
の時点で処理を終了し、メモリ割り当て量記憶部503
に保持される量の空きメモリを空きメモリ予約手段50
1を呼び出すことによって対応する周期タスク102に
関連づけて予約する。また、周期タスク用ガーベジコレ
クタ108は、対応する周期タスクよりも優先順位が低
い周期タスクよりも優先して実行され、また、対応する
周期タスクよりも優先順位が低い周期タスクに対応する
周期タスク用ガーベジコレクタ108よりも優先して実
行される。メモリ割り当て量記憶部503に保持される
値は、周期タスク102の実行開始前に、メモリ割り当
て量設定手段502によって設定する。また、周期タス
ク102の実行開始後に、実行条件が変化するなどの理
由で周期あたりのメモリ割り当て量が変化した場合など
には、メモリ割り当て量設定手段502によって値を変
更することも可能である。タスクスケジューラ111
は、周期タスク用ガーベジコレクタ108が対応する周
期タスク102の周期開始時刻以前に処理を終了した場
合、対応する周期タスク102の周期開始時刻までの期
間は、その他のアプリケーションタスク群101、また
は他の周期タスク用ガーベジコレクタ108にCPU1
06を割り当てる。また、タスクスケジューラ111
は、周期タスク102の周期開始時刻までに対応する周
期タスク用ガーベジコレクタ108の処理が終了しない
場合、周期キャンセル手段504を使用してその周期を
キャンセルする。次に、図面を参照して本実施の形態の
動作を詳細に説明する。図10から図14は、本実施の
形態におけるタスクスケジューラ111の動作を示した
フローチャートである。図10は周期タスク用ガーベジ
コレクタ108の開始時刻における動作、図11は周期
タスク102の周期開始時刻における動作、図12は周
期タスク102の周期終了時の動作、図13は周期タス
ク用ガーベジコレクタ108が対応する周期タスク10
2の周期開始時刻以前に処理を終了した時の動作、図1
4はCPU割り当て処理の動作を示している。図10、
図12および図14に示される本実施の形態の動作は、
図2、図4および図5に示される第1の実施の形態の動
作と同様なので、ここでは説明しない。図11を参照す
ると、本実施の形態におけるタスクスケジューラ111
の周期タスク102の周期開始時刻における動作は、図
3に示される第1の実施の形態の動作と比べて、周期タ
スク用ガーベジコレクタ108がまだ処理中の場合に、
周期タスク用ガーベジコレクタを終了させた後(ステッ
プ203)、周期キャンセル手段504を使用して、対
応する周期をキャンセルする(ステップ701)ことが
異なる。図13を参照すると、本実施の形態におけるタ
スクスケジューラ111は、周期タスク用ガーベジコレ
クタ108が対応する周期タスク102の周期開始時刻
以前に必要量の空きメモリを予約して終了した場合、周
期開始時刻までの期間、実行可能な他のアプリケーショ
ンタスク群101、ガーベジコレクタ109、または周
期タスク用ガーベジコレクタ108にCPU106を割
り当てる。図15は、本実施の形態における周期タスク
用ガーベジコレクタ108の動作を示したフローチャー
トである。図15を参照すると、本実施の形態における
周期タスク用ガーベジコレクタ108は、対応する周期
タスク102の周期開始時刻になった場合にはガーベジ
コレクタスケジューラ112によって終了させられる
(ステップ801)。対応する周期タスク102の周期
開始時刻になっていない場合は、いくつかのガーベジを
検出し(ステップ802)、メモリ管理部107のメモ
リ解放手段602を呼び出してそのガーベジをアプリケ
ーションタスク群101から解放する(ステップ80
3)。次に、メモリ割り当て量記憶部503に保持され
る量の空きメモリを確保したかどうかを調べ(ステップ
804)、確保された場合にはメモリ管理部107の空
きメモリ予約手段501を呼び出して必要量の空きメモ
リを対応する周期タスク102に関連づけて予約する
(ステップ805)。ステップ804において必要量の
空きメモリが確保されていない場合には、最初に戻って
ガーベジの回収を続行する。図16から図18は、本実
施の形態におけるメモリ管理部107の動作を示したフ
ローチャートである。図16はメモリ管理部107が有
するメモリ割り当て手段601の動作を示しており、図
17はメモリ管理部107が有するメモリ解放手段60
2の動作を示しており、図18はメモリ管理部107が
有する空きメモリ予約手段603の動作を示している。
図16を参照すると、メモリ割り当て手段601は、ま
ずメモリ割り当て要求を行ったのが周期タスク102か
非実時間タスク103かを調べる(ステップ901)。
非実時間タスク103がメモリ割り当て要求を行った場
合は、まず空きページ量記憶部604を参照して要求さ
れた量の空きページが存在するかどうかを調べ(ステッ
プ902)、存在しない場合はガーベジコレクタ109
を呼び出してガーベジの回収を行った後ステップ902
からの処理を繰り返す。ステップ902において要求さ
れた量の空きページが存在する場合は、空きページリス
ト605が保持する空きページ606をメモリ割り当て
を要求した非実時間タスク103に割り当て(ステップ
904)、空きページ量記憶部604の値を割り当てた
メモリ量だけ減らして(ステップ905)、処理を終了
する。周期タスク102がメモリ割り当て要求を行った
場合は、予約済ページリスト608のその周期タスク1
02に対応するエントリが保持する予約済ページ609
を要求した周期タスク102に割り当て(ステップ90
6)、予約済ページ量記憶部107の対応するエントリ
の値を割り当てたメモリ量だけ減らし(ステップ90
7)、処理を終了する。図17を参照すると、メモリ解
放手段602は、指定されたメモリをアプリケーション
タスク群101から解放し(ステップ908)、解放し
たメモリを空きページリスト605に挿入し(ステップ
909)、空きページ量記憶部604の値を解放したメ
モリ量だけ増加し(ステップ910)、処理を終了す
る。図18を参照すると、空きメモリ予約手段603
は、指定された量の空きページ606を空きページリス
ト605から予約済ページリスト608の指定された周
期タスク102に対応するエントリに移動し(ステップ
911)、空きページ量記憶部604の値を移動したメ
モリ量だけ減らし(ステップ912)、予約済ページ量
記憶部607の指定された周期タスク102に対応する
エントリの値を予約されたメモリ量だけ増加し(ステッ
プ913)、処理を終了する。図16から図18は、本
実施の形態におけるメモリ管理部107の動作の一例を
示したものであり、本発明はこの動作に制限されるもの
ではない。メモリ管理方法は、対象とするハードウェア
やオペレーティング・システムに依存したものであり、
メモリ管理部107はシステム環境に適した動作を行え
ばよい。以上説明したように第2の実施の形態では、周
期タスク用ガーベジコレクタ108が対応する周期タス
ク102の各周期開始時刻以前に、各周期で割り当てら
れる空きメモリを確保し、予約するので、周期タスク1
02のメモリ割り当て要求はすみやかに処理でき、周期
タスク102の時間制約を満たすことが可能となる。ま
た、本実施の形態では、周期タスク用ガーベジコレクタ
108が処理を終了してから、対応する周期タスクの周
期開始時刻までの期間は、実行可能な他の周期タスク1
02、実行可能な非実時間タスク103、実行可能な周
期タスク用ガーベジコレクタ108、またはガーベジコ
レクタ109を実行するため、CPUの利用効率が向上
する。また、本実施の形態では、周期タスク用ガーベジ
コレクタ108が対応する周期タスク102の各周期開
始時刻までに必要量の空きメモリを確保できなかった場
合に、その周期をキャンセルするため、時間制約を満た
すことができない周期を実行することによる不具合を解
消できる。例えば、複数の周期タスクによって複数の動
画像を表示する方式では、1つの動画像表示を担当する
周期タスクが時間制約を満たせないと、それが他の周期
タスクに影響を及ぼし、結局全ての動画像の表示が乱れ
る可能性がある。そのような場合に時間制約を満たせな
い周期をキャンセルすることによって、他の周期タスク
の時間制約を満たすことができ、それらの周期タスクが
担当する動画像表示はスムーズに行なわれるという効果
が期待できる。次に、第2の実施の形態を適用した具体
的な実施例について説明する。図19は、本実施例の構
成を示すブロック図である。図6に示される第1の実施
の形態の実施例との違いは、空きメモリ予約手段110
1およびメモリ割り当て量記憶部1102を有すること
である。メモリ割り当て量記憶部1102の値は、動画
像表示タスク302の周期あたりのメモリ割り当て量で
ある8メガバイトに設定する。メモリ割り当て量記憶部
1102の値は、システム起動前に設定しておく。図2
0の(A)は、本実施例における各タスクの起動タイミ
ングを示すタイミングチャートであり、図20の(B)
は各時刻における総メモリ割り当て量を示すグラフであ
る。図20の(A)において、文書プリントタスク30
1の実行は棒403で示されており、文書プリントタス
ク301のメモリ割り当て要求時に必要量の空きメモリ
が存在しない時に呼び出されるガーベジコレクタ304
の実行は棒404で示されており、動画像表示タスク3
02の実行は棒401で示されており、動画像表示タス
クの各周期の前処理として実行される周期タスク用ガー
ベジコレクタ303の実行は棒402で示されている。
図20の(A)を参照すると、文書プリントタスク30
1は、時刻70ミリ秒に起動され、時刻170ミリ秒に
終了している。動画像表示タスク302の各周期は、時
刻100ミリ秒と時刻200ミリ秒に開始され、それぞ
れ時刻130ミリ秒と時刻230ミリ秒に終了してい
る。文書プリントタスク301は、時刻70ミリ秒、時
刻90ミリ秒および時刻140ミリ秒にそれぞれ2メガ
バイトのメモリ割り当て要求を行う。動画像表示タスク
302は、周期開始時刻である時刻100ミリ秒および
時刻200ミリ秒にそれぞれ8メガバイトのメモリ割り
当て要求を行う。周期タスク用ガーベジコレクタ303
は、時刻80ミリ秒および時刻180ミリ秒に開始さ
れ、メモリ割り当て量記憶部1102に保持される8メ
ガバイトの空きメモリを確保した時点で、空きメモリ予
約手段1101を呼び出して8メガバイトの空きメモリ
を動画像表示タスク302に関連づけて予約し、処理を
終了する。図20の(B)を参照すると、まず時刻70
ミリ秒に文書プリントタスク301に2メガバイトのメ
モリが割り当てられる。時刻80ミリ秒に周期タスク用
ガーベジコレクタ303が実行を開始するが、既に8メ
ガバイトの空きメモリが確保されているのでガーベジ回
収処理は行わず、8メガバイトの空きメモリを予約し、
すぐに処理を終了する。そこで、文書プリントタスク3
01の実行が再開され、時刻90ミリ秒に2メガバイト
のメモリ割り当て要求を行う。その時点で各タスクに割
り当てられている総メモリ量は2メガバイトだが、8メ
ガバイトは動画像表示タスク302に予約されており、
空きメモリは存在しないので、ガーベジコレクタ304
が呼び出されガーベジの回収を行う。時刻95ミリ秒に
ガーベジコレクタ304が2メガバイトのガーベジを回
収し終え、確保された空きメモリの2メガバイトを文書
プリントタスク301に割り当てる。次に、時刻100
ミリ秒に動画像表示タスク302が8メガバイトのメモ
リ割り当て要求を行い、既に予約されている8メガバイ
トのメモリを割り当てる。時刻130ミリ秒から文書プ
リントタスク301の実行が再開され、時刻140ミリ
秒に2メガバイトのメモリ割り当て要求を行う。この時
点では、全メモリが各タスクに割り当てられているの
で、ガーベジコレクタ304を起動してガーベジの回収
を行った後、時刻145ミリ秒に2メガバイトを文書プ
リントタスク301に割り当てる。次に時刻180ミリ
秒に周期タスク用ガーベジコレクタ303が起動され、
時刻195ミリ秒までに8メガバイトのガーベジを回収
し、確保された8メガバイトの空きメモリを動画像表示
タスク302に関連づけて予約する。そして、時刻20
0ミリ秒に予約された8メガバイトのメモリが動画像表
示タスク302に割り当てられる。このように、動画像
表示タスク302のメモリ割り当て要求がすみやかに処
理されることは図3に示される第1の実施の形態の実施
例と同様だが、本実施例では、周期タスク用ガーベジコ
レクタ303がメモリ割り当て量記憶部1102に保持
される量の空きメモリを確保し、予約した時点で、文書
プリントタスク301を実行するため、CPU利用効率
が向上し、結果として文書プリントタスク301の終了
時刻が早くなっている。次に、本発明の第3の実施の形
態について図面を参照して説明する。図21は、本発明
の第3の実施の形態による実時間メモリ管理システムの
構成を示すブロック図である。図21を参照すると、本
発明の第3の実施の形態による実時間メモリ管理システ
ムの構成は、図8に示された第2の実施の形態の構成と
比べて、周期キャンセル手段504の替わりに空きメモ
リ不足通知手段1201を備える点が異なる。空きメモ
リ不足通知手段1201は、周期タスク102の各周期
開始時刻までに、周期タスク用ガーベジコレクタ108
がメモリ割り当て量記憶部503が保持する量の空きメ
モリを確保できない場合、対応する周期タスク102ま
たはアプリケーションタスク群101に含まれる他のタ
スクに、空きメモリが不足すること、および、割り当て
可能なメモリ量を通知する機能である。空きメモリ不足
通知手段は1201は、周期タスク102の各周期を開
始する関数の引数としてメモリ不足フラグと確保できた
メモリ量を渡す方法、グローバルな変数を使って通知す
る方法など、公知の技術で実現できる。以上説明したよ
うに第3の実施の形態では、周期タスク102の各周期
開始時刻に必要量の空きメモリが確保できていない場
合、空きメモリ不足通知手段1201によって周期タス
ク102が空きメモリ不足を事前に知ることができるた
め、割り当て要求するメモリ量を確保できたメモリ量に
低減して処理を続行したり、自らその周期をキャンセル
するなどの対策を行うことが可能となる。以上好ましい
実施の形態及び実施例をあげて本発明を説明したが、本
発明は必ずしも上記実施の形態及び実施例に限定される
ものではなく、その技術的思想の範囲内において様々に
変形して実施することができる。本発明の第2の実施の
形態における周期キャンセル手段504は、周期タスク
102の各周期開始時刻にメモリ割り当て量記憶部50
3に保持される量の空きメモリが確保されていない場合
はその周期の実行をキャンセルするが、各周期タスク1
02ごとに周期をキャンセルするか、処理を継続するか
を選択可能な周期キャンセル手段を有する形態も考えら
れる。また、周期タスク102の各周期開始時刻に必要
量の空きメモリが確保されていない場合に、周期タスク
102を実行するか、周期をキャンセルするか、空きメ
モリ不足を通知するか、周期タスク用ガーベジコレクタ
108の処理を継続するか、あるいはその他の処理を行
うかを各周期タスク102ごとに指定可能とする形態も
考えられる。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, a first embodiment of the present invention.
Will be described in detail with reference to the drawings. Fig. 1
A real-time memory management system according to a first embodiment of the present invention
FIG. 3 is a block diagram showing the configuration of FIG. Referring to FIG.
Real-time memory management system according to a first embodiment of the invention
The system consists of a periodic task 102 with time constraints and multiple
Task group 10 consisting of inter-tasks 103
1 and garbage collector corresponding to non-real-time task 103
For the periodic task corresponding to the data 109 and the periodic task 102
Garbage collector 108 and application tasks
Memory 104 in response to a memory allocation request from
Is assigned to the application task group 101,
Garbage collector 108 and garbage collector
Application for memory release request from 109
Solve the memory 104 allocated to the task group 101
Release memory management unit 107 and garbage core for periodic tasks
Open the start time of the
Garbage collector relative stored relative to start time
Start time storage unit 110 and garbage collector relative start time
Garbage collector for periodic tasks with reference to the time storage unit 110
Garbage collectors to schedule the execution of data 108
A scheduler, and the CPU 106
Is the task scheduler 111 assigned to the disk group 101
It is composed of The periodic task 102 with the time constraint
It is executed prior to the real-time task 103. App
Application task group 101 requires memory allocation during execution
Request, and memory that is no longer needed
Veg collector 108 and garbage collector 109
Automatically released. Application task group 1
01 shares the memory space for allocating memory during execution.
Or have independent memory space. Also,
Combinations of these are also conceivable. Application
The disk group 101 uses the application task group 101.
The memory management unit 107 determines that the total
The total memory that can be allocated to the task group 101
It is designed not to rotate. In-use note here
The memory amount is determined by the memory management unit 107 as the application status.
Not garbage in the memory allocated to the cluster 101
It is the amount of memory. Therefore, the application
When the disk group 101 issues a memory allocation request,
Even if the required amount of free memory does not exist,
-Required amount of free memory by performing the veggie collection process
Can be secured. The memory management unit 107 has a normal operation
Provides the same function as the memory management unit of the operating system
And can be realized by various known methods. Gaube
The collector 109 is an incremental counter such as a reference counter.
A mental garbage collector is preferred. The reason is,
Garbage for periodic tasks during processing of garbage collector 109
Short enough if the start time of the
Garbage collector 108 for periodic tasks
Because it can move. Start garbage collector 109
How to start the application periodically, application
When the task group 101 issues a memory allocation request,
The required amount of free memory does not exist, or
Starts when the garbage collector start condition is met
Method, always run at low priority, application
Is activated by an explicit activation request from the task group
Known methods such as methods and methods to combine these methods
Law is applicable. Garbage collector 108 for periodic tasks
Garbage as pre-processing of each cycle of the periodic task 102
It is started by the collector scheduler 112. Soshi
Ends when all garbage has been collected
Or when the cycle start time is reached,
It is terminated by the lector scheduler 112. Week
Garbage collector 108 is a garbage collector.
Incremental garbage collector as well as
Is desirable. The reason is that the periodic task 102 starts the cycle.
Activate periodic task 102 at a sufficiently short delay time
Because you can. Garbage collector 10 for periodic tasks
8 and the garbage collector 109
Memory and non-real-time task 103
Both of the allocated memories are targeted for garbage collection. Was
However, limit each garbage collection target to either
It does not matter. Task scheduler 111
A method for scheduling the task group 101 is known.
Various methods can be applied. For example, fixed priority CPU
A preemptive method or a periodic task with a shorter cycle is better
The above-mentioned rate monotonic method is conceivable. Gar
The veg collector scheduler 112
Of the periodic task 102
From the time, the garbage collector relative start time storage unit 110
The garbage for periodic tasks is added to the time obtained by subtracting the holding time.
Activate the dicollector 108 and periodically open the periodic task 102
At the start time, the periodic task garbage collector 108
If the task is in progress, after terminating it,
Execute The garbage collector scheduler 112
The start time of the garbage collector for periodic tasks 108
Executed by time task 103 or garbage collector 109
In the middle, the garbage collector 108 for periodic tasks is
Run first. Garbage collector relative start time storage
The value of 110 is set before the periodic task 102 starts executing.
Set. For example, set the value at system startup.
I just need. Also, dynamically after the start of the execution of the periodic task 102,
It can be changed. Garbage collector relative start
The value of the time storage unit 110 is the garbage collector for the periodic task.
108, the periodic task 102
Time to collect garbage equivalent to the amount of memory
Set. For example, if the periodic task 102
When allocating 0 megabytes of memory, periodic tasks
Garbage collector 108 for 1 ms in 10 ms
Garbage collection if you have the ability to collect garbage
The value of the relative start time storage unit 110 is set to 100 milliseconds.
It should be fixed. Also, for example, the periodic task 102
Allocating 10 megabytes of memory during the period
Per hour of the garbage collector 108 for periodic tasks
Garbage recovery capacity cannot be estimated, but in 200 milliseconds
If you know you can collect all garbage
For example, the value of the garbage cocreta relative start time storage unit 110 is
What is necessary is just to set to 200 milliseconds. Next, FIG. 1 to FIG.
Reference to a real-time memory management system according to the present embodiment
Will be described in detail. FIG. 2 to FIG.
Gar in a real-time memory management system according to an embodiment
Flow showing operation of veg collector scheduler 112
Fig. 2 shows a garbage collector for periodic tasks.
Operation at the start time of 108, FIG.
The operation at the cycle start time 2 is shown in FIG.
FIG. 5 shows the operation at the end of the second cycle, and FIG.
Shows the work. Note that the task scheduler 111
Scheduled task 102 and non-real-time task 103
Is known and is particularly relevant to the present invention.
The description of the parts that are not performed is omitted. Referring to FIG.
The start time of the periodic task garbage collector 108 has been reached.
Then, the timer is triggered by an interrupt from the timer 105 or the like.
The veg collector scheduler 112 operates and the periodic task
Make the garbage collector 108 executable (step
201), CPU allocation processing is performed. Please refer to FIG.
Then, when the cycle start time of the periodic task 102 is reached,
Garbage collection by interrupt from timer 105, etc.
The scheduler scheduler 112 operates, and the periodic task
-Check if the veg collector 108 is still processing
(Step 202) If processing is being performed, a garbage collector for periodic tasks
The processing of the veg collector 108 is terminated (step 20).
3). Then, make the periodic task 102 executable
(Step 204) CPU allocation processing is performed. FIG.
See garbage collector at the end of the periodic task
The scheduler 112 operates, and the next cycle of the periodic task 102 is executed.
Garbage collector relative start time storage unit 1 from the period start time
Periodic task by subtracting the time that 10 holds
Garbage collector 108 is started (step
205), opening the garbage collector 108 for periodic tasks
The garbage collector scheduler 112 operates at the start time
Is set (step 206) so that C
Perform PU allocation processing. Referring to FIG.
In the assignment process, the periodic task 102 in the executable state
Non-real-time task 103 in executable state,
Task garbage collector 108 or executable
Whether the garbage collector 109 is in a state
(Step 207), and if there is one,
Allocate the CPU 106 to the one with the higher priority (step
208). The priority here is the task schedule
Depending on the scheduling system of the controller 111
And, especially, the priority in the fixed priority method, etc.
Not something. The garbage collector for periodic tasks 1
08 ends processing before the cycle start time of the periodic task 102
Is completed, the time until the cycle start time of the periodic task 102 is reached.
The duration can be other executable tasks or garbage collectors.
CPU 106 is not assigned to the As explained above
In the real-time memory management system according to the present embodiment,
Indicates that the periodic task garbage collector 108
By the start time of each cycle of 102
Free memory until the start of the cycle.
Since the real-time task 103 is not executed, the periodic task 1
02 memory allocation request is processed promptly
The time constraint of the task 102 can be satisfied. Ma
Also, in the real-time memory management system according to the present embodiment,
Sets the periodic task garbage collector 108 to the periodic task
Since it is executed as preprocessing immediately before each cycle of 102,
Preprocessing of the next cycle after each cycle of the period task 102 is completed
Until the periodic task garbage collector 108 starts
During the period, all free memory is allocated to other non-real-time tasks 10.
3 can be assigned to improve memory utilization
I do. Next, a preferred implementation to which the first embodiment is applied
An example will be described. FIG. 6 is a block diagram showing the configuration of this embodiment.
It is a lock figure. As shown in FIG.
Reads the document data from the hard disk
A document print task 301 to be output to the printer 311;
Reads moving image data from hard disk 312
A periodic moving image display task displayed on the display 313
Task 302, a document print task 301, and a moving image display task.
In response to a memory allocation request from the
Memory management unit 30 that allocates memory 305 to the task
6 and the required amount of free memory
If the reference is not called from the memory management unit 306,
Illumination counter type garbage collector 304 and one
This is implemented as a task,
Garbage for reference task-based periodic tasks
Collector 303 and garbage collector 30 for periodic tasks
3 corresponds to the start time of each cycle of the moving image display task.
Relative start time storage unit 309 to hold as a relative value
And time information is acquired using the timer 307, and
Fixed priority CPU preemption that allocates CPU 308
It comprises a task scheduler 310 of a possible system.
Target of dynamic memory allocation by the memory management unit 306
There are 10 megabytes of memory. Document print task
301 has no particular time constraint but is fast
Ending printout is a preferred non-real-time task.
The document print task 301 stores a document temporarily.
As a file, a 2-megabyte memo depending on the size of the document
Request reassignment several times. However, if you use
Mori is at most 2 megabytes. Video display task
302 is a liquid crystal display with 10 frames per second
313. The moving image display task 302 has one cycle
Is implemented as a periodic task that displays one frame.
The cycle is 100 milliseconds, and the processing time for each cycle is 30 milliseconds.
Seconds. Also, the moving image display task 302 has a smooth
Since it is necessary to realize moving image display,
-Cannot perform veggie collection. Video display task
Queue 302 serves as a buffer for temporarily storing an image,
At the beginning of the period, an 8 megabyte memory allocation request is made.
However, this memory is not used after the end of the cycle. Video
The image display task 302 includes a document print task 301.
Garbage for periodic tasks.
The same collector as the moving image display task 302
A degree has been given. CPU 308 executes each task
Timer 307 has enough processing power to
Have sufficient granularity and precision to perform each task
You. The garbage collector for periodic tasks 303
All memory in 10 MB of memory to be reallocated
Has the ability to collect all garbage in 20 milliseconds.
You. The value of the relative start time storage unit 309 is
-The veg collector 303 and the moving image display task 302
8 megabytes of memory allocated in the cycle
What is necessary is just to set the time which can collect garbage. This embodiment
In this example, 20 milliseconds at which all garbage can be collected is set. Figure
FIG. 7A shows the activation timing of each task in this embodiment.
FIG. 7B is a timing chart showing the timing chart.
7 is a graph showing the total memory allocation amount at each time.
You. In FIG. 7A, a document print task 301
Execution is indicated by the bar 403 and the document print task
The required amount of free memory is
The garbage collector 304 called when it doesn't exist
Execution is indicated by the bar 404 and the video display task 30
The execution of 2 is indicated by a bar 401, and the moving image display task
For periodic tasks executed as pre-processing of each cycle of 302
The execution of the garbage collector 303 is indicated by a bar 402.
You. Referring to FIG. 7A, document print task 3
01 is activated at time 70 milliseconds and time 240 milliseconds
The process has been completed. Each round of the moving image display task 302
The period starts at 100 ms and 200 ms.
End at 130 ms and 230 ms respectively.
Have completed. The periodic task garbage collector 303
It starts at time 80 ms and time 180 ms.
Time 100 ms and time 200 ms
You. The document print task 301 has a time of 70 milliseconds,
At the time of 140 milliseconds and the time of 160 milliseconds,
Make a request to allocate megabytes of memory. Moving image display
The screen has a cycle start time of 100 milliseconds and an hour.
8 megabytes of memory for each 200 milliseconds
Make a request. Referring to FIG. 7B, first, at time 7
In 0 ms, the document print task 301
Memory is allocated. Periodic task at time 80 milliseconds
Garbage collector 303 is activated, but the garbage
Since it does not exist, the total memory allocation does not change. Next
At time 100 milliseconds, 8
Gigabytes of memory are allocated. At that point,
Memory allocation is 10 megabytes and all memory is
It has been assigned. Next, at the time 140 milliseconds,
Print task 301 allocates 2 MB of memory
Request, but all memory has already been allocated.
Garbage collector 304 is called to collect garbage
I do. At time 145 milliseconds, the required 2 megabytes of space
Processing of the garbage collector 304 that has secured memory
Completed, and a 2-megabyte memo was added to the document print task 301.
Is assigned. Time 160 ms
Time 165 millimeters after the veg collector 304 is called
2 MB of memory for document print task 301 per second
Is assigned. Next, at 180 ms, the periodic task
Garbage collector 303 is activated and the garbage
Make a profit. The actual memory used at this point is
Allocated to document print task 301 at time 165 ms
Only 2 megabytes of memory, time 200
Collect 8 megabytes of garbage by the millisecond. Next
At the time of 200 milliseconds, the video display task
Memory is allocated. In this way, moving image display
The time of 100 ms, which is the activation time of the task 302, and
At time 200 milliseconds, the cycle
Garbage collector 303 for the basket finishes collecting all garbage
Completed, 8 MB free memo allocated in each cycle
Memo of the moving image display task 302
It can be seen that the reallocation request is processed promptly.
Also, when it is the cycle end time of the moving image display task 302
Garbage collector 30 for periodic tasks from 130 milliseconds
The period up to 180 milliseconds, which is the start time of
All available memory is allocated to the document print task 301
In this embodiment, 4 megabytes can be allocated.
Has been applied. Limit maximum quota in each cycle
In the method, 8 MB is added to the moving image display task 302.
In order to guarantee the memory allocation of
The maximum allocated amount of each cycle of the
Document print task 301
Of the period from time 165 ms to time 180 ms
Processing will be postponed after 240 milliseconds.
That is, according to the present invention, the processing of the document print task 301 is performed.
Can end earlier. Also use memory
The rate is also improving. Next, in the second embodiment of the present invention,
This will be described in detail with reference to the drawings. FIG. 8 shows the present invention.
Of the real-time memory management system according to the second embodiment of the present invention.
FIG. 3 is a block diagram illustrating a configuration. Referring to FIG.
A real-time memory management system according to a second embodiment of the present invention
Is a real-time memo according to the first embodiment shown in FIG.
Free memory in the memory management unit 107 as compared with the memory management system.
The addition of the memory reservation means 501, the periodic task 102
Allocation that holds the amount of memory allocated per cycle
Assigned amount storage unit 503 and memory allocation amount storage unit 503
To set and change the value of
The addition of the step 502 indicates that the task scheduler 111
Cancel execution of a specific cycle of the periodic task 102
The difference is that the period canceling means 504 has been added. Figure
9 is a memory management unit 1 including a free memory reservation unit 501.
It is a block diagram which shows the structure of 07. Memory management unit 10
7 adopts a method of managing the memory 104 in page units.
The required amount of memory in the application task
Memory allocation means 601 for allocating to the
Garbage collector 108 for periodic tasks and garbage collector
Application 109
To release the memory allocated to the task group 101
Re-release means 602 and garbage collector 1 for periodic tasks
08 to specify the required amount of free memory.
Free memory to reserve in relation to the specified periodic task
Assignable to approximation means 603 and non-real-time task 103
Free page amount storage unit 604 holding a large free page amount
And the page 60 that can be assigned to the non-real time task 103
6, an empty page list 605 holding the list 6 in a list format;
Reserve the amount of pages reserved for each periodic task 102.
Reserved page amount storage 607 to be held and each periodic task 1
02 reserved pages 609 that are reserved every 02
Reserved pages to be kept in list format for each task 102
And a list 608. FIG. 9 shows an empty memo
5 shows an example of a method of realizing the re-reservation means 501.
Therefore, the present invention is not limited to this realization method.
The method of implementing memory management depends on the target hardware and
Probably depending on the operating system
Free memory reservation means 501 is suitable for the system environment.
It is feasible in a way. Periodic task in this embodiment
Garbage collector 108 before the periodic task 102
The garbage collector scheduler 112
And is terminated at the cycle start time of the periodic task 102.
This is the same as in the first embodiment, except that some
As a result of collecting the pages, the memory allocation amount storage unit 503
If the amount of free memory that can be held in
The processing is terminated at the point of
The amount of free memory held in the free memory reservation means 50
1 to the corresponding periodic task 102
Make a reservation in association with it. Garbage collection for periodic tasks
Is lower in priority than the corresponding periodic task
Tasks that take priority over periodic tasks
Corresponds to periodic tasks with lower priority than periodic tasks
The garbage collector 108 for periodic tasks
Is performed. Stored in the memory allocation storage unit 503
Before starting execution of the periodic task 102, the value
Is set by the amount setting means 502. Also, the periodic task
After the execution of the task 102 has started, the
For example, when the memory allocation per cycle changes due to
Is changed by the memory allocation setting means 502.
It is possible to change it. Task scheduler 111
Is the cycle that the periodic task garbage collector 108 corresponds to.
Completed before the cycle start time of the scheduled task 102
The period up to the cycle start time of the corresponding periodic task 102
In between, the other application task group 101,
Is the CPU 1 for the garbage collector 108 for other periodic tasks.
06 is assigned. Also, the task scheduler 111
Is the cycle corresponding to the cycle start time of the cycle task 102.
Processing of the garbage collector 108 for final tasks does not end
In this case, the period is
Cancel. Next, referring to the drawings,
The operation will be described in detail. FIG. 10 to FIG.
The operation of the task scheduler 111 in the form was shown.
It is a flowchart. Figure 10 shows garbage for periodic tasks
Operation at the start time of the collector 108, FIG.
FIG. 12 shows the operation of the task 102 at the cycle start time.
FIG. 13 shows the operation at the end of the cycle of the
Periodic task 10 corresponding to the garbage collector 108
Operation when processing is completed before cycle start time 2 in FIG.
4 shows the operation of the CPU assignment process. FIG.
The operation of the present embodiment shown in FIG. 12 and FIG.
The operation of the first embodiment shown in FIG. 2, FIG. 4 and FIG.
Since it is the same as the work, it will not be described here. Referring to FIG.
Then, the task scheduler 111 in the present embodiment
The operation of the periodic task 102 at the cycle start time is shown in FIG.
3 is different from the operation of the first embodiment shown in FIG.
If the garbage collector 108 is still in process,
After terminating the garbage collector for periodic tasks (step
203), using the period canceling means 504,
Canceling the corresponding cycle (Step 701)
different. With reference to FIG.
The scheduler 111 is a garbage collector for periodic tasks.
Start time of the periodic task 102 corresponding to the
If you have previously reserved the required amount of free memory and exited,
Other applications that can be executed until the start time
Task group 101, garbage collector 109, or
CPU 106 to the garbage collector 108
Guess. FIG. 15 shows a periodic task according to the present embodiment.
Showing the operation of the garbage collector 108
It is. Referring to FIG. 15, in the present embodiment,
The garbage collector for periodic tasks 108
Garbage when the cycle start time of task 102 comes
Terminated by collector scheduler 112
(Step 801). Period of the corresponding periodic task 102
If not, start some garbage
Is detected (step 802), and the memo of the memory management unit 107 is
Re-release means 602 to call the garbage
From the task group 101 (step 80)
3). Next, the data is stored in the memory quota storage unit 503.
Check whether enough free memory has been secured (step
804) If the memory is secured, the memory management unit 107 becomes empty.
Call up the memory reservation means 501 and
Reservation in association with the corresponding periodic task 102
(Step 805). In step 804,
If free memory is not secured, go back to the beginning
Continue collecting garbage. FIG. 16 to FIG.
A flowchart showing the operation of the memory management unit 107 according to the embodiment.
It is a low chart. FIG. 16 shows that the memory management unit 107 has
The operation of the memory allocating means 601 is shown in FIG.
17 is a memory release unit 60 of the memory management unit 107
FIG. 18 shows the operation of the memory management unit 107.
The operation of the free memory reservation means 603 is shown.
Referring to FIG. 16, the memory allocating means 601 is
Was the periodic task 102 that issued the memory allocation request
It is checked whether the task 103 is the non-real time task 103 (step 901).
When the non-real-time task 103 issues a memory allocation request
In this case, first, the requested
To see if there is a free amount of free pages (step
902), if not, the garbage collector 109
Is called and garbage is collected, and then step 902 is executed.
Is repeated. Requested in step 902
If there is an empty page with the
Allocate a free page 606 held by the
Is assigned to the non-real-time task 103 that requested (step
904), the value of the free page amount storage unit 604 is assigned
Reduce the amount of memory (step 905) and end the process
I do. Periodic task 102 made a memory allocation request
If so, the periodic task 1 in the reserved page list 608
Reserved page 609 held by the entry corresponding to 02
Is assigned to the periodic task 102 that has requested (step 90
6), corresponding entry in the reserved page amount storage unit 107
Is reduced by the allocated memory amount (step 90).
7), the process ends. Referring to FIG. 17, the memory solution
The release unit 602 stores the specified memory in the application
Release from task group 101 (step 908) and release
Inserted into the free page list 605 (step
909), when the value in the free page amount storage unit 604 is released.
The amount is increased by the amount of memory (step 910), and the processing is terminated.
You. Referring to FIG. 18, free memory reservation means 603
Lists the specified amount of free pages 606
605 from the reserved page list 608
Move to the entry corresponding to task 102 (step
911), the value of the free page amount storage unit 604 is moved.
Reduced by the amount of memory (step 912), reserved page amount
Corresponds to the specified periodic task 102 in the storage unit 607
Increase the value of the entry by the amount of reserved memory (step
913), and the process ends. FIG. 16 to FIG.
An example of the operation of the memory management unit 107 according to the embodiment will be described.
Shown, the invention is not limited to this operation
is not. Memory management method depends on the target hardware
And operating system dependencies,
The memory management unit 107 can perform operations suitable for the system environment.
I just need. As described above, in the second embodiment, the
Periodic task that the garbage collector 108 for
Before the start time of each cycle of
To secure and reserve a free memory,
02 memory allocation request can be processed promptly
The time constraint of the task 102 can be satisfied. Ma
In this embodiment, the garbage collector for periodic tasks
108 completes the processing, and
Until the period start time, the other executable periodic tasks 1
02, executable non-real-time task 103, executable cycle
Garbage collector 108
The use efficiency of the CPU is improved by executing the
I do. In this embodiment, the garbage for periodic tasks
Each period opening of the periodic task 102 corresponding to the collector 108
If the required amount of free memory could not be secured by the start time
Meet the time constraint to cancel the cycle.
Solve problems caused by executing cycles that cannot be performed
Can be turned off. For example, multiple actions by multiple periodic tasks
In the method of displaying images, it is in charge of displaying one moving image
If a periodic task cannot meet the time constraint,
Influences the task and eventually all video display is distorted
May be In such a case, you can not meet the time constraint
Other periodic tasks by canceling the new cycle
Time constraints, and those periodic tasks
The effect that the moving image display in charge is performed smoothly
Can be expected. Next, a specific example to which the second embodiment is applied.
Examples will be described. FIG. 19 shows the configuration of this embodiment.
It is a block diagram showing composition. First implementation shown in FIG.
The difference from the embodiment of the embodiment is that the free memory reservation unit 110
1 and a memory allocation storage unit 1102
It is. The value of the memory allocation storage unit 1102 is
The memory allocation amount per cycle of the image display task 302
Set to 8 megabytes. Memory allocation storage
The value of 1102 is set before the system is started. FIG.
0 (A) is the activation timing of each task in this embodiment.
FIG. 21 is a timing chart showing the timing chart of FIG.
Is a graph showing the total memory allocation at each time.
You. In FIG. 20A, the document print task 30
1 is indicated by the bar 403 and the document print task
Required free memory at the time of memory allocation request
Garbage collector 304 called when there is no
Is indicated by a bar 404, and the moving image display task 3
02 is indicated by a bar 401, and the moving image display task
Garbage collector for periodic tasks executed as pre-processing for each cycle
Execution of the veg collector 303 is indicated by the bar 402.
Referring to FIG. 20A, the document print task 30
1 is activated at time 70 ms and at time 170 ms
Finished. Each cycle of the moving image display task 302
It starts at 100 milliseconds and 200 milliseconds,
End at 130 ms and 230 ms
You. The document print task 301 has a time of 70 milliseconds,
2 megs at 90 ms and 140 ms
Make a byte memory allocation request. Video display task
302 is a cycle start time of 100 milliseconds and
8 MB memory allocation for 200 ms each
Make a guess request. Garbage collector for periodic tasks 303
Starts at 80 ms and 180 ms
8 memories stored in the memory allocation storage 1102.
When gigabytes of free memory is secured,
8 MB free memory by calling about means 1101
Is associated with the moving image display task 302 to make a reservation.
finish. Referring to FIG. 20B, first, at time 70
A 2 megabyte message is sent to the document print task 301 in milliseconds.
Mori is assigned. For a periodic task with a time of 80 milliseconds
The garbage collector 303 starts executing, but has already
Garbage times because gigabytes of free memory is secured
8 MB free memory is reserved,
The process ends immediately. Therefore, document print task 3
01 resumes, 2 MB at 90 ms
Request for memory allocation. Assign to each task at that time
The total memory allocated is 2 megabytes, but 8
The gigabyte is reserved for the moving image display task 302,
Since there is no free memory, the garbage collector 304
Is called to collect garbage. Time to 95 milliseconds
Garbage collector 304 spins 2 MB of garbage
After collecting, 2MB of secured free memory is documented
Assigned to print task 301. Next, at time 100
The moving image display task 302 takes 8 megabytes of memos in milliseconds.
Request a re-allocation and reserve 8 Mbytes
Allocate default memory. From the time 130 milliseconds
Execution of the lint task 301 is resumed, and the time is 140 millimeters.
Makes a request to allocate 2 megabytes of memory per second. At this time
In terms of point, all memory is allocated to each task
Activate the garbage collector 304 and collect garbage
2 MB at 145 ms.
Assign it to the lint task 301. Next time 180 mm
The garbage collector 303 for the periodic task is activated every second,
Collect 8MB of garbage by 195ms
And displays the secured 8 MB free memory as a moving image
A reservation is made in association with the task 302. And time 20
8 megabytes of memory reserved for 0 milliseconds
Assigned task 302. Thus, the moving image
The memory allocation request of the display task 302 is promptly processed.
What is implemented is the implementation of the first embodiment shown in FIG.
Similar to the example, but in this embodiment, the garbage
Is stored in the memory allocation storage unit 1102
When the amount of available memory is reserved and reserved,
CPU usage efficiency to execute print task 301
And the document print task 301 ends as a result.
The time is getting earlier. Next, a third embodiment of the present invention
The state will be described with reference to the drawings. FIG. 21 shows the present invention.
Of the real-time memory management system according to the third embodiment
FIG. 3 is a block diagram illustrating a configuration. Referring to FIG.
Real-time memory management system according to a third embodiment of the invention
The configuration of the system is the same as that of the second embodiment shown in FIG.
In comparison, an empty memo is used instead of the period canceling means 504.
The difference is that a shortage notification unit 1201 is provided. Free note
The re-insufficient notification means 1201 is provided for each cycle of the periodic task 102.
Garbage collector 108 for periodic tasks by the start time
Is the free memory of the amount held by the memory allocation amount storage unit 503.
If memory cannot be secured, the corresponding periodic task 102 or
Or other tasks included in the application task group 101.
That there is not enough free memory on the disk
This is a function to notify the available memory amount. Insufficient free memory
The notification means 1201 opens each cycle of the periodic task 102.
Memory shortage flag was secured as an argument of the function to start
How to pass the amount of memory, notify using global variables
It can be realized by a known technique such as I explained above
As described above, in the third embodiment, each cycle of the periodic task 102
If the required amount of free memory is not available at the start time
In this case, the periodic task is
Can know in advance that the free memory is insufficient.
The amount of memory required to allocate
Reduce and continue processing or cancel the cycle by yourself
Measures can be taken. More preferred
The present invention has been described with reference to the embodiment and the examples.
The invention is not necessarily limited to the above embodiments and examples
Not within the scope of the technical idea.
Modifications can be made. Second embodiment of the present invention
The period canceling means 504 in the form includes a periodic task
The memory allocation amount storage unit 50 at each cycle start time of 102
When there is not enough free memory reserved in 3
Cancels the execution of the cycle,
Whether to cancel the cycle every 02 or continue processing
It is also conceivable to have a form that has a period
It is. Also required at each cycle start time of periodic task 102
If the amount of free memory is not secured,
102, cancel the cycle, or
Notifies the lack of memory or garbage collector for periodic tasks
Continue the processing of 108 or execute other processing.
Can be specified for each periodic task 102
Conceivable.

【発明の効果】以上説明したように本発明の実時間メモ
リ管理システム、及び実時間メモリ管理方法によれば、
次に述べるような効果が得られる。本発明の第1の効果
は、ガーベジコレクタを使用する実時間システムにおい
て、実時間周期タスクの時間制約を満たすことが可能な
ことである。その理由は、周期タスクの各周期の前処理
として実行される周期タスク用ガーベジコレクタが、そ
の周期のメモリ割り当て量の空きメモリを周期開始時刻
までに確保することによって、メモリ割り当て要求時に
すみやかにメモリを割り当てることができるからであ
る。本発明の第2の効果は、メモリ利用率が高いことで
ある。その理由は、周期タスクの各周期で必要となる空
きメモリの確保を周期の前処理として実行する周期タス
ク用ガーベジコレクタで行うため、その周期タスク用ガ
ーベジコレクタが実行を開始する時刻以前は、他のタス
クに全ての空きメモリを割り当てることが可能だからで
ある。
As described above, according to the real-time memory management system and the real-time memory management method of the present invention,
The following effects can be obtained. A first effect of the present invention is that a real-time system using a garbage collector can satisfy the time constraint of a real-time periodic task. The reason is that the periodic task garbage collector, which is executed as a pre-process of each cycle of the periodic task, secures the free memory of the memory allocation amount of the cycle by the cycle start time, so that the memory can be promptly allocated at the time of the memory allocation request. Because it can be assigned. A second effect of the present invention is that the memory utilization is high. The reason is that the garbage collector for the periodic task, which executes the pre-processing of the cycle, secures the free memory required for each cycle of the periodic task, so before the time when the garbage collector for the periodic task starts to execute, This is because all free memory can be assigned to the task.

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

【図1】 本発明の第1の実施の形態による実時間メモ
リ管理システムの構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a real-time memory management system according to a first embodiment of the present invention.

【図2】 本発明の第1の実施の形態の周期タスク用ガ
ーベジコレクタの周期開始時刻における動作を示すフロ
ーチャートである。
FIG. 2 is a flowchart showing an operation of the periodic task garbage collector according to the first embodiment of the present invention at a cycle start time.

【図3】 本発明の第1の実施の形態の周期タスクの周
期開始時刻における動作を示すフローチャートである。
FIG. 3 is a flowchart illustrating an operation at a cycle start time of a periodic task according to the first embodiment of this invention.

【図4】 本発明の第1の実施の形態の周期タスク10
2の周期終了時の動作を示すフローチャートである。
FIG. 4 is a periodic task 10 according to the first embodiment of this invention.
9 is a flowchart showing an operation at the end of a second cycle.

【図5】 本発明の第1の実施の形態のCPU割り当て
処理の動作を示すフローチャートである。
FIG. 5 is a flowchart illustrating an operation of a CPU assignment process according to the first embodiment of this invention.

【図6】 本発明の第1の実施の形態を適応した実施例
の構成を示すブロック図である。
FIG. 6 is a block diagram showing a configuration of an example to which the first embodiment of the present invention is applied.

【図7】 本発明の第1の実施の形態の実施例の動作を
示すタイミングチャートである。
FIG. 7 is a timing chart showing an operation of the example of the first exemplary embodiment of the present invention.

【図8】 本発明の第2の実施の形態による実時間メモ
リ管理システムの構成を示すブロック図である。
FIG. 8 is a block diagram showing a configuration of a real-time memory management system according to a second embodiment of the present invention.

【図9】 本発明の第2の実施の形態のメモリ管理部の
構成を示すブロック図である。
FIG. 9 is a block diagram illustrating a configuration of a memory management unit according to a second embodiment of this invention.

【図10】 本発明の第2の実施の形態の周期タスク用
ガーベジコレクタの開始時刻における動作を示すフロー
チャートである。
FIG. 10 is a flowchart illustrating an operation of the periodic task garbage collector according to the second embodiment of the present invention at a start time.

【図11】 本発明の第2の実施の形態の周期タスクの
周期開始時刻における動作を示すフローチャートであ
る。
FIG. 11 is a flowchart illustrating an operation at a cycle start time of a periodic task according to the second embodiment of this invention.

【図12】 本発明の第2の実施の形態の周期タスクの
周期終了時の動作を示すフローチャートである。
FIG. 12 is a flowchart illustrating an operation at the end of a cycle of a periodic task according to the second embodiment of this invention.

【図13】 本発明の第2の実施の形態の周期タスク用
ガーベジコレクタが、対応する周期タスクの周期開始時
刻以前に処理を終了した時の動作を示すフローチャート
である。
FIG. 13 is a flowchart illustrating an operation of the periodic task garbage collector according to the second embodiment of the present invention when the garbage collector finishes processing before the cycle start time of the corresponding periodic task.

【図14】 本発明の第2の実施の形態のCPU割り当
て処理の動作を示すフローチャートである。
FIG. 14 is a flowchart illustrating an operation of a CPU assignment process according to the second embodiment of this invention.

【図15】 本発明の第2の実施の形態の周期タスク用
ガーベジコレクタの動作を示すフローチャートである。
FIG. 15 is a flowchart illustrating an operation of a periodic task garbage collector according to the second embodiment of this invention.

【図16】 本発明の第2の実施の形態のメモリ管理部
が有するメモリ割り当て手段の動作を示すフローチャー
トである。
FIG. 16 is a flowchart illustrating an operation of a memory allocating unit included in a memory management unit according to the second embodiment of this invention.

【図17】 本発明の第2の実施の形態のメモリ管理部
が有するメモリ解放手段の動作を示すフローチャートで
ある。
FIG. 17 is a flowchart illustrating an operation of a memory release unit included in the memory management unit according to the second embodiment of this invention.

【図18】 本発明の第2の実施の形態のメモリ管理部
が有する空きメモリ予約手段の動作を示すフローチャー
トである。
FIG. 18 is a flowchart illustrating an operation of a free memory reservation unit included in the memory management unit according to the second embodiment of this invention.

【図19】 本発明の第2の実施の形態を適応した実施
例の構成を示すブロック図である。
FIG. 19 is a block diagram illustrating a configuration of an example to which the second embodiment of the present invention is applied.

【図20】 本発明の第2の実施の形態の実施例の動作
を示すタイミングチャートである。
FIG. 20 is a timing chart showing the operation of the example of the second exemplary embodiment of the present invention.

【図21】 本発明の第3の実施の形態による実時間メ
モリ管理システムの構成を示すブロック図である。
FIG. 21 is a block diagram showing a configuration of a real-time memory management system according to a third embodiment of the present invention.

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

101 アプリケーションタスク群 102 周期タスク 103 非実時間タスク 104 メモリ 105 タイマ 106 CPU 107 メモリ管理部 108 周期タスク用ガーベジコレクタ 109 ガーベジコレクタ 110 ガーベジコレクタ相対開始時刻記憶部 111 タスクスケジューラ 112 ガーベジコレクタスケジューラ 301 文書プリントタスク 302 動画像表示タスク 303 周期タスク用ガーベジコレクタ 304 ガーベジコレクタ 305 メモリ 306 メモリ管理部 307 タイマ 308 CPU 309 相対開始時刻記憶部 310 タスクスケジューラ 401 周期タスクの実行期間 402 周期タスク用ガーベジコレクタの実行期間 403 非実時間タスクの実行期間 404 ガーベジコレクタの実行期間 501 空きメモリ予約手段 502 メモリ割り当て量設定手段 503 メモリ割り当て量記憶部 504 周期キャンセル手段 601 メモリ割り当て手段 602 メモリ解放手段 603 空きメモリ予約手段 604 空きページ量記憶部 605 空きページリスト 606 空きページ 607 予約済ページ量記憶部 608 予約済ページリスト 609 予約済ページ 1101 空きメモリ予約手段 1102 メモリ割り当て量記憶部 1201 空きメモリ不足通知手段 101 Application Task Group 102 Periodic Task 103 Non-Real Time Task 104 Memory 105 Timer 106 CPU 107 Memory Management Unit 108 Garbage Collector for Periodic Task 109 Garbage Collector 110 Garbage Collector Relative Start Time Storage Unit 111 Task Scheduler 112 Garbage Collector Scheduler 301 Document Print Task 302 Moving image display task 303 Garbage collector for periodic task 304 Garbage collector 305 Memory 306 Memory management unit 307 Timer 308 CPU 309 Relative start time storage unit 310 Task scheduler 401 Period for executing periodic task 402 Period for executing garbage collector for periodic task 403 Non Real-time task execution period 404 Garbage collector execution period 501 Free memory reservation Stage 502 Memory allocation setting means 503 Memory allocation storage 504 Period canceling means 601 Memory allocation means 602 Memory release means 603 Free memory reservation means 604 Free page storage 605 Free page list 606 Free pages 607 Reserved page storage 608 Reserved page list 609 Reserved page 1101 Free memory reservation means 1102 Memory allocation amount storage unit 1201 Free memory shortage notification means

Claims (15)

【特許請求の範囲】[Claims] 【請求項1】 時間制約を有する周期タスクを含む実時
間システムにおいて、 前記周期タスクの各周期の前処理として実行され、メモ
リ上のガーベジの回収処理を行なうガーベジコレクショ
ン手段と、 前記ガーベジコレクション手段の実行開始時刻を、前記
周期タスクの各開始時刻を基準とする相対的な時刻によ
って保持する相対開始時刻記憶手段と、 前記相対開始時刻記憶手段を参照して、前記ガーベジコ
レクション手段の実行をスケジュールするガーベジコレ
クタスケジュール手段を備え、 前記ガーベジコレクタスケジュール手段により、前記周
期タスクの各周期の前処理として前記ガーベジコレクシ
ョン手段を実行することを特徴とする実時間メモリ管理
システム。
1. A real-time system including a periodic task having a time constraint, comprising: a garbage collection unit that is executed as a pre-process of each period of the periodic task and performs a garbage collection process on a memory; A relative start time storage unit that holds an execution start time as a relative time based on each start time of the periodic task, and schedules execution of the garbage collection unit with reference to the relative start time storage unit. A real-time memory management system comprising garbage collector scheduling means, wherein the garbage collector scheduling means executes the garbage collection means as preprocessing of each cycle of the periodic task.
【請求項2】 前記周期タスクを複数含み、 前記ガーベジコレクタスケジュール手段が、前記周期タ
スク毎に個別に前記ガーベジコレクション手段を実行す
ることを特徴とする請求項1記載の実時間メモリ管理シ
ステム。
2. The real-time memory management system according to claim 1, comprising a plurality of said periodic tasks, wherein said garbage collector schedule means executes said garbage collection means individually for each said periodic task.
【請求項3】 前記周期タスクの一周期あたりのメモリ
割り当て量を保持するメモリ割り当て量記憶手段と、 指定された量の空きメモリを前記周期タスクに関連づけ
て予約する空きメモリ予約手段をさらに備え、 前記ガーベジコレクション手段が、前記メモリ割り当て
量記憶手段に保持される量の空きメモリが確保された時
点で、前記空きメモリ予約手段に、前記メモリ割り当て
量記憶手段に保持される量の空きメモリを予約し、処理
を終了することを特徴とする請求項1に記載の実時間メ
モリ管理システム。
3. The system further comprises: a memory allocation amount storage unit that stores a memory allocation amount per one cycle of the periodic task; and a free memory reservation unit that reserves a specified amount of free memory in association with the periodic task. The garbage collection unit reserves the free memory of the amount held in the memory allocation amount storage unit by the free memory reservation unit when the amount of free memory held in the memory allocation amount storage unit is secured. 2. The real-time memory management system according to claim 1, wherein the processing is terminated.
【請求項4】 前記周期タスクの実行開始後に、前記メ
モリ割り当て量記憶手段が保持する値の設定又は変更を
行なうメモリ割り当て量設定手段を備えることを特徴と
する請求項3に記載の実時間メモリ管理システム。
4. The real-time memory according to claim 3, further comprising a memory allocation setting unit configured to set or change a value held by the memory allocation storage after the execution of the periodic task is started. Management system.
【請求項5】 前記周期タスクを複数含み、 前記メモリ割り当て量記憶手段が、各周期タスクの一周
期あたりの前記メモリ割り当て量を個別に保持し、 前記空きメモリ予約手段が、前記各周期タスクに個別に
前記空きメモリを予約し、 前記ガーベジコレクタスケジュール手段が、前記各周期
タスクに対して個別に前記ガーベジコレクション手段を
実行することを特徴とする請求項3又は4記載の実時間
メモリ管理システム。
5. The periodic task includes a plurality of periodic tasks, wherein the memory allocation amount storage unit individually stores the memory allocation amount per one cycle of each periodic task, and the free memory reservation unit stores the memory allocation amount for each of the periodic tasks. 5. The real-time memory management system according to claim 3, wherein the free memory is individually reserved, and the garbage collector schedule means executes the garbage collection means individually for each of the periodic tasks.
【請求項6】 前記周期タスクを複数含み、 前記ガーベジコレクタスケジュール手段が、前記ガーベ
ジコレクション手段を、当該ガーベジコレクション手段
に対応する前記周期タスクよりも優先順位が低い周期タ
スク及び、当該周期タスクに対応する前記ガーベジコレ
クション手段よりも優先して実行することを特徴とする
請求項2又は5記載の実時間メモリ管理システム。
6. The garbage collector scheduling means including a plurality of the periodic tasks, wherein the garbage collector scheduling means assigns the garbage collection means to a periodic task having a lower priority than the periodic task corresponding to the garbage collection means, and 6. The real-time memory management system according to claim 2, wherein execution is performed prior to said garbage collection means.
【請求項7】 前記ガーベジコレクション手段が、対応
する前記周期タスクの周期開始時刻までに、前記メモリ
割り当て量記憶手段が保持する量の前記空きメモリを確
保できなかった場合に、 前記周期タスクのその周期の実行をキャンセルする周期
キャンセル手段を備えることを特徴とする請求項1乃至
請求項6記載の実時間メモリ管理システム。
7. If the garbage collection unit cannot secure the amount of free memory held by the memory allocation amount storage unit by the cycle start time of the corresponding periodic task, 7. The real-time memory management system according to claim 1, further comprising a period canceling unit for canceling execution of a period.
【請求項8】 前記ガーベジコレクション手段が、対応
する前記周期タスクの周期開始時刻までに、前記メモリ
割り当て量記憶手段が保持する量の前記空きメモリを確
保できなかった場合に、 必要量の前記空きメモリが確保できなかったことを対応
する前記周期タスク、あるいは任意のタスクに通知する
空きメモリ不足通知手段を備えることを特徴とする請求
項1乃至請求項6記載の実時間メモリ管理システム。
8. The garbage collection unit, if the garbage collection unit cannot secure the amount of free memory held by the memory allocation amount storage unit by the cycle start time of the corresponding periodic task, 7. The real-time memory management system according to claim 1, further comprising a free memory shortage notifying unit for notifying the periodic task or any task corresponding to the failure to secure a memory.
【請求項9】 前記空きメモリ不足手段は確保できた空
きメモリ量を対応する前記周期タスク、あるいは任意の
タスクに通知する手段を併せて有する空きメモリ不足量
通知手段を備えることを特徴とする請求項1乃至請求項
6記載の実時間メモリ管理システム。
9. The free memory shortage means further comprising a free memory shortage notifying means having means for notifying the periodic task or an arbitrary task of the reserved free memory amount to the corresponding periodic task or an arbitrary task. 7. The real-time memory management system according to claim 1.
【請求項10】 時間制約を有する周期タスクを含む実
時間システムにおいて、 前記周期タスクの各周期の前処理としてガーベジコレク
ション処理を実行し、前記周期タスクの各周期開始時刻
までに当該周期で割り当てられるメモリ量以上の空きメ
モリを確保することを特徴とする実時間メモリ管理方
法。
10. A real-time system including a periodic task having a time constraint, wherein a garbage collection process is executed as a pre-process of each cycle of the periodic task, and the garbage collection process is allocated in the cycle by each cycle start time of the periodic task. A real-time memory management method characterized by securing free memory equal to or larger than a memory amount.
【請求項11】 前記同期タスクを複数含み、前記同期
タスク毎に個別に前記ガーベジコレクション処理を実行
することを特徴とする請求項10記載の実時間メモリ管
理方法。
11. The real-time memory management method according to claim 10, wherein a plurality of said synchronization tasks are included, and said garbage collection process is executed individually for each of said synchronization tasks.
【請求項12】 前記同期タスクを複数含み、前記ガー
ベジコレクション処理を当該ガーベジコレクション処理
に対応する前記同期タスクよりも優先順位が低い同期タ
スク及び、当該同期タスクに対応する前記前記ガーベジ
コレクション処理よりも優先して実行することを特徴と
する請求項10又は11記載の実時間メモリ管理方法。
12. The garbage collection process including a plurality of the synchronization tasks, wherein the garbage collection process has a lower priority than the synchronization task corresponding to the garbage collection process, and a garbage collection process corresponding to the synchronization task. 12. The real-time memory management method according to claim 10, wherein the method is executed with priority.
【請求項13】 前記周期タスクの各周期の前処理とし
てガーベジコレクション処理を実行し、 前記周期タスクの各周期開始時刻までにその周期で割り
当てられるメモリ量以上の空きメモリを確保し、 確保した前記空きメモリをその前記周期タスクに関連づ
けて予約し、 その後前記周期タスクの周期開始時刻まで他のタスクを
実行することを特徴とする請求項10乃至12記載の実
時間メモリ管理方法。
13. A garbage collection process is executed as a pre-process of each cycle of the periodic task, and a vacant memory equal to or larger than a memory amount allocated in the cycle is secured by the start time of each cycle of the periodic task. 13. The real-time memory management method according to claim 10, wherein a free memory is reserved in association with the periodic task, and thereafter, another task is executed until a cycle start time of the periodic task.
【請求項14】 前記ガーベジコレクション処理で、対
応する前記周期タスクの周期開始時刻までにその周期で
割り当てられるメモリ量以上の空きメモリを確保できな
かった場合に、 当該周期の実行をキャンセルすることを特徴とする請求
項10乃至13記載の実時間メモリ管理方法。
14. When the garbage collection process fails to secure a free memory equal to or more than the memory amount allocated in the cycle by the cycle start time of the corresponding cycle task, cancels execution of the cycle. 14. The real-time memory management method according to claim 10, wherein:
【請求項15】 前記ガーベジコレクション処理が、対
応する前記周期タスクの周期開始時刻までにその周期で
割り当てられるメモリ量以上の前記空きメモリを確保で
きなかった場合に、 前記周期タスク又は他のタスクに、必要量の前記空きメ
モリが確保できなかったこと、又は確保できた空きメモ
リ量を通知することを特徴とする請求項10乃至13記
載の実時間メモリ管理方法。
15. When the garbage collection process fails to secure the free memory equal to or more than the amount of memory allocated in the cycle by the cycle start time of the corresponding periodic task, 14. The real-time memory management method according to claim 10, further comprising notifying that a required amount of said free memory could not be secured, or notifying of the secured free memory amount.
JP11150466A 1999-05-28 1999-05-28 Real time memory management system and real time memory managing method Pending JP2000339214A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11150466A JP2000339214A (en) 1999-05-28 1999-05-28 Real time memory management system and real time memory managing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11150466A JP2000339214A (en) 1999-05-28 1999-05-28 Real time memory management system and real time memory managing method

Publications (1)

Publication Number Publication Date
JP2000339214A true JP2000339214A (en) 2000-12-08

Family

ID=15497543

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11150466A Pending JP2000339214A (en) 1999-05-28 1999-05-28 Real time memory management system and real time memory managing method

Country Status (1)

Country Link
JP (1) JP2000339214A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005025727A (en) * 2003-06-09 2005-01-27 Mitsubishi Electric Corp Information storage control device, information storage control method, and information storage control program
US8205203B2 (en) * 2008-10-16 2012-06-19 International Business Machines Corporation Scheduling for real-time garbage collection
US8429658B2 (en) * 2008-10-16 2013-04-23 International Business Machines Corporation Lock deferral for real-time garbage collection
JP2014513342A (en) * 2011-03-29 2014-05-29 マイクロソフト コーポレーション Conservative garbage collection with simultaneous marks and sweeps for memory management
JP2018510432A (en) * 2015-05-29 2018-04-12 グーグル エルエルシー Software garbage collection of idle time
CN110053896A (en) * 2018-01-19 2019-07-26 杭州易收环保科技有限公司 A kind of municipal waste recycling shared system based on Internet of Things

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005025727A (en) * 2003-06-09 2005-01-27 Mitsubishi Electric Corp Information storage control device, information storage control method, and information storage control program
US8205203B2 (en) * 2008-10-16 2012-06-19 International Business Machines Corporation Scheduling for real-time garbage collection
US8429658B2 (en) * 2008-10-16 2013-04-23 International Business Machines Corporation Lock deferral for real-time garbage collection
JP2014513342A (en) * 2011-03-29 2014-05-29 マイクロソフト コーポレーション Conservative garbage collection with simultaneous marks and sweeps for memory management
JP2018510432A (en) * 2015-05-29 2018-04-12 グーグル エルエルシー Software garbage collection of idle time
CN110053896A (en) * 2018-01-19 2019-07-26 杭州易收环保科技有限公司 A kind of municipal waste recycling shared system based on Internet of Things

Similar Documents

Publication Publication Date Title
US11507420B2 (en) Systems and methods for scheduling tasks using sliding time windows
US8959515B2 (en) Task scheduling policy for limited memory systems
US20030061260A1 (en) Resource reservation and priority management
US8205203B2 (en) Scheduling for real-time garbage collection
US4967353A (en) System for periodically reallocating page frames in memory based upon non-usage within a time period or after being allocated
EP1365328B1 (en) Method for executing parallel process, and multi-processor computer
US8429658B2 (en) Lock deferral for real-time garbage collection
JPH06168143A (en) Task-scheduling method and task controller
JP2003509766A (en) Method for time-sharing application scheduling in a computer operating system
JPH07509794A (en) How to manage resources allocated to your computer
JP2012104140A (en) Sharing processor execution resources in waiting state
CN107515781B (en) Deterministic task scheduling and load balancing system based on multiple processors
US6721948B1 (en) Method for managing shared tasks in a multi-tasking data processing system
KR20070090649A (en) Apparatus and method for providing cooperative scheduling on multi-core system
JP2000339214A (en) Real time memory management system and real time memory managing method
JP3962370B2 (en) RESOURCE RESERVATION SYSTEM, RESOURCE RESERVATION METHOD, AND RECORDING MEDIUM CONTAINING PROGRAM FOR EXECUTING THE METHOD
US20040045003A1 (en) Stack usage in computer-related operating systems
WO2005096195A2 (en) Method and system for transferring budgets in a technique for restrained budget use
Horowitz A run-time execution model for referential integrity maintenance
CN100462923C (en) Task management system
JPH09244931A (en) Real-time file system
JP2015148909A (en) Parallel computer system, control method of parallel computer system, and control program of management node
CN114035926A (en) Application thread scheduling method and device, storage medium and electronic equipment
JP2002278778A (en) Scheduling device in symmetrical multiprocessor system
Jette et al. Gang scheduler-timesharing the cray t3d

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20031219