JP2014206871A - Control method, control device, control program and recording medium - Google Patents
Control method, control device, control program and recording medium Download PDFInfo
- Publication number
- JP2014206871A JP2014206871A JP2013084247A JP2013084247A JP2014206871A JP 2014206871 A JP2014206871 A JP 2014206871A JP 2013084247 A JP2013084247 A JP 2013084247A JP 2013084247 A JP2013084247 A JP 2013084247A JP 2014206871 A JP2014206871 A JP 2014206871A
- Authority
- JP
- Japan
- Prior art keywords
- software
- identifier
- memory block
- control device
- memory
- 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
Links
Images
Abstract
Description
本発明は、制御方法、制御装置、制御プログラム、および記録媒体に関する。 The present invention relates to a control method, a control device, a control program, and a recording medium.
従来、ソフトウェアに規定された処理を実行するために、メモリ内の記憶領域をソフトウェアのワークエリアとして動的に割り当てる技術がある。例えば、ソフトウェアによってmalloc関数が呼び出されるとOS(Operating System)がメモリ内の記憶領域を確保し、ソフトウェアによってfree関数が呼び出されるとOSが確保したメモリ内の記憶領域を解放する。 2. Description of the Related Art Conventionally, there is a technique for dynamically allocating a storage area in a memory as a work area for software in order to execute processing defined by software. For example, when the malloc function is called by software, an OS (Operating System) secures a storage area in the memory, and when the free function is called by software, the storage area in the memory secured by the OS is released.
関連する技術としては、例えば、同一使用者の複数のメモリ領域を一度に解放する技術がある。具体的には、メモリ使用者が、メモリ解放制御部のID登録手段を介してメモリ領域を獲得し、その際メモリ使用者を識別するIDとメモリ領域のアドレスの対応をID管理テーブルに登録する。そして、メモリ使用者が、獲得したメモリが必要なくなったと判断した場合、メモリ解放制御部の解放忘れメモリ返却手段を呼び出し、メモリ使用者のIDから、解放されていないメモリ領域を探して解放する。 As a related technique, for example, there is a technique for releasing a plurality of memory areas of the same user at a time. Specifically, the memory user acquires a memory area via the ID registration unit of the memory release control unit, and registers the correspondence between the ID for identifying the memory user and the address of the memory area in the ID management table. . When the memory user determines that the acquired memory is no longer needed, the memory user calls the memory release control unit of the memory release control unit to search for and release a memory area that has not been released from the memory user's ID.
また、アプリケーション終了により不必要になった資源の回収を実行する技術がある。例えば、アプリケーション実行装置が、アプリケーションからの資源の提供の要求に応じて資源を提供したときに、資源の提供を要求したアプリケーションを識別する識別子を取得し、提供した資源と取得したアプリケーション識別子を組にしてテーブルに保持する。そして、アプリケーションが終了すると、終了したアプリケーションのアプリケーション識別子を取得し、取得した識別子に対応する資源をテーブルから特定し、特定した資源を解放する。また、メモリ領域を獲得したプログラムからの解放通知によらず、時間監視により自動的にメモリ領域を解放する技術がある。 In addition, there is a technique for collecting resources that become unnecessary due to the termination of an application. For example, when the application execution device provides a resource in response to a request for providing a resource from the application, the identifier for identifying the application that requested the provision of the resource is acquired, and the provided resource and the acquired application identifier are combined. And keep it in the table. When the application is terminated, the application identifier of the terminated application is acquired, the resource corresponding to the acquired identifier is specified from the table, and the specified resource is released. In addition, there is a technique for automatically releasing a memory area by time monitoring without using a release notification from a program that has acquired the memory area.
しかしながら、上述した従来技術では、ソフトウェアが強制終了したときには、ソフトウェアに割り当てられたメモリ内の記憶領域を解放することができない場合がある。このため、例えば、解放していないメモリ内の記憶領域が増大して、メモリ内の空き領域が不足してしまうことがある。 However, in the above-described conventional technology, when the software is forcibly terminated, the storage area in the memory allocated to the software may not be released. For this reason, for example, the storage area in the memory that has not been released may increase, and the free area in the memory may become insufficient.
1つの側面では、本発明は、強制終了したソフトウェアに割り当てられたメモリ内の記憶領域を解放することを目的とする。 In one aspect, the present invention aims to free storage in memory allocated to software that has been killed.
本発明の一側面によれば、メモリ内の記憶領域のうちのソフトウェアからの割当要求に応じてソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、ソフトウェアの識別子を記憶する記憶部から、メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得し、実行中のソフトウェアの中に、取得した識別子により識別されるソフトウェアがあるか否かを判定し、識別子により識別されるソフトウェアがないと判定した場合、いずれかの使用領域を解放する制御方法、制御装置、制御プログラム、および記録媒体が提案される。 According to one aspect of the present invention, from a storage unit that stores a software identifier in association with a use area assigned as a storage area used by software in response to an assignment request from software among storage areas in a memory. The software identifier corresponding to one of the used areas in the memory is acquired, and it is determined whether there is software identified by the acquired identifier in the running software, and the software identified by the identifier When it is determined that there is no data, a control method, a control device, a control program, and a recording medium for releasing any used area are proposed.
本発明の一態様によれば、強制終了したソフトウェアに割り当てられたメモリ内の記憶領域を解放することができるという効果を奏する。 According to one aspect of the present invention, there is an effect that a storage area in a memory allocated to software that has been forcibly terminated can be released.
以下に添付図面を参照して、本発明にかかる制御方法、制御装置、制御プログラム、および記録媒体の実施の形態を詳細に説明する。 Exemplary embodiments of a control method, a control device, a control program, and a recording medium according to the present invention will be described below in detail with reference to the accompanying drawings.
(制御装置100のヒープメモリ制御の一例)
図1は、実施の形態にかかる制御装置100のヒープメモリ制御の一例を示す説明図である。制御装置100は、既に実行終了したソフトウェアによって確保されたままのヒープメモリM内のメモリブロックを解放するコンピュータである。
(Example of heap memory control of the control device 100)
FIG. 1 is an explanatory diagram of an example of heap memory control of the
ここで、ソフトウェアとは、規定された処理を制御装置100に実行させる命令コードであって、例えば、タスクであってもよいし、プロセスであってもよいし、スレッドであってもよい。実行終了したソフトウェアとは、例えば、規定された処理を実行終了したソフトウェアであってもよいし、killコマンドによって強制終了したソフトウェアであってもよいし、バグによって強制終了したソフトウェアであってもよい。
Here, the software is an instruction code that causes the
換言すれば、実行終了したソフトウェアとは、例えば、実行中のソフトウェアの中にないソフトウェアである。実行中のソフトウェアとは、例えば、制御装置100がマルチタスク方式であれば、タイムスライスの割り当てを待つ待機中のソフトウェアを含む。
In other words, the execution-completed software is, for example, software that is not included in the running software. The running software includes, for example, waiting software waiting for time slice assignment if the
ヒープメモリMとは、例えば、ソフトウェアによって使用される記憶領域である。メモリブロックとは、例えば、ヒープメモリM内の一区切りの記憶領域であって、ヘッダ情報を有する。ヒープメモリM内のヘッダ情報とは、例えば、メモリブロックの属性を示す情報である。 The heap memory M is a storage area used by software, for example. The memory block is, for example, a segmented storage area in the heap memory M and has header information. The header information in the heap memory M is information indicating the attribute of the memory block, for example.
確保とは、例えば、ヒープメモリM内のメモリブロックを、ソフトウェアが使用する記憶領域として割り当てることである。解放とは、例えば、ソフトウェアが使用する記憶領域として割り当てたメモリブロックを、特定のソフトウェアが使用する記憶領域として割り当てられていない状態に戻すことである。以下の説明では、特定のソフトウェアが使用する記憶領域として割り当てられていない状態のメモリブロックを「空きメモリブロック」と表記する場合がある。 “Securing” means, for example, allocating a memory block in the heap memory M as a storage area used by software. Release means, for example, that a memory block allocated as a storage area used by software is returned to a state where it is not allocated as a storage area used by specific software. In the following description, a memory block that is not allocated as a storage area used by specific software may be referred to as a “free memory block”.
図1の例では、制御装置100は、ヒープメモリMを有する。また、制御装置100は、ソフトウェアT1〜T3を実行している。また、制御装置100は、ヒープメモリM内のメモリブロックM1〜M3は、各々、ソフトウェアT1〜T3によって確保されている。また、制御装置100は、ソフトウェアT1〜T3の各々のソフトウェアの識別子を、ソフトウェアT1〜T3の各々のソフトウェアによって確保されたメモリブロックと対応付けて記憶する記憶部101を有する。
In the example of FIG. 1, the
ここで、実行中のソフトウェアT3がバグによって強制終了した場合を例に挙げて、ソフトウェアT3によって確保されたままのメモリブロックを制御装置100が解放する動作の一例について説明する。
Here, an example of the operation in which the
図1において、(1)制御装置100は、記憶部101を参照して、いずれかのソフトウェアによって確保されたままのメモリブロックM1〜M3を特定する。(2)制御装置100は、特定したメモリブロックM1〜M3を確保したままのソフトウェアT1〜T3の各々のソフトウェアが、実行中のソフトウェアの中にあるか否かを判定する。(3)制御装置100は、実行中のソフトウェアの中にないと判定したソフトウェアによって確保されたままのメモリブロックを解放する。以下の説明では、実行中のソフトウェアの中にないと判定したソフトウェアによって確保されたままのメモリブロックを「異常メモリブロック」と表記する場合がある。
In FIG. 1, (1) the
図1の例では、制御装置100は、具体的には、記憶部101を参照して、メモリブロックM1を確保したままのソフトウェアT1を特定する。次に、制御装置100は、特定したソフトウェアT1が、実行中のソフトウェアの中にあるか否かを判定する。そして、制御装置100は、ソフトウェアT1が実行中のソフトウェアの中にあると判定して、ソフトウェアT1によって確保されたままのメモリブロックM1を解放しない。
In the example of FIG. 1, specifically, the
また、制御装置100は、具体的には、記憶部101を参照して、メモリブロックM3を確保したままのソフトウェアT3を特定する。次に、制御装置100は、特定したソフトウェアT3が、実行中のソフトウェアの中にあるか否かを判定する。そして、制御装置100は、ソフトウェアT3が実行中のソフトウェアの中にないと判定して、ソフトウェアT3によって確保されたままのメモリブロックM3を解放する。
Specifically, the
これにより、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックを解放することができる。したがって、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックが増大してヒープメモリMのメモリブロックが不足(枯渇)することを防止することができる。メモリブロックの不足とは、ヒープメモリM内にソフトウェアに割り当てるべきサイズのメモリブロックがなくなることである。
As a result, the
換言すれば、制御装置100は、メモリリークを防止することができる。結果として、制御装置100は、ソフトウェアに割り当てるヒープメモリM内のメモリブロックが不足することを防止し、ソフトウェアを正常に実行することができる。
In other words, the
一方で、制御装置100は、実行中のソフトウェアによって確保されたままのメモリブロックを解放しない。したがって、制御装置100は、実行中のソフトウェアが使用しているメモリブロックを解放して実行中のソフトウェアに不具合が発生することを防止することができる。結果として、制御装置100は、ソフトウェアを正常に実行することができる。
On the other hand, the
図1の例では、制御装置100は、マルチタスク方式であったが、これに限らない。例えば、制御装置100は、シングルタスク方式であってもよい。
In the example of FIG. 1, the
(制御装置100のハードウェア構成例)
図2は、制御装置100のハードウェア構成例を示すブロック図である。図2において、制御装置100は、CPU(Central Processing Unit)201と、ROM(Read Only Memory)202と、RAM(Random Access Memory)203と、磁気ディスクドライブ(Hard Disk Drive)204と、磁気ディスク205と、光ディスクドライブ206と、光ディスク207と、ディスプレイ208と、インターフェース(I/F:Interface)209と、キーボード210と、マウス211と、スキャナ212と、プリンタ213と、を備えている。また、各構成部はバス200によってそれぞれ接続されている。
(Hardware configuration example of control device 100)
FIG. 2 is a block diagram illustrating a hardware configuration example of the
ここで、CPU201は、制御装置100の全体の制御を司る。ROM202は、ブートプログラムなどのプログラムを記憶している。RAM203は、CPU201のワークエリアとして使用される。RAM203は、例えば、ヒープメモリMになる。磁気ディスクドライブ204は、CPU201の制御にしたがって磁気ディスク205に対するデータのリード/ライトを制御する。磁気ディスク205は、磁気ディスクドライブ204の制御で書き込まれたデータを記憶する。
Here, the
光ディスクドライブ206は、CPU201の制御にしたがって光ディスク207に対するデータのリード/ライトを制御する。光ディスク207は、光ディスクドライブ206の制御で書き込まれたデータを記憶したり、光ディスク207に記憶されたデータをコンピュータに読み取らせたりする。
The
ディスプレイ208は、カーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する。このディスプレイ208は、例えば、液晶ディスプレイ、プラズマディスプレイなどを採用することができる。
The
I/F209は、通信回線を通じてLAN(Local Area Network)、WAN(Wide Area Network)、インターネットなどのネットワーク214に接続され、このネットワーク214を介して他の装置に接続される。そして、I/F209は、ネットワーク214と内部のインターフェースを司り、外部装置からのデータの入出力を制御する。I/F209には、例えば、モデムやLANアダプタなどを採用することができる。
The I /
キーボード210は、文字、数字、各種指示などの入力のためのキーを備え、データの入力をおこなう。また、タッチパネル式の入力パッドやテンキーなどであってもよい。マウス211は、カーソルの移動や範囲選択、あるいはウィンドウの移動やサイズの変更などをおこなう。ポインティングデバイスとして同様に機能を備えるものであれば、トラックボールやジョイスティックなどであってもよい。
The
スキャナ212は、画像を光学的に読み取り、制御装置100内に画像データを取り込む。なお、スキャナ212は、OCR(Optical Character Reader)機能を持たせてもよい。また、プリンタ213は、画像データや文書データを印刷する。プリンタ213には、例えば、レーザプリンタやインクジェットプリンタを採用することができる。なお、光ディスクドライブ206、光ディスク207、ディスプレイ208、キーボード210、マウス211、スキャナ212、およびプリンタ213の少なくともいずれか1つは、なくてもよい。
The
(ヒープメモリMのデータ構造の一例)
図3は、ヒープメモリMのデータ構造の一例を示す説明図である。
(Example of data structure of heap memory M)
FIG. 3 is an explanatory diagram showing an example of the data structure of the heap memory M.
図3に示すように、ヒープメモリMは、ヒープメモリM全体の管理情報を記憶するヒープメモリヘッダ301と、ソフトウェアに割り当てるメモリブロックと、メモリブロックの管理情報を記憶するメモリブロックヘッダ302と、を含む。
As shown in FIG. 3, the heap memory M includes a
ヒープメモリヘッダ301は、size、magic、occupied、myid、next、およびprev、のフィールドを有し、各フィールドに情報を設定することによりヒープメモリM全体の管理情報を記憶する。
The
sizeには、ヘッダのByte数が記憶される。magicには、マジックナンバーが記憶される。マジックナンバーとは、例えば、ヒープメモリMの形式を識別する識別子である。occupiedには、ヒープメモリMが使用中であるか否かを示す情報が記憶される。myidには、ヒープメモリヘッダに固有の識別子が記憶される。nextには、複数のメモリブロックのうちで先頭にあるメモリブロックの管理情報を記憶するメモリブロックヘッダへのポインタが記憶される。prevには、複数のメモリブロックのうちで末尾にあるメモリブロックの管理情報を記憶するメモリブロックヘッダへのポインタが記憶される。 In size, the number of bytes in the header is stored. In magic, a magic number is stored. The magic number is an identifier for identifying the format of the heap memory M, for example. Occupied stores information indicating whether or not the heap memory M is in use. In myid, an identifier unique to the heap memory header is stored. In next, a pointer to a memory block header that stores management information of the first memory block among the plurality of memory blocks is stored. The prev stores a pointer to a memory block header that stores management information of the memory block at the end of the plurality of memory blocks.
メモリブロックヘッダ302は、size、magic、occupied、myid、next、およびprev、のフィールドを有し、各フィールドに情報を設定することによりメモリブロックの管理情報を記憶する。
The
sizeには、メモリブロックのByte数が記憶される。magicには、マジックナンバーが記憶される。occupiedには、メモリブロックが使用中であるか否かを示す情報が記憶される。myidには、メモリブロックを確保したソフトウェアの識別子が記憶される。ソフトウェアの識別子とは、例えば、タスクIDやプロセスID、タスクIDとタスクがメモリブロックを確保した時点を示す時点情報を結合したデータ、または結合したデータをハッシュ関数に代入することにより得られるハッシュ値である。nextには、複数のメモリブロックのうちで1つ後ろにあるメモリブロックの管理情報を記憶するメモリブロックヘッダへのポインタが記憶される。prevには、複数のメモリブロックのうちで1つ前にあるメモリブロックの管理情報を記憶するメモリブロックヘッダへのポインタが記憶される。 The number of bytes of the memory block is stored in size. In magic, a magic number is stored. Occupied stores information indicating whether or not the memory block is in use. In myid, an identifier of the software that secures the memory block is stored. The software identifier is, for example, a task ID or process ID, data obtained by combining task ID and time information indicating the time when the task secures a memory block, or a hash value obtained by substituting the combined data into a hash function It is. Next stores a pointer to a memory block header that stores management information of the memory block that is one behind among the plurality of memory blocks. The prev stores a pointer to a memory block header that stores management information of the memory block immediately preceding among the plurality of memory blocks.
(時間情報管理テーブル400のデータ構造の一例)
図4は、時間情報管理テーブル400のデータ構造の一例を示す説明図である。
(Example of data structure of time information management table 400)
FIG. 4 is an explanatory diagram showing an example of the data structure of the time information management table 400.
図4に示すように、時間情報管理テーブル400は、timeのフィールドを含む。timeには、ソフトウェアがメモリブロックを確保した最新の時点を示す時点情報が記憶される。時点を示す時点情報とは、例えば、年月日をハッシュ関数に代入することにより得られるハッシュ値である。 As shown in FIG. 4, the time information management table 400 includes a time field. In time, time information indicating the latest time when the software secures the memory block is stored. The point-in-time information indicating the point in time is, for example, a hash value obtained by substituting the date into a hash function.
図4の例では、時間情報管理テーブル400のレコードの先頭からの番号が、ソフトウェアの識別子に対応する。換言すれば、先頭から1番目のレコードは、ソフトウェアの識別子「1」に対応し、ソフトウェアの識別子「1」により識別されるソフトウェアがメモリブロックを確保した最新の時点を示す時点情報を記憶する。このため、時間情報管理テーブル400は、識別子最大値の分のレコードを有する。 In the example of FIG. 4, the number from the beginning of the record of the time information management table 400 corresponds to the identifier of the software. In other words, the first record from the beginning corresponds to the software identifier “1” and stores time point information indicating the latest time point when the software identified by the software identifier “1” secures the memory block. Therefore, the time information management table 400 has records for the maximum identifier value.
このように、制御装置100は、ソフトウェアの識別子に対応付けてソフトウェアがメモリブロックを確保した最新の時点を示す時点情報を記憶する。これにより、制御装置100は、既に実行終了したソフトウェアの識別子を使い回した場合に、同一の識別子を持つ複数のソフトウェアによってメモリブロックが確保されたとしても対応することができる。
As described above, the
制御装置100は、例えば、或る識別子により識別される第1のソフトウェアによって第1のメモリブロックが確保された場合、第1のメモリブロックに第1のメモリブロックが確保された時点を示す第1の時点情報を対応付けて記憶する。さらに、制御装置100は、或る識別子と、第1の時点情報とを対応付けて記憶する。
For example, when the first memory block is secured by the first software identified by a certain identifier, the
また、制御装置100は、第1のソフトウェアが強制終了した後、或る識別子を第2のソフトウェアに割り振ったとする。そして、制御装置100は、或る識別子により識別される第2のソフトウェアによって第2のメモリブロックが確保された場合、第2のメモリブロックに、第2のメモリブロックが確保された時点を示す第2の時点情報を対応付けて記憶する。さらに、制御装置100は、或る識別子と、第2の時点情報とを対応付けて記憶する。
Further, it is assumed that the
ここで、制御装置100は、第1のメモリブロックが異常メモリブロックであるか否かを判定する。制御装置100は、第1のメモリブロックに対応する第1の時点情報が、或る識別子に対応する第1の時点情報および第2の時点情報の中で最新の時点情報であるか否かを判定する。
Here, the
これにより、制御装置100は、第1のメモリブロックを確保したソフトウェアが、現在或る識別子の割り振られている第2のソフトウェアではなく、過去に或る識別子が割り振られていたソフトウェアであると判定する。したがって、制御装置100は、第1のメモリブロックを確保したソフトウェアが既に実行終了しているとして、第1のメモリブロックを異常メモリブロックと判定することができる。
As a result, the
ここでは、制御装置100は、或る識別子と対応付けて第1の時点情報と第2の時点情報とを両方記憶したが、これに限らない。例えば、制御装置100は、或る識別子と対応付けて最新の時点情報を記憶してもよい。これにより、制御装置100は、時点情報の記憶に使用する記憶領域のサイズを低減することができる。
Here, the
(制御装置100の機能的構成例)
次に、図5を用いて、制御装置100の機能的構成例について説明する。
(Functional configuration example of the control device 100)
Next, a functional configuration example of the
図5は、制御装置100の機能的構成例を示すブロック図である。制御装置100は、記憶部101と、実行部501と、更新部502と、計時部503と、取得部504と、判定部505と、制御部506と、を含む。
FIG. 5 is a block diagram illustrating a functional configuration example of the
記憶部101と、実行部501と、更新部502と、計時部503と、取得部504と、判定部505と、制御部506とは、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをCPU201に実行させることにより、または、I/F209により、その機能を実現する。
The
記憶部101は、メモリ内の記憶領域のうちのソフトウェアからの割当要求に応じてソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、ソフトウェアの識別子を記憶する。記憶部101は、例えば、メモリブロックヘッダのmyidのフィールドを用いて、メモリブロックと対応付けてソフトウェアの識別子を記憶する。記憶部101は、ソフトウェアからの割当要求に応じてソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、ソフトウェアの識別子と、ソフトウェアが使用する記憶領域として使用領域を割り当てた時点を示す時点情報と、を記憶してもよい。
The
また、記憶部101は、ソフトウェアの識別子と、ソフトウェアからの割当要求に応じてソフトウェアが使用する記憶領域として使用領域を割り当てた時点を示す時点情報と、を対応付けて記憶する。記憶部101は、例えば、時間情報管理テーブル400を用いて、ソフトウェアの識別子と、ソフトウェアの識別子が示すソフトウェアがメモリブロックを確保した時点を示す時点情報と、を対応付けて記憶する。
In addition, the
実行部501は、OSやソフトウェアを実行する。実行部501は、例えば、OSを実行して、ヒープメモリMの初期化要求を発行する。また、実行部501は、例えば、ソフトウェアを実行して、malloc関数を実行することにより、メモリブロックの確保要求を発行する。また、実行部501は、例えば、ソフトウェアを実行して、free関数を実行することにより、メモリブロックの解放要求を発行する。実行結果は、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。これにより、実行部501は、確保処理や解放処理などのトリガを発生させることができる。
The
更新部502は、ヒープメモリMを更新する。更新部502は、例えば、実行部501によって発行された初期化要求を検出して、ヒープメモリMの初期化処理を実行してヒープメモリMを初期化する。また、更新部502は、例えば、実行部501によって発行されたヒープメモリMの確保要求を検出して、ヒープメモリMの確保処理を実行して、OSを介してヒープメモリM内のメモリブロックをソフトウェアに割り当てる。また、更新部502は、例えば、実行部501によって発行されたヒープメモリMの解放要求を検出して、ヒープメモリMの解放処理を実行して、OSを介してヒープメモリM内のメモリブロックを解放する。
The
また、更新部502は、ソフトウェアからの割当要求があった場合、記憶部101に、割当要求された使用領域と対応付けて、ソフトウェアの識別子を記憶する。更新部502は、例えば、実行部501によって発行されたヒープメモリMの確保要求を検出して、実行部501によって実行されて確保要求を発行したソフトウェアにメモリブロックを割り当てる。そして、更新部502は、メモリブロックヘッダのmyidのフィールドにソフトウェアの識別子を記憶する。また、更新部502は、メモリブロックヘッダのmyidのフィールドに、ソフトウェアの識別子と、ソフトウェアがメモリブロックを確保した時点を示す時点情報と、を記憶してもよい。
In addition, when there is an allocation request from software, the
また、更新部502は、ソフトウェアからの割当要求があった場合、記憶部101にソフトウェアの識別子に対応する時点情報が記憶されているか否かを判定する。そして、更新部502は、記憶されていれば、当該時点情報の代わりに、割当要求に応じてソフトウェアが使用する記憶領域として使用領域を割り当てた時点を示す時点情報を記憶する。更新部502は、例えば、実行部501によって発行されたヒープメモリMの確保要求を検出して、時間情報管理テーブル400において実行部501によって実行されて確保要求を発行したソフトウェアの識別子に対応する時点情報を、最新の時点情報に更新する。
Further, when there is an allocation request from software, the
また、更新部502は、ソフトウェアからのソフトウェアが使用する記憶領域として割り当てた使用領域の解放要求があった場合、解放要求から特定される使用領域に対応するソフトウェアの識別子を記憶部101から削除する。更新部502は、例えば、実行部501によって発行されたヒープメモリMの解放要求を検出して、解放要求されたメモリブロックのメモリブロックヘッダから、実行部501によって実行されて解放要求を発行したソフトウェアの識別子を削除する。
Also, when there is a use area release request assigned as a storage area used by software from the software, the
また、更新部502は、後述する判定部505から使用領域の更新要求があった場合、更新要求から特定される使用領域に対応するソフトウェアの識別子を記憶部101から削除してもよい。更新部502は、例えば、判定部505からのヒープメモリMの更新要求を検出して、更新要求されたメモリブロックのメモリブロックヘッダから、ソフトウェアの識別子を削除する。これにより、更新部502は、ヒープメモリヘッダやヒープメモリMやメモリブロックヘッダや時間情報管理テーブルを、最新の状態に更新することができる。
In addition, when there is a use area update request from the
計時部503は、一定時間ごとに判定要求を発行する。これにより、計時部503は、判定処理のトリガを発生させることができる。取得部504は、計時部503からの判定要求を検出し、実行部501からの確保要求を検出し、実行部501からの解放要求を検出し、または判定部505からの更新要求を検出した場合、以下に示す処理を実行する。
The
取得部504は、記憶部101から、メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得する。取得部504は、例えば、いずれかのメモリブロックのメモリブロックヘッダのmyidのフィールドから、ソフトウェアの識別子を取得する。また、取得部504は、記憶部101から、いずれかの使用領域を割り当てた時点を示す時点情報を取得してもよい。取得部504は、例えば、いずれかのメモリブロックのメモリブロックヘッダのmyidのフィールドから、ソフトウェアの識別子とともに、ソフトウェアがメモリブロックを確保した時点を示す時点情報を取得してもよい。取得したデータは、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。これにより、取得部504は、判定部505による判定処理に用いるデータを取得することができる。
The
判定部505は、実行中のソフトウェアの中に、取得した識別子により識別されるソフトウェアがあるか否かを判定する。判定部505は、例えば、取得したソフトウェアの識別子を用いて、ソフトウェアの状態を検出して、ソフトウェアがIdle状態である場合に、実行中のソフトウェアの中に取得した識別子により識別されるソフトウェアがないと判定する。
The
また、判定部505は、取得した識別子により識別されるソフトウェアがあると判定した場合、記憶部101を参照して、取得した時点情報が、取得した識別子に対応する最新の時点情報と一致するか否かを判定してもよい。判定部505は、例えば、取得した識別子により識別されるソフトウェアがあると判定した場合、時間情報管理テーブル400を参照して、取得した時点情報が、取得した識別子に対応する最新の時点情報と一致するか否かを判定してもよい。
If the
判定部505は、識別子により識別されるソフトウェアがないと判定した場合、および、取得した時点情報が最新の時点情報と一致しないと判定した場合、いずれかの使用領域の解放要求と更新要求とを発行する。判定結果は、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。これにより、判定部505は、メモリブロックが異常メモリブロックであるか否かを判定することができる。
If the
制御部506は、識別子により識別されるソフトウェアがないと判定した場合、いずれかの使用領域を解放する。また、制御部506は、取得した時点情報が最新の時点情報と一致しないと判定した場合、いずれかの使用領域を解放してもよい。制御部506は、例えば、判定部505からの解放要求を検出して、解放要求されたメモリブロックを解放する。また、制御部506は、ソフトウェアからの割当要求を検出して、ソフトウェアに使用領域を割り当ててもよい。これにより、制御部506は、既に実行終了したソフトウェアによって確保されたままのメモリブロックを解放することができる。
When the
(制御装置100によるヒープメモリ制御の具体例)
次に、図6〜図15を用いて、制御装置100によるヒープメモリ制御の具体例について説明する。
(Specific example of heap memory control by the control device 100)
Next, a specific example of heap memory control by the
図6は、制御装置100によるヒープメモリ制御の流れを示す説明図である。図6に示すように、制御装置100は、ソフトウェアAと、ソフトウェアBと、制御プログラムと、OSとを実行する。
FIG. 6 is an explanatory diagram showing a flow of heap memory control by the
図6の例では、OSは、一定時間ごとに判定要求を発行する。また、制御プログラムは、OSから発行された判定要求を検出して、上述した取得部504、判定部505、および制御部506の処理を実行する。
In the example of FIG. 6, the OS issues a determination request at regular time intervals. Further, the control program detects a determination request issued from the OS, and executes the processes of the
(1)ソフトウェアAは、例えば、制御装置100の利用者からの操作を受けて実行される。ここで、ソフトウェアAは、malloc関数を実行し、OSを介して、メモリブロックを確保する。このとき、制御プログラムは、ソフトウェアAの識別子を、確保したメモリブロックのメモリブロックヘッダのmyidのフィールドに記憶する。
(1) The software A is executed in response to an operation from a user of the
(2)ソフトウェアBは、ソフトウェアAを中断させて、ソフトウェアAから切り替わって実行される。また、制御プログラムは、OSから発行された判定要求を検出して、ソフトウェアBを中断させて、ソフトウェアBから切り替わって実行される。 (2) Software B is executed after software A is interrupted and switched from software A. The control program detects a determination request issued from the OS, interrupts the software B, and is executed after switching from the software B.
ソフトウェアBは、制御プログラムが終了すると、制御プログラムから切り替わって実行される。ここで、ソフトウェアBは、malloc関数を実行し、OSを介して、メモリブロックを確保する。このとき、制御プログラムは、ソフトウェアBの識別子を、確保したメモリブロックのメモリブロックヘッダのmyidのフィールドに記憶する。 When the control program ends, the software B is switched from the control program and executed. Here, the software B executes a malloc function and secures a memory block via the OS. At this time, the control program stores the identifier of the software B in the myid field of the memory block header of the secured memory block.
(3)ソフトウェアAは、ソフトウェアBを中断させて、ソフトウェアBから切り替わって実行される。また、制御プログラムは、OSから発行された判定要求を検出して、ソフトウェアAを中断させて、ソフトウェアAから切り替わって実行される。 (3) Software A is executed after software B is interrupted and switched from software B. Further, the control program detects a determination request issued from the OS, interrupts the software A, and is executed after switching from the software A.
ソフトウェアAは、制御プログラムが終了すると、制御プログラムから切り替わって実行される。ソフトウェアAは、free関数を実行し、OSを介して、メモリブロックを解放する。このとき、制御プログラムは、ソフトウェアAの識別子を、解放したメモリブロックのメモリブロックヘッダのmyidのフィールドから削除する。ソフトウェアAは、実行終了したとする。 When the control program ends, the software A is switched from the control program and executed. Software A executes the free function and releases the memory block via the OS. At this time, the control program deletes the identifier of software A from the myid field of the memory block header of the released memory block. Assume that software A has finished executing.
ソフトウェアBは、ソフトウェアAが実行終了したため、ソフトウェアAから切り替わって実行される。ここで、ソフトウェアBは、バグによって強制終了したとする。このため、ソフトウェアBによってメモリブロックは確保されたままになる。 Software B is switched from software A and executed because software A has finished executing. Here, it is assumed that software B is forcibly terminated due to a bug. For this reason, the memory block remains secured by the software B.
(4)制御プログラムは、OSから発行された判定要求を検出して、実行される。制御プログラムは、ソフトウェアによって確保されたままのメモリブロックのメモリブロックヘッダのmyidのフィールドから、ソフトウェアの識別子を取得する。 (4) The control program is executed by detecting a determination request issued from the OS. The control program acquires the identifier of the software from the myid field of the memory block header of the memory block assured by the software.
次に、制御プログラムは、実行中のソフトウェアの中に、取得した識別子により識別されるソフトウェアBがあるか否かを判定する。ここで、制御プログラムは、実行中のソフトウェアの中に、ソフトウェアBがないため、メモリブロックを異常メモリブロックであると判定して、メモリブロックを解放する。 Next, the control program determines whether there is software B identified by the acquired identifier in the software being executed. Here, since there is no software B in the software being executed, the control program determines that the memory block is an abnormal memory block and releases the memory block.
これにより、制御プログラムは、既に実行終了したソフトウェアによって確保されたままのメモリブロックを解放することができる。したがって、制御プログラムは、既に実行終了したソフトウェアによって確保されたままのメモリブロックが増大してヒープメモリMのメモリブロックが不足することを防止することができる。結果として、制御プログラムは、ソフトウェアに割り当てるヒープメモリM内のメモリブロックが不足することを防止し、ソフトウェアを正常に実行することができる。 Thereby, the control program can release the memory block that has been secured by the software that has already been executed. Therefore, the control program can prevent a memory block that has been secured by software that has already been executed from increasing and a memory block of the heap memory M from becoming insufficient. As a result, the control program can prevent the memory block in the heap memory M to be allocated to the software from being insufficient, and can execute the software normally.
図7は、制御装置100の初期化処理におけるヒープメモリMの更新内容を示す説明図である。図7において、制御装置100は、ヒープメモリMを初期化する。ここで、図7は、図6の初期状態に対応する。
FIG. 7 is an explanatory diagram showing the update contents of the heap memory M in the initialization process of the
図7に示すように、制御装置100は、ヒープメモリヘッダ701を作成し、ヒープメモリMを1つのメモリブロックとして扱い、先頭にメモリブロックヘッダ702を作成する。
As shown in FIG. 7, the
制御装置100は、作成したメモリブロックヘッダ702のsizeのフィールドに、メモリブロックのサイズを示す10000Byteを設定する。ここで、メモリブロックのサイズは、例えば、ヒープメモリMのサイズを示す10000Byteからメモリブロックヘッダ702のサイズを減算した結果である。しかしながら、以下の説明では、簡単のため、メモリブロックヘッダ702のサイズを0Byteとして扱うこととする。
The
制御装置100は、作成したメモリブロックヘッダ702のoccupiedのフィールドに、未使用であることを示す0を設定する。制御装置100は、作成したメモリブロックヘッダ702のmyidのフィールドに、まだソフトウェアに割り当てられていない空きメモリブロックであることを示す0x0を設定する。
The
制御装置100は、作成したメモリブロックヘッダ702のnextのフィールドに、ヒープメモリヘッダ701の先頭アドレスを設定する。制御装置100は、作成したメモリブロックヘッダ702のprevのフィールドに、ヒープメモリヘッダ701の先頭アドレスを設定する。
The
制御装置100は、ヒープメモリヘッダ701のnextに、作成したメモリブロックヘッダ702の先頭アドレスを記憶する。制御装置100は、ヒープメモリヘッダ701のprevに、作成したメモリブロックヘッダ702の先頭アドレスを記憶する。これにより、制御装置100は、ヒープメモリMを初期化することができる。
The
図8は、制御装置100の確保処理におけるヒープメモリMの更新内容を示す説明図である。図8において、制御装置100は、ソフトウェアAに100Byteのメモリブロックを割り当てる。ここで、図8に示すヒープメモリMは、図6の(1)においてソフトウェアAにメモリブロックを割り当てた状態に対応する。
FIG. 8 is an explanatory diagram showing the update contents of the heap memory M in the securing process of the
図8に示すように、制御装置100は、先頭のメモリブロックヘッダ702に続く100Byteの記憶領域を、メモリブロックとしてソフトウェアAに割り当てて、残りの9900Byteのメモリブロックの先頭にメモリブロックヘッダ801を作成する。
As shown in FIG. 8, the
制御装置100は、先頭のメモリブロックヘッダ702のsizeのフィールドに、ソフトウェアAに割り当てたメモリブロックの記憶領域のサイズを示す100Byteを設定する。制御装置100は、先頭のメモリブロックヘッダ702のoccupiedのフィールドに、使用中であることを示す1を設定する。
The
制御装置100は、先頭のメモリブロックヘッダ702のmyidのフィールドに、ソフトウェアAの識別子と、ソフトウェアAにメモリブロックを割り当てた時点と、を示す0x00010303を設定する。
The
制御装置100は、先頭のメモリブロックヘッダ702のnextのフィールドに、作成したメモリブロックヘッダ801の先頭アドレスを設定する。制御装置100は、先頭のメモリブロックヘッダ702のprevのフィールドに、ヒープメモリヘッダ701の先頭アドレスを設定する。
The
制御装置100は、作成したメモリブロックヘッダ801のsizeのフィールドに、メモリブロックのサイズを示す9900Byteを設定する。制御装置100は、作成したメモリブロックヘッダ801のoccupiedのフィールドに、未使用であることを示す0を設定する。制御装置100は、作成したメモリブロックヘッダ801のmyidのフィールドに、まだソフトウェアに割り当てられていない空きメモリブロックであることを示す0x0を設定する。
The
制御装置100は、作成したメモリブロックヘッダ801のnextのフィールドに、ヒープメモリヘッダ701の先頭アドレスを設定する。制御装置100は、作成したメモリブロックヘッダ801のprevのフィールドに、メモリブロックヘッダ702の先頭アドレスを設定する。制御装置100は、ヒープメモリヘッダ701のprevを、作成したメモリブロックヘッダ801の先頭アドレスに更新する。これにより、制御装置100は、ソフトウェアAにメモリブロックを割り当てることができる。結果として、制御装置100は、ソフトウェアAの処理のために使用するワークエリアとしてメモリブロックを使用して、ソフトウェアAを実行することができる。
The
図9は、制御装置100の確保処理における時間情報管理テーブル400の更新内容を示す説明図である。図9において、制御装置100は、ソフトウェアAに100Byteのメモリブロックを割り当てたとき、時間情報管理テーブル400を更新する。ここで、図9は、図6の(1)においてソフトウェアAにメモリブロックを割り当てたときに時間情報管理テーブル400を更新する場合に対応する。
FIG. 9 is an explanatory diagram showing the update contents of the time information management table 400 in the securing process of the
制御装置100は、ソフトウェアAの識別子が1であるため、時間情報管理テーブル400の1番目のレコードにソフトウェアAにメモリブロックを割り当てた時点を示す時点情報0x0303を記憶する。これにより、制御装置100は、ソフトウェアAと対応付けて、ソフトウェアAにメモリブロックを割り当てた最新の時点を示す時点情報を記憶しておくことができる。
Since the identifier of software A is 1, the
また、制御装置100は、図8および図9と同様にして、ソフトウェアBに100Byteのメモリブロックを割り当て、時間情報管理テーブル400を更新したとする。ここで、図8および図9と同様にして、ソフトウェアBに100Byteのメモリブロックを割り当てることは、図6の(2)においてソフトウェアBにメモリブロックを割り当てる場合に対応する。これにより、制御装置100は、ソフトウェアBにメモリブロックを割り当てることができる。結果として、制御装置100は、ソフトウェアBの処理のために使用するワークエリアとしてメモリブロックを使用してソフトウェアBを実行することができる。また、制御装置100は、ソフトウェアBと対応付けて、ソフトウェアBにメモリブロックを割り当てた最新の時点を示す時点情報を記憶しておくことができる。
Also, assume that the
図10は、制御装置100のソフトウェアAからの解放要求に基づく解放処理におけるヒープメモリMの更新内容を示す説明図である。図10において、制御装置100は、ソフトウェアAに割り当てたメモリブロックを解放する。ここで、図10は、図6の(3)においてソフトウェアAに割り当てたメモリブロックを解放する場合に対応する。
FIG. 10 is an explanatory diagram showing the update contents of the heap memory M in the release process based on the release request from the software A of the
図10に示すように、制御装置100は、先頭のメモリブロックヘッダ702に続く100ByteのソフトウェアAに割り当てたメモリブロックを解放する。
As shown in FIG. 10, the
ここで、制御装置100は、メモリブロックヘッダ702のprevとのフィールドを参照して、メモリブロックヘッダ702の前にあるメモリブロックヘッダが使用中であるか否かを判定する。制御装置100は、前にあるメモリブロックヘッダが使用中でないと判定した場合は、前にあるメモリブロックヘッダに、メモリブロックヘッダ702を結合する。
Here, the
また、制御装置100は、メモリブロックヘッダ702のnextのフィールドを参照して、メモリブロックヘッダ702の後ろにあるメモリブロックヘッダが使用中であるか否かを判定する。制御装置100は、後ろにあるメモリブロックヘッダが使用中でないと判定した場合は、後ろにあるメモリブロックヘッダを、メモリブロックヘッダ702に結合する。図10の例では、制御装置100は、メモリブロックヘッダ702の後ろにあるメモリブロックヘッダ801が使用中であるため、メモリブロックヘッダ801を結合しない。
Also, the
制御装置100は、先頭のメモリブロックヘッダ702のsizeのフィールドに、100Byteを設定する。制御装置100は、先頭のメモリブロックヘッダ702のoccupiedのフィールドに、未使用であることを示す0を設定する。制御装置100は、先頭のメモリブロックヘッダ702のmyidのフィールドから、ソフトウェアAの識別子と、ソフトウェアAにメモリブロックを割り当てた時点と、を示す0x00010303を削除する。これにより、制御装置100は、ヒープメモリMに空きメモリブロックを増加させることができ、ヒープメモリMが不足することを防止することができる。
The
図11は、制御装置100のソフトウェアAからの解放要求に基づく解放処理における時間情報管理テーブル400の更新内容を示す説明図である。図11において、制御装置100は、ソフトウェアAに割り当てたメモリブロックを解放するとき、時間情報管理テーブル400を更新する。ここで、図11は、図6の(3)においてソフトウェアAに割り当てたメモリブロックを解放したときに時間情報管理テーブル400を更新する場合に対応する。制御装置100は、ソフトウェアAの識別子が1であるため、時間情報管理テーブル400の1番目のレコードを初期化して、0x0000を記憶する。これにより、制御装置100は、時間情報管理テーブル400を更新することができる。
FIG. 11 is an explanatory diagram showing the update contents of the time information management table 400 in the release process based on the release request from the software A of the
図12は、制御装置100の判定処理に基づく解放処理におけるヒープメモリMの更新内容を示す説明図である。図12において、制御装置100は、ソフトウェアBに割り当てたメモリブロックを解放する。ここで、図12は、図6の(4)においてソフトウェアBに割り当てたメモリブロックを解放する場合に対応する。
FIG. 12 is an explanatory diagram showing the update contents of the heap memory M in the release process based on the determination process of the
図12に示すように、制御装置100は、順次、メモリブロックヘッダのmyidのフィールドの内容を取得する。制御装置100は、例えば、メモリブロックヘッダ801のmyidのフィールドの内容を取得し、取得した内容のうちのソフトウェアBの識別子と、ソフトウェアBにメモリブロックを割り当てた時点を示す時点情報と、を取得する。
As shown in FIG. 12, the
次に、制御装置100は、取得したソフトウェアBの識別子を用いて、実行中のソフトウェアの中に、ソフトウェアBがあるか否かを判定する。ここで、制御装置100は、実行中のソフトウェアの中に、ソフトウェアBがないため、ソフトウェアBに割り当てたメモリブロックを解放する。メモリブロックを解放する処理については、図10に示した処理と同様のため、説明を省略する。
Next, using the acquired identifier of software B,
また、制御装置100は、実行中のソフトウェアの中に、ソフトウェアBがある場合、取得した時点情報が示す時点と、時間情報管理テーブル400の2番目のレコードの時点情報が示す時点と、が一致するか否かを判定する。ここで、制御装置100は、時点が一致しない場合、ソフトウェアBに割り当てたメモリブロックを解放する。メモリブロックを解放する処理については、図10に示した処理と同様のため、説明を省略する。
In addition, when the software B is included in the software being executed, the
一方で、制御装置100は、取得した時点情報が示す時点と、時間情報管理テーブル400の2番目のレコードの時点情報が示す時点と、が一致する場合、ソフトウェアBに割り当てたメモリブロックを解放しない。
On the other hand, when the time point indicated by the acquired time point information matches the time point indicated by the time point information of the second record of the time information management table 400, the
図13は、図12におけるヒープメモリMの更新結果を示す説明図である。制御装置100は、図12の処理を実行することにより、図13に示すようにヒープメモリMを更新する。これにより、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックを解放することができる。したがって、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックが増大してヒープメモリMのメモリブロックが不足することを防止することができる。結果として、制御装置100は、ソフトウェアに割り当てるヒープメモリM内のメモリブロックが不足することを防止し、ソフトウェアを正常に実行することができる。
FIG. 13 is an explanatory diagram showing a result of updating the heap memory M in FIG. The
一方で、制御装置100は、実行中のソフトウェアによって確保されたままのメモリブロックを解放しない。したがって、制御装置100は、実行中のソフトウェアが使用しているメモリブロックを解放して実行中のソフトウェアに不具合が発生することを防止することができる。結果として、制御装置100は、ソフトウェアを正常に実行することができる。
On the other hand, the
図14は、制御装置100の判定処理に基づく解放処理における時間情報管理テーブル400の更新内容を示す説明図である。図14において、制御装置100は、ソフトウェアBに割り当てたメモリブロックを解放するとき、時間情報管理テーブル400を更新する。ここで、図14は、図6の(4)においてソフトウェアBに割り当てたメモリブロックを解放したときに時間情報管理テーブル400を更新する場合に対応する。制御装置100は、ソフトウェアBの識別子が1であるため、時間情報管理テーブル400の2番目のレコードを初期化して、0x0000を記憶する。
FIG. 14 is an explanatory diagram showing the update contents of the time information management table 400 in the release process based on the determination process of the
図15は、図14における時間情報管理テーブル400の更新結果を示す説明図である。制御装置100は、図14の処理を実行することにより、図15に示すように時間情報管理テーブル400を更新する。これにより、制御装置100は、時間情報管理テーブル400を更新することができる。
FIG. 15 is an explanatory diagram showing the update result of the time information management table 400 in FIG. The
(制御装置100の制御処理手順の一例)
次に、図16を用いて、制御装置100の制御処理手順の一例について説明する。
(Example of control processing procedure of control device 100)
Next, an example of a control processing procedure of the
図16は、制御装置100の制御処理手順の一例を示すシーケンス図である。図16において、実行部501は、OSを読み込んでOSを実行して制御装置100を起動する(ステップS1601)。次に、実行部501は、更新部502に、初期化処理要求を送信する(ステップS1602)。更新部502は、初期化処理要求を検出して、初期化処理を実行する(ステップS1603)。ここで、更新部502は、初期化処理を終了すると、実行部501に応答を送信する。
FIG. 16 is a sequence diagram illustrating an example of a control processing procedure of the
実行部501は、ソフトウェアを実行する(ステップS1604)。実行部501は、ソフトウェア内のmalloc関数を実行することにより、更新部502および制御部506に、確保要求を送信する(ステップS1605)。更新部502および制御部506は、確保処理を実行する(ステップS1606)。ここで、更新部502および制御部506は、確保処理を終了すると、実行部501に応答を送信する。
The
また、ここで、実行部501が実行するソフトウェアが強制終了したとする。計時部503は、時間管理処理を実行する(ステップS1607)。計時部503は、時間管理処理を実行することにより、更新部502、取得部504、判定部505、および制御部506は、判定要求を送信する。
Here, it is assumed that the software executed by the
更新部502、取得部504、判定部505、および制御部506は、判定要求を検出すると、判定処理を実行する(ステップS1608)。ここで、更新部502、取得部504、判定部505、および制御部506は、判定処理を終了すると、計時部503に応答を送信する。
When the
これにより、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックを解放することができる。したがって、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックが増大してヒープメモリMのメモリブロックが不足することを防止することができる。結果として、制御装置100は、ソフトウェアに割り当てるヒープメモリM内のメモリブロックが不足することを防止し、ソフトウェアを正常に実行することができる。
As a result, the
一方で、制御装置100は、実行中のソフトウェアによって確保されたままのメモリブロックを解放しない。したがって、制御装置100は、実行中のソフトウェアが使用しているメモリブロックを解放して実行中のソフトウェアに不具合が発生することを防止することができる。結果として、制御装置100は、ソフトウェアを正常に実行することができる。
On the other hand, the
(制御装置100の初期化処理手順の一例)
次に、図17を用いて、制御装置100の初期化処理手順の一例について説明する。
(Example of initialization processing procedure of control device 100)
Next, an example of an initialization process procedure of the
図17は、制御装置100の初期化処理手順の一例を示すフローチャートである。図17において、制御装置100は、ヒープメモリMの先頭アドレスを取得する(ステップS1701)。次に、制御装置100は、メモリブロックヘッダを作成して、取得した先頭アドレスに基づいて、メモリブロックヘッダの各フィールドに情報を設定する(ステップS1702)。そして、制御装置100は、メモリブロックヘッダを作成して、メモリブロックヘッダの各フィールドに情報を設定する(ステップS1703)。これにより、制御装置100は、ヒープメモリMを初期化することができる。
FIG. 17 is a flowchart illustrating an example of the initialization processing procedure of the
(制御装置100の確保処理手順の一例)
次に、図18を用いて、制御装置100の確保処理手順の一例について説明する。
(Example of secure processing procedure of control device 100)
Next, an example of the securing process procedure of the
図18は、制御装置100の確保処理手順の一例を示すフローチャートである。図18において、制御装置100は、全てのメモリブロックを選択したか否かを判定する(ステップS1801)。ここで、全てのメモリブロックを選択していない場合(ステップS1801:No)、制御装置100は、ヒープメモリヘッダおよびメモリブロックヘッダを参照して、メモリブロックを選択する(ステップS1802)。
FIG. 18 is a flowchart illustrating an example of a securing process procedure of the
次に、制御装置100は、選択したメモリブロックが、未使用であって、確保要求されたサイズ以上であるか否かを判定する(ステップS1803)。ここで、制御装置100は、未使用ではない場合、または確保要求されたサイズ未満である場合(ステップS1803:No)、制御装置100は、ステップS1801の処理に戻る。
Next, the
一方で、未使用であって、確保要求されたサイズ以上である場合(ステップS1803:Yes)、制御装置100は、確保要求を発行したソフトウェアの識別子と、確保した時点を示す時点情報と、を含むデータを生成する(ステップS1804)。次に、制御装置100は、選択したメモリブロックの先頭アドレスに、確保要求されたサイズ分のアドレスを加算して、加算したアドレスから後ろの領域を空きメモリブロックとして設定する(ステップS1805)。
On the other hand, if it is unused and is not less than the size requested for securing (step S1803: Yes), the
そして、制御装置100は、ヒープメモリヘッダおよびメモリブロックヘッダを更新する(ステップS1806)。次に、選択したメモリブロックのメモリブロックヘッダのsizeのフィールドに、確保したメモリブロックのサイズを設定し、occupiedのフィールドに、使用中を示す1を設定する(ステップS1807)。
Then, the
そして、制御装置100は、選択したメモリブロックのメモリブロックヘッダのmyidのフィールドに、生成したデータを設定する(ステップS1808)。次に、制御装置100は、確保した時点を示す時点情報を、時間情報管理テーブル400に設定する(ステップS1809)。
Then, the
次に、制御装置100は、選択したメモリブロックの先頭アドレスへのポインタを実行部501に送信する(ステップS1810)。そして、制御装置100は、確保処理を終了する。
Next, the
また、ステップS1801において、全てのメモリブロックを選択した場合(ステップS1801:Yes)、制御装置100は、メモリブロックを確保できなかったとして、NULLポインタを実行部501に送信する(ステップS1811)。そして、制御装置100は、確保処理を終了する。これにより、制御装置100は、ソフトウェアにメモリブロックを割り当てることができる。結果として、制御装置100は、ソフトウェアの処理のために使用するワークエリアとしてメモリブロックを使用して、ソフトウェアを実行することができる。
If all the memory blocks are selected in step S1801 (step S1801: Yes), the
(制御装置100の時間管理処理手順の一例)
次に、図19を用いて、制御装置100の時間管理処理手順の一例について説明する。
(Example of time management processing procedure of the control device 100)
Next, an example of a time management processing procedure of the
図19は、制御装置100の時間管理処理手順の一例を示すフローチャートである。図19において、制御装置100は、所定時間が経過したか否かを判定する(ステップS1901)。ここで、所定時間が経過していない場合(ステップS1901:No)、制御装置100は、時間管理処理を終了する。
FIG. 19 is a flowchart illustrating an example of a time management processing procedure of the
一方で、所定時間が経過した場合(ステップS1901:Yes)、制御装置100は、判定要求を発行する(ステップS1902)。次に、制御部506は、所定時間の計時を初めからやり直す(ステップS1903)。そして、制御部506は、時間管理処理を終了する。これにより、制御装置100は、一定時間ごとに、判定要求を発行することができる。
On the other hand, when the predetermined time has elapsed (step S1901: Yes), the
(制御装置100の判定処理手順の一例)
次に、図20を用いて、制御装置100の判定処理手順の一例について説明する。
(Example of determination processing procedure of control device 100)
Next, an example of the determination processing procedure of the
図20は、制御装置100の判定処理手順の一例を示すフローチャートである。図20において、制御装置100は、全てのメモリブロックを選択したか否かを判定する(ステップS2001)。ここで、全てのメモリブロックを選択していない場合(ステップS2001:No)、制御装置100は、ヒープメモリヘッダおよびメモリブロックヘッダを参照して、メモリブロックを選択する(ステップS2002)。
FIG. 20 is a flowchart illustrating an example of the determination processing procedure of the
次に、制御装置100は、選択したメモリブロックが、使用中であるか否かを判定する(ステップS2003)。ここで、制御装置100は、使用中ではない場合(ステップS2003:No)、制御装置100は、ステップS2001の処理に戻る。
Next, the
一方で、使用中である場合(ステップS2003:Yes)、制御装置100は、選択したメモリブロックのメモリブロックヘッダのmyidのフィールドから、選択したメモリブロックを確保したソフトウェアの識別子と、確保した時点を示す時点情報と、を含むデータを取得する(ステップS2004)。次に、制御装置100は、時間情報管理テーブル400から、取得したデータに含まれるソフトウェアの識別子により識別されるソフトウェアがメモリブロックを確保した最新の時点を示す時点情報を取得する(ステップS2005)。
On the other hand, if it is in use (step S2003: Yes), the
そして、制御装置100は、取得したデータに含まれる時点情報が示す時点と、取得した最新の時点を示す時点情報が示す最新の時点と、が一致するか否かを判定する(ステップS2006)。ここで、一致しない場合(ステップS2006:No)、制御装置100は、ステップS2001の処理に戻る。
Then, the
一方で、一致する場合(ステップS2006:Yes)、制御装置100は、ソフトウェアの識別子から、ソフトウェアの状態を特定する(ステップS2007)。次に、制御装置100は、ソフトウェアの状態がアイドル状態か否かを判定する(ステップS2008)。ここで、アイドル状態ではない場合(ステップS2008:No)、制御装置100は、ステップS2001の処理に戻る。一方で、アイドル状態である場合(ステップS2008:Yes)、制御装置100は、解放処理を実行して(ステップS2009)、ステップS2001の処理に戻る。
On the other hand, when it corresponds (step S2006: Yes), the
また、ステップS2001において、全てのメモリブロックを選択した場合(ステップS2001:Yes)、制御装置100は、解放するメモリブロックがないとして、判定処理を終了する。これにより、制御装置100は、ソフトウェアに割り当てられたメモリブロックが異常メモリブロックであるか否かを判定することができる。
If all the memory blocks are selected in step S2001 (step S2001: Yes), the
(制御装置100の解放処理手順の一例)
次に、図21を用いて、制御装置100の解放処理手順の一例について説明する。
(Example of release processing procedure of control device 100)
Next, an example of a release process procedure of the
図21は、制御装置100の解放処理手順の一例を示すフローチャートである。図21において、制御装置100は、選択したメモリブロックの前にあるメモリブロックが未使用であるか否かを判定する(ステップS2101)。ここで、制御装置100は、未使用ではない場合(ステップS2101:No)、ステップS2103の処理に移行する。
FIG. 21 is a flowchart illustrating an example of a release processing procedure of the
一方で、未使用である場合(ステップS2101:Yes)、制御装置100は、選択したメモリブロックを、選択したメモリブロックの前にあるメモリブロックに結合する(ステップS2102)。
On the other hand, when it is unused (step S2101: Yes), the
次に、制御装置100は、選択したメモリブロックの後ろにあるメモリブロックが未使用であるか否かを判定する(ステップS2103)。ここで、制御装置100は、未使用ではない場合(ステップS2103:No)、ステップS2105の処理に移行する。
Next, the
一方で、未使用である場合(ステップS2103:Yes)、制御装置100は、選択したメモリブロックに、選択したメモリブロックの後ろにあるメモリブロックを結合する(ステップS2104)。
On the other hand, when unused (step S2103: Yes), the
次に、制御装置100は、選択したメモリブロック、または結合したメモリブロックのメモリブロックヘッダに情報を設定して、未使用のメモリブロックに設定する(ステップS2105)。そして、制御装置100は、選択したメモリブロック、または結合したメモリブロックの内容をクリアする(ステップS2106)。次に、制御装置100は、ヒープメモリヘッダに情報を設定する(ステップS2107)。そして、制御装置100は、解放処理を終了する。これにより、制御装置100は、異常メモリブロックを解放することができる。
Next, the
以上説明したように、制御装置100によれば、ソフトウェアに確保されたメモリブロックについて、実行中のソフトウェアの中に当該ソフトウェアがなければ、異常メモリブロックであると判定することができる。これにより、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックを解放することができる。
As described above, according to the
したがって、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックが増大してヒープメモリMのメモリブロックが不足することを防止することができる。結果として、制御装置100は、ソフトウェアに割り当てるヒープメモリM内のメモリブロックが不足することを防止し、ソフトウェアを正常に実行することができる。また、制御装置100は、ヒープメモリM内の空きメモリブロックを纏めることができ、使用中のメモリブロックを探索する効率を向上させることができる。
Therefore, the
ここで、例えば、ソフトウェアの実行開始から所定時間が経過したときに自動的にメモリブロックを解放することが考えられる。しかしながら、この場合、所定時間が経過したときにソフトウェアがまだ実行中であると、ソフトウェアが使用中のメモリブロックを解放して、ソフトウェアが異常動作してしまうことがある。一方で、制御装置100は、実行中のソフトウェアによって確保されたままのメモリブロックを解放しない。したがって、制御装置100は、実行中のソフトウェアが使用しているメモリブロックを解放して実行中のソフトウェアに不具合が発生することを防止することができる。結果として、制御装置100は、ソフトウェアを正常に実行することができる。
Here, for example, it is conceivable to automatically release the memory block when a predetermined time has elapsed since the start of software execution. However, in this case, if the software is still being executed when the predetermined time has elapsed, the memory block being used by the software may be released and the software may malfunction. On the other hand, the
また、制御装置100によれば、メモリブロックを確保した時点を示す時点情報をメモリブロックに対応付けて記憶し、ソフトウェアの識別子とソフトウェアがメモリブロックを確保した最新の時点を示す時点情報とを対応付けて記憶することができる。これにより、制御装置100は、メモリブロックを確保した時点と、ソフトウェアがメモリブロックを確保した最新の時点とが一致するか否かを判定して、ソフトウェアの識別子が使い回しされているかを判定することができる。したがって、制御装置100は、ソフトウェアの識別子に使用するデータ量を低減することができる。
Further, according to the
なお、本実施の形態で説明した制御方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本制御プログラムは、ハードディスク、フレキシブルディスク、CD−ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本制御プログラムは、インターネット等のネットワークを介して配布してもよい。 The control method described in this embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. This control program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, an MO, and a DVD, and is executed by being read from the recording medium by the computer. The control program may be distributed via a network such as the Internet.
上述した実施の形態に関し、さらに以下の付記を開示する。 The following additional notes are disclosed with respect to the embodiment described above.
(付記1)コンピュータが、
メモリ内の記憶領域のうちのソフトウェアからの割当要求に応じて前記ソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、前記ソフトウェアの識別子を記憶する記憶部から、前記メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得し、
実行中のソフトウェアの中に、取得した前記識別子により識別されるソフトウェアがあるか否かを判定し、
前記識別子により識別されるソフトウェアがないと判定した場合、前記いずれかの使用領域を解放する、
処理を実行することを特徴とする制御方法。
(Supplementary note 1)
One of the storage areas in the memory from the storage unit that stores the identifier of the software in association with the use area allocated as the storage area used by the software in response to an allocation request from the software in the storage area in the memory Get the software identifier corresponding to the used area of
It is determined whether there is software identified by the acquired identifier among the software being executed,
When it is determined that there is no software identified by the identifier, the one of the used areas is released.
A control method characterized by executing processing.
(付記2)前記コンピュータが、
前記ソフトウェアからの前記ソフトウェアが使用する記憶領域として割り当てた使用領域の解放要求があった場合、前記解放要求から特定される使用領域に対応する前記ソフトウェアの識別子を前記記憶部から削除する処理を実行することを特徴とする付記1に記載の制御方法。
(Appendix 2) The computer
When there is a request for releasing a use area allocated as a storage area used by the software from the software, a process of deleting the identifier of the software corresponding to the use area specified from the release request is executed from the storage unit The control method according to
(付記3)前記記憶部は、前記ソフトウェアからの割当要求に応じて前記ソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、前記ソフトウェアの識別子と、前記ソフトウェアが使用する記憶領域として使用領域を割り当てた時点を示す時点情報と、を記憶し、
前記取得する処理は、
前記記憶部から、前記いずれかの使用領域に対応するソフトウェアの識別子と、前記いずれかの使用領域を割り当てた時点を示す時点情報と、を取得し、
前記判定する処理は、
実行中のソフトウェアの中に、取得した前記識別子により識別されるソフトウェアがあるか否かを判定し、取得した前記識別子により識別されるソフトウェアがあると判定した場合、前記ソフトウェアの識別子と、前記ソフトウェアからの割当要求に応じて前記ソフトウェアが使用する記憶領域として使用領域を割り当てた時点を示す時点情報と、を対応付けて記憶する第2の記憶部を参照して、取得した前記時点情報が、取得した前記識別子に対応する最新の時点情報と一致するか否かを判定し、
前記解放する処理は、
取得した前記時点情報が前記最新の時点情報と一致しないと判定した場合、前記いずれかの使用領域を解放することを特徴とする付記1または2に記載の制御方法。
(Supplementary Note 3) The storage unit is used as an identifier of the software and a storage area used by the software in association with a use area assigned as a storage area used by the software in response to an allocation request from the software. Storing time point information indicating a time point when the area is allocated,
The process to obtain is
From the storage unit, obtain an identifier of software corresponding to any one of the used areas, and time information indicating a time when any of the used areas are allocated,
The determination process is as follows:
When it is determined whether there is software identified by the acquired identifier among the software being executed, and when it is determined that there is software identified by the acquired identifier, the software identifier and the software With reference to the second storage unit that stores the time point information indicating the time point when the use area is assigned as the storage area used by the software in response to the assignment request from the second storage unit, the acquired time point information is It is determined whether or not it matches the latest point-in-time information corresponding to the acquired identifier,
The releasing process is
The control method according to
(付記4)前記コンピュータが、
前記ソフトウェアからの割当要求があった場合、前記第2の記憶部に前記ソフトウェアの識別子に対応する時点情報が記憶されていれば、当該時点情報の代わりに、前記割当要求に応じて前記ソフトウェアが使用する記憶領域として使用領域を割り当てた時点を示す時点情報を記憶する処理を実行することを特徴とする付記3に記載の制御方法。
(Appendix 4) The computer
When there is an allocation request from the software, if the time information corresponding to the identifier of the software is stored in the second storage unit, the software responds to the allocation request instead of the time information. The control method according to
(付記5)メモリ内の記憶領域のうちのソフトウェアからの割当要求に応じて前記ソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、前記ソフトウェアの識別子を記憶する記憶部と、
前記記憶部から、前記メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得する取得部と、
実行中のソフトウェアの中に、前記取得部によって取得された前記識別子により識別されるソフトウェアがあるか否かを判定する判定部と、
前記判定部によって前記識別子により識別されるソフトウェアがないと判定された場合、前記いずれかの使用領域を解放する制御部と、
を有することを特徴とする制御装置。
(Supplementary Note 5) A storage unit that stores an identifier of the software in association with a use area assigned as a storage area used by the software in response to an assignment request from software among storage areas in the memory;
An acquisition unit that acquires an identifier of software corresponding to any use area in the memory from the storage unit;
A determination unit that determines whether there is software identified by the identifier acquired by the acquisition unit in the software being executed;
When it is determined by the determination unit that there is no software identified by the identifier, a control unit that releases any of the used areas;
A control device comprising:
(付記6)コンピュータに、
メモリ内の記憶領域のうちのソフトウェアからの割当要求に応じて前記ソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、前記ソフトウェアの識別子を記憶する記憶部から、前記メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得し、
実行中のソフトウェアの中に、取得した前記識別子により識別されるソフトウェアがあるか否かを判定し、
前記識別子により識別されるソフトウェアがないと判定した場合、前記いずれかの使用領域を解放する、
処理を実行させることを特徴とする制御プログラム。
(Appendix 6)
One of the storage areas in the memory from the storage unit that stores the identifier of the software in association with the use area allocated as the storage area used by the software in response to an allocation request from the software in the storage area in the memory Get the software identifier corresponding to the used area of
It is determined whether there is software identified by the acquired identifier among the software being executed,
When it is determined that there is no software identified by the identifier, the one of the used areas is released.
A control program characterized by causing a process to be executed.
(付記7)コンピュータに、
メモリ内の記憶領域のうちのソフトウェアからの割当要求に応じて前記ソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、前記ソフトウェアの識別子を記憶する記憶部から、前記メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得し、
実行中のソフトウェアの中に、取得した前記識別子により識別されるソフトウェアがあるか否かを判定し、
前記識別子により識別されるソフトウェアがないと判定した場合、前記いずれかの使用領域を解放する、
処理を実行させることを特徴とする制御プログラムを記録したコンピュータに読み取り可能な記録媒体。
(Appendix 7)
One of the storage areas in the memory from the storage unit that stores the identifier of the software in association with the use area allocated as the storage area used by the software in response to an allocation request from the software in the storage area in the memory Get the software identifier corresponding to the used area of
It is determined whether there is software identified by the acquired identifier among the software being executed,
When it is determined that there is no software identified by the identifier, the one of the used areas is released.
A computer-readable recording medium having recorded thereon a control program characterized by executing the processing.
100 制御装置
501 実行部
502 更新部
503 計時部
504 取得部
505 判定部
506 制御部
DESCRIPTION OF
Claims (6)
メモリ内の記憶領域のうちのソフトウェアからの割当要求に応じて前記ソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、前記ソフトウェアの識別子を記憶する記憶部から、前記メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得し、
実行中のソフトウェアの中に、取得した前記識別子により識別されるソフトウェアがあるか否かを判定し、
前記識別子により識別されるソフトウェアがないと判定した場合、前記いずれかの使用領域を解放する、
処理を実行することを特徴とする制御方法。 Computer
One of the storage areas in the memory from the storage unit that stores the identifier of the software in association with the use area allocated as the storage area used by the software in response to an allocation request from the software in the storage area in the memory Get the software identifier corresponding to the used area of
It is determined whether there is software identified by the acquired identifier among the software being executed,
When it is determined that there is no software identified by the identifier, the one of the used areas is released.
A control method characterized by executing processing.
前記ソフトウェアからの前記ソフトウェアが使用する記憶領域として割り当てた使用領域の解放要求があった場合、前記解放要求から特定される使用領域に対応する前記ソフトウェアの識別子を前記記憶部から削除する処理を実行することを特徴とする請求項1に記載の制御方法。 The computer is
When there is a request for releasing a use area allocated as a storage area used by the software from the software, a process of deleting the identifier of the software corresponding to the use area specified from the release request is executed from the storage unit The control method according to claim 1, wherein:
前記取得する処理は、
前記記憶部から、前記いずれかの使用領域に対応するソフトウェアの識別子と、前記いずれかの使用領域を割り当てた時点を示す時点情報と、を取得し、
前記判定する処理は、
実行中のソフトウェアの中に、取得した前記識別子により識別されるソフトウェアがあるか否かを判定し、取得した前記識別子により識別されるソフトウェアがあると判定した場合、前記ソフトウェアの識別子と、前記ソフトウェアからの割当要求に応じて前記ソフトウェアが使用する記憶領域として使用領域を割り当てた時点を示す時点情報と、を対応付けて記憶する第2の記憶部を参照して、取得した前記時点情報が、取得した前記識別子に対応する最新の時点情報と一致するか否かを判定し、
前記解放する処理は、
取得した前記時点情報が前記最新の時点情報と一致しないと判定した場合、前記いずれかの使用領域を解放することを特徴とする請求項1または2に記載の制御方法。 In response to an allocation request from the software, the storage unit allocates the software identifier and the use area as the storage area used by the software in association with the use area assigned as the storage area used by the software. Time point information indicating the time point,
The process to obtain is
From the storage unit, obtain an identifier of software corresponding to any one of the used areas, and time information indicating a time when any of the used areas are allocated,
The determination process is as follows:
When it is determined whether there is software identified by the acquired identifier among the software being executed, and when it is determined that there is software identified by the acquired identifier, the software identifier and the software With reference to the second storage unit that stores the time point information indicating the time point when the use area is assigned as the storage area used by the software in response to the assignment request from the second storage unit, the acquired time point information is It is determined whether or not it matches the latest point-in-time information corresponding to the acquired identifier,
The releasing process is
3. The control method according to claim 1, wherein, when it is determined that the acquired time point information does not match the latest time point information, the one of the used areas is released.
前記記憶部から、前記メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得する取得部と、
実行中のソフトウェアの中に、前記取得部によって取得された前記識別子により識別されるソフトウェアがあるか否かを判定する判定部と、
前記判定部によって前記識別子により識別されるソフトウェアがないと判定された場合、前記いずれかの使用領域を解放する制御部と、
を有することを特徴とする制御装置。 A storage unit for storing an identifier of the software in association with a use area assigned as a storage area used by the software in response to an assignment request from software among storage areas in the memory;
An acquisition unit that acquires an identifier of software corresponding to any use area in the memory from the storage unit;
A determination unit that determines whether there is software identified by the identifier acquired by the acquisition unit in the software being executed;
When it is determined by the determination unit that there is no software identified by the identifier, a control unit that releases any of the used areas;
A control device comprising:
メモリ内の記憶領域のうちのソフトウェアからの割当要求に応じて前記ソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、前記ソフトウェアの識別子を記憶する記憶部から、前記メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得し、
実行中のソフトウェアの中に、取得した前記識別子により識別されるソフトウェアがあるか否かを判定し、
前記識別子により識別されるソフトウェアがないと判定した場合、前記いずれかの使用領域を解放する、
処理を実行させることを特徴とする制御プログラム。 On the computer,
One of the storage areas in the memory from the storage unit that stores the identifier of the software in association with the use area allocated as the storage area used by the software in response to an allocation request from the software in the storage area in the memory Get the software identifier corresponding to the used area of
It is determined whether there is software identified by the acquired identifier among the software being executed,
When it is determined that there is no software identified by the identifier, the one of the used areas is released.
A control program characterized by causing a process to be executed.
メモリ内の記憶領域のうちのソフトウェアからの割当要求に応じて前記ソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、前記ソフトウェアの識別子を記憶する記憶部から、前記メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得し、
実行中のソフトウェアの中に、取得した前記識別子により識別されるソフトウェアがあるか否かを判定し、
前記識別子により識別されるソフトウェアがないと判定した場合、前記いずれかの使用領域を解放する、
処理を実行させることを特徴とする制御プログラムを記録したコンピュータに読み取り可能な記録媒体。 On the computer,
One of the storage areas in the memory from the storage unit that stores the identifier of the software in association with the use area allocated as the storage area used by the software in response to an allocation request from the software in the storage area in the memory Get the software identifier corresponding to the used area of
It is determined whether there is software identified by the acquired identifier among the software being executed,
When it is determined that there is no software identified by the identifier, the one of the used areas is released.
A computer-readable recording medium having recorded thereon a control program characterized by executing the processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013084247A JP6163844B2 (en) | 2013-04-12 | 2013-04-12 | Control method, control device, control program, and recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013084247A JP6163844B2 (en) | 2013-04-12 | 2013-04-12 | Control method, control device, control program, and recording medium |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014206871A true JP2014206871A (en) | 2014-10-30 |
JP6163844B2 JP6163844B2 (en) | 2017-07-19 |
Family
ID=52120371
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013084247A Expired - Fee Related JP6163844B2 (en) | 2013-04-12 | 2013-04-12 | Control method, control device, control program, and recording medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6163844B2 (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0520168A (en) * | 1991-07-12 | 1993-01-29 | Chubu Nippon Denki Software Kk | Memory managing method |
JPH10269133A (en) * | 1997-03-25 | 1998-10-09 | Hitachi Ltd | Memory release omission inspecting system for computer system |
JP2002259146A (en) * | 2000-05-15 | 2002-09-13 | Matsushita Electric Ind Co Ltd | Device and method for executing application |
JP2005047086A (en) * | 2003-07-31 | 2005-02-24 | Kyocera Mita Corp | Device and method for memory management, program, and printer device |
JP2006127463A (en) * | 2004-09-29 | 2006-05-18 | Sony Corp | Information processing device, memory area management method, and computer program |
JP2009181466A (en) * | 2008-01-31 | 2009-08-13 | Canon Inc | Semiconductor exposure apparatus, control method, and computer program |
-
2013
- 2013-04-12 JP JP2013084247A patent/JP6163844B2/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0520168A (en) * | 1991-07-12 | 1993-01-29 | Chubu Nippon Denki Software Kk | Memory managing method |
JPH10269133A (en) * | 1997-03-25 | 1998-10-09 | Hitachi Ltd | Memory release omission inspecting system for computer system |
JP2002259146A (en) * | 2000-05-15 | 2002-09-13 | Matsushita Electric Ind Co Ltd | Device and method for executing application |
JP2005047086A (en) * | 2003-07-31 | 2005-02-24 | Kyocera Mita Corp | Device and method for memory management, program, and printer device |
JP2006127463A (en) * | 2004-09-29 | 2006-05-18 | Sony Corp | Information processing device, memory area management method, and computer program |
JP2009181466A (en) * | 2008-01-31 | 2009-08-13 | Canon Inc | Semiconductor exposure apparatus, control method, and computer program |
Also Published As
Publication number | Publication date |
---|---|
JP6163844B2 (en) | 2017-07-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7716258B2 (en) | Method and system for multiprocessor garbage collection | |
JP5858151B2 (en) | Database management system, computer, database management method | |
CN110377402A (en) | Business data processing method, device, storage medium and computer equipment | |
JP2007193471A (en) | Reservation management program, reservation management device and reservation management method | |
JP2000284995A (en) | Data processor and recording medium | |
JP6246923B2 (en) | Management server, computer system and method | |
JP2007249674A (en) | Server system | |
JP2005346610A (en) | Storage system and method for acquisition and use of snapshot | |
JP5381713B2 (en) | Data storage system for virtual machine, data storage method, and data storage program | |
JP2005316635A (en) | Data processing system and method, and processing program therefor | |
JP5858308B2 (en) | Database management system, computer, database management method | |
JP6293709B2 (en) | Storage system and storage system program | |
US8671248B2 (en) | Architecture support of memory access coloring | |
JP2010061278A (en) | Management apparatus of virtual server system | |
CN104115127B (en) | Storage system and data managing method | |
US7962922B2 (en) | Delivering callbacks into secure application areas | |
JP6708007B2 (en) | Mirror packet control program, mirror packet control method, and mirror packet control device | |
JP4894567B2 (en) | Trace information output device and trace information output method | |
JP6163844B2 (en) | Control method, control device, control program, and recording medium | |
JP2006085208A (en) | Information life cycle management system and data arrangement determination method therefor | |
KR20100022171A (en) | Apparatus and method for saving log in thread oriented logging system | |
Daoud et al. | Performance analysis of distributed storage clusters based on kernel and userspace traces | |
CN103488549A (en) | Roll-back processing system and roll-back processing method for multi-mirror-image data | |
JPWO2013073029A1 (en) | Information providing apparatus, method, and program | |
JPWO2012131933A1 (en) | Information processing apparatus, program, and analysis method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160113 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20161027 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20161115 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170116 |
|
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: 20170523 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170605 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6163844 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |