JP2014206871A - Control method, control device, control program and recording medium - Google Patents

Control method, control device, control program and recording medium Download PDF

Info

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
Application number
JP2013084247A
Other languages
Japanese (ja)
Other versions
JP6163844B2 (en
Inventor
廣毅 今野
Hiroki Konno
廣毅 今野
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2013084247A priority Critical patent/JP6163844B2/en
Publication of JP2014206871A publication Critical patent/JP2014206871A/en
Application granted granted Critical
Publication of JP6163844B2 publication Critical patent/JP6163844B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To release a storage region in a memory assigned to forcedly ended software.SOLUTION: A control device 100 stores the identifiers of software T1 to T3 in association with memory blocks secured by the software of each of the software T1 to T3 in a storage part 101. The control device 100 specifies memory blocks M1 to M3 still secured by any software by referring to the storage part 101. Then, the control device 100 determines whether or not the software of each of the software T1 to T3 by which the specified memory blocks M1 to M3 are still secured exists among the software under execution. Then, the control device 100 releases the memory blocks still secured by the software determined not to exist among the software under execution.

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.

特開平11−120073号公報Japanese Patent Laid-Open No. 11-120073 特開2002−259146号公報JP 2002-259146 A 特開平3−271842号公報JP-A-3-271842

しかしながら、上述した従来技術では、ソフトウェアが強制終了したときには、ソフトウェアに割り当てられたメモリ内の記憶領域を解放することができない場合がある。このため、例えば、解放していないメモリ内の記憶領域が増大して、メモリ内の空き領域が不足してしまうことがある。   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.

図1は、実施の形態にかかる制御装置100のヒープメモリ制御の一例を示す説明図である。FIG. 1 is an explanatory diagram of an example of heap memory control of the control device 100 according to the embodiment. 図2は、制御装置100のハードウェア構成例を示すブロック図である。FIG. 2 is a block diagram illustrating a hardware configuration example of the control device 100. 図3は、ヒープメモリMのデータ構造の一例を示す説明図である。FIG. 3 is an explanatory diagram showing an example of the data structure of the heap memory M. 図4は、時間情報管理テーブル400のデータ構造の一例を示す説明図である。FIG. 4 is an explanatory diagram showing an example of the data structure of the time information management table 400. 図5は、制御装置100の機能的構成例を示すブロック図である。FIG. 5 is a block diagram illustrating a functional configuration example of the control device 100. 図6は、制御装置100によるヒープメモリ制御の流れを示す説明図である。FIG. 6 is an explanatory diagram showing a flow of heap memory control by the control device 100. 図7は、制御装置100の初期化処理におけるヒープメモリMの更新内容を示す説明図である。FIG. 7 is an explanatory diagram showing the update contents of the heap memory M in the initialization process of the control device 100. 図8は、制御装置100の確保処理におけるヒープメモリMの更新内容を示す説明図である。FIG. 8 is an explanatory diagram showing the update contents of the heap memory M in the securing process of the control device 100. 図9は、制御装置100の確保処理における時間情報管理テーブル400の更新内容を示す説明図である。FIG. 9 is an explanatory diagram showing the update contents of the time information management table 400 in the securing process of the control device 100. 図10は、制御装置100のソフトウェアAからの解放要求に基づく解放処理におけるヒープメモリMの更新内容を示す説明図である。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 control device 100. 図11は、制御装置100のソフトウェアAからの解放要求に基づく解放処理における時間情報管理テーブル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 control device 100. 図12は、制御装置100の判定処理に基づく解放処理におけるヒープメモリMの更新内容を示す説明図である。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 control device 100. 図13は、図12におけるヒープメモリMの更新結果を示す説明図である。FIG. 13 is an explanatory diagram showing a result of updating the heap memory M in FIG. 図14は、制御装置100の判定処理に基づく解放処理における時間情報管理テーブル400の更新内容を示す説明図である。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 control device 100. 図15は、図14における時間情報管理テーブル400の更新結果を示す説明図である。FIG. 15 is an explanatory diagram showing the update result of the time information management table 400 in FIG. 図16は、制御装置100の制御処理手順の一例を示すシーケンス図である。FIG. 16 is a sequence diagram illustrating an example of a control processing procedure of the control device 100. 図17は、制御装置100の初期化処理手順の一例を示すフローチャートである。FIG. 17 is a flowchart illustrating an example of the initialization processing procedure of the control device 100. 図18は、制御装置100の確保処理手順の一例を示すフローチャートである。FIG. 18 is a flowchart illustrating an example of a securing process procedure of the control device 100. 図19は、制御装置100の時間管理処理手順の一例を示すフローチャートである。FIG. 19 is a flowchart illustrating an example of a time management processing procedure of the control device 100. 図20は、制御装置100の判定処理手順の一例を示すフローチャートである。FIG. 20 is a flowchart illustrating an example of the determination processing procedure of the control device 100. 図21は、制御装置100の解放処理手順の一例を示すフローチャートである。FIG. 21 is a flowchart illustrating an example of a release processing procedure of the control device 100.

以下に添付図面を参照して、本発明にかかる制御方法、制御装置、制御プログラム、および記録媒体の実施の形態を詳細に説明する。   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 control device 100 according to the embodiment. The control device 100 is a computer that releases a memory block in the heap memory M that has been secured by software that has already been executed.

ここで、ソフトウェアとは、規定された処理を制御装置100に実行させる命令コードであって、例えば、タスクであってもよいし、プロセスであってもよいし、スレッドであってもよい。実行終了したソフトウェアとは、例えば、規定された処理を実行終了したソフトウェアであってもよいし、killコマンドによって強制終了したソフトウェアであってもよいし、バグによって強制終了したソフトウェアであってもよい。   Here, the software is an instruction code that causes the control apparatus 100 to execute a specified process, and may be a task, a process, or a thread, for example. The software whose execution has ended may be, for example, software that has ended execution of a specified process, software that has been forcibly terminated by a kill command, or software that has been forcibly terminated due to a bug. .

換言すれば、実行終了したソフトウェアとは、例えば、実行中のソフトウェアの中にないソフトウェアである。実行中のソフトウェアとは、例えば、制御装置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 control device 100 is a multitask system.

ヒープメモリ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 control device 100 has a heap memory M. In addition, the control device 100 executes software T1 to T3. Further, in the control device 100, the memory blocks M1 to M3 in the heap memory M are secured by software T1 to T3, respectively. In addition, the control device 100 includes a storage unit 101 that stores the software identifiers of the software T1 to T3 in association with the memory blocks secured by the software T1 to T3.

ここで、実行中のソフトウェアT3がバグによって強制終了した場合を例に挙げて、ソフトウェアT3によって確保されたままのメモリブロックを制御装置100が解放する動作の一例について説明する。   Here, an example of the operation in which the control device 100 releases the memory block assured by the software T3 will be described by taking as an example a case where the software T3 being executed is forcibly terminated due to a bug.

図1において、(1)制御装置100は、記憶部101を参照して、いずれかのソフトウェアによって確保されたままのメモリブロックM1〜M3を特定する。(2)制御装置100は、特定したメモリブロックM1〜M3を確保したままのソフトウェアT1〜T3の各々のソフトウェアが、実行中のソフトウェアの中にあるか否かを判定する。(3)制御装置100は、実行中のソフトウェアの中にないと判定したソフトウェアによって確保されたままのメモリブロックを解放する。以下の説明では、実行中のソフトウェアの中にないと判定したソフトウェアによって確保されたままのメモリブロックを「異常メモリブロック」と表記する場合がある。   In FIG. 1, (1) the control device 100 refers to the storage unit 101 and identifies the memory blocks M1 to M3 that are secured by any software. (2) The control device 100 determines whether or not each of the software T1 to T3 with the specified memory blocks M1 to M3 remaining is in the software being executed. (3) The control device 100 releases the memory block that has been secured by the software that is determined not to be in the running software. In the following description, a memory block secured by software that is determined not to be in the running software may be referred to as an “abnormal memory block”.

図1の例では、制御装置100は、具体的には、記憶部101を参照して、メモリブロックM1を確保したままのソフトウェアT1を特定する。次に、制御装置100は、特定したソフトウェアT1が、実行中のソフトウェアの中にあるか否かを判定する。そして、制御装置100は、ソフトウェアT1が実行中のソフトウェアの中にあると判定して、ソフトウェアT1によって確保されたままのメモリブロックM1を解放しない。   In the example of FIG. 1, specifically, the control device 100 refers to the storage unit 101 and identifies the software T1 with the memory block M1 secured. Next, the control device 100 determines whether or not the identified software T1 is in the software being executed. Then, the control device 100 determines that the software T1 is in the software being executed, and does not release the memory block M1 that has been secured by the software T1.

また、制御装置100は、具体的には、記憶部101を参照して、メモリブロックM3を確保したままのソフトウェアT3を特定する。次に、制御装置100は、特定したソフトウェアT3が、実行中のソフトウェアの中にあるか否かを判定する。そして、制御装置100は、ソフトウェアT3が実行中のソフトウェアの中にないと判定して、ソフトウェアT3によって確保されたままのメモリブロックM3を解放する。   Specifically, the control device 100 refers to the storage unit 101 and identifies the software T3 with the memory block M3 secured. Next, the control device 100 determines whether or not the identified software T3 is in the software being executed. Then, the control device 100 determines that the software T3 is not in the software being executed, and releases the memory block M3 that has been secured by the software T3.

これにより、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックを解放することができる。したがって、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックが増大してヒープメモリMのメモリブロックが不足(枯渇)することを防止することができる。メモリブロックの不足とは、ヒープメモリM内にソフトウェアに割り当てるべきサイズのメモリブロックがなくなることである。   As a result, the control device 100 can release the memory block secured by the already executed software. Therefore, the control device 100 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 being insufficient (depleted). The shortage of memory blocks means that there is no memory block in the heap memory M having a size to be allocated to software.

換言すれば、制御装置100は、メモリリークを防止することができる。結果として、制御装置100は、ソフトウェアに割り当てるヒープメモリM内のメモリブロックが不足することを防止し、ソフトウェアを正常に実行することができる。   In other words, the control device 100 can prevent a memory leak. As a result, the control device 100 can prevent the memory block in the heap memory M to be allocated to software from being insufficient, and can execute the software normally.

一方で、制御装置100は、実行中のソフトウェアによって確保されたままのメモリブロックを解放しない。したがって、制御装置100は、実行中のソフトウェアが使用しているメモリブロックを解放して実行中のソフトウェアに不具合が発生することを防止することができる。結果として、制御装置100は、ソフトウェアを正常に実行することができる。   On the other hand, the control device 100 does not release the memory block that is secured by the running software. Therefore, the control device 100 can prevent a problem occurring in the software being executed by releasing the memory block used by the software being executed. As a result, the control device 100 can execute the software normally.

図1の例では、制御装置100は、マルチタスク方式であったが、これに限らない。例えば、制御装置100は、シングルタスク方式であってもよい。   In the example of FIG. 1, the control device 100 is a multitask method, but is not limited thereto. For example, the control device 100 may be a single task method.

(制御装置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 control device 100. In FIG. 2, the control device 100 includes a CPU (Central Processing Unit) 201, a ROM (Read Only Memory) 202, a RAM (Random Access Memory) 203, a magnetic disk drive (Hard Disk Drive) 204, and a magnetic disk 205. An optical disk drive 206, an optical disk 207, a display 208, an interface (I / F: Interface) 209, a keyboard 210, a mouse 211, a scanner 212, and a printer 213. Each component is connected by a bus 200.

ここで、CPU201は、制御装置100の全体の制御を司る。ROM202は、ブートプログラムなどのプログラムを記憶している。RAM203は、CPU201のワークエリアとして使用される。RAM203は、例えば、ヒープメモリMになる。磁気ディスクドライブ204は、CPU201の制御にしたがって磁気ディスク205に対するデータのリード/ライトを制御する。磁気ディスク205は、磁気ディスクドライブ204の制御で書き込まれたデータを記憶する。   Here, the CPU 201 governs overall control of the control device 100. The ROM 202 stores a program such as a boot program. The RAM 203 is used as a work area for the CPU 201. The RAM 203 becomes, for example, a heap memory M. The magnetic disk drive 204 controls reading / writing of data with respect to the magnetic disk 205 according to the control of the CPU 201. The magnetic disk 205 stores data written under the control of the magnetic disk drive 204.

光ディスクドライブ206は、CPU201の制御にしたがって光ディスク207に対するデータのリード/ライトを制御する。光ディスク207は、光ディスクドライブ206の制御で書き込まれたデータを記憶したり、光ディスク207に記憶されたデータをコンピュータに読み取らせたりする。   The optical disk drive 206 controls reading / writing of data with respect to the optical disk 207 according to the control of the CPU 201. The optical disk 207 stores data written under the control of the optical disk drive 206, or causes the computer to read data stored on the optical disk 207.

ディスプレイ208は、カーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する。このディスプレイ208は、例えば、液晶ディスプレイ、プラズマディスプレイなどを採用することができる。   The display 208 displays data such as a document, an image, and function information as well as a cursor, an icon, or a tool box. As this display 208, for example, a liquid crystal display, a plasma display, or the like can be adopted.

I/F209は、通信回線を通じてLAN(Local Area Network)、WAN(Wide Area Network)、インターネットなどのネットワーク214に接続され、このネットワーク214を介して他の装置に接続される。そして、I/F209は、ネットワーク214と内部のインターフェースを司り、外部装置からのデータの入出力を制御する。I/F209には、例えば、モデムやLANアダプタなどを採用することができる。   The I / F 209 is connected to a network 214 such as a LAN (Local Area Network), a WAN (Wide Area Network), and the Internet through a communication line, and is connected to other devices via the network 214. The I / F 209 controls an internal interface with the network 214 and controls data input / output from an external device. For example, a modem or a LAN adapter may be employed as the I / F 209.

キーボード210は、文字、数字、各種指示などの入力のためのキーを備え、データの入力をおこなう。また、タッチパネル式の入力パッドやテンキーなどであってもよい。マウス211は、カーソルの移動や範囲選択、あるいはウィンドウの移動やサイズの変更などをおこなう。ポインティングデバイスとして同様に機能を備えるものであれば、トラックボールやジョイスティックなどであってもよい。   The keyboard 210 includes keys for inputting characters, numbers, various instructions, and the like, and inputs data. Moreover, a touch panel type input pad or a numeric keypad may be used. The mouse 211 performs cursor movement, range selection, window movement, size change, and the like. A trackball or a joystick may be used as long as they have the same function as a pointing device.

スキャナ212は、画像を光学的に読み取り、制御装置100内に画像データを取り込む。なお、スキャナ212は、OCR(Optical Character Reader)機能を持たせてもよい。また、プリンタ213は、画像データや文書データを印刷する。プリンタ213には、例えば、レーザプリンタやインクジェットプリンタを採用することができる。なお、光ディスクドライブ206、光ディスク207、ディスプレイ208、キーボード210、マウス211、スキャナ212、およびプリンタ213の少なくともいずれか1つは、なくてもよい。   The scanner 212 optically reads an image and takes in the image data into the control device 100. The scanner 212 may have an OCR (Optical Character Reader) function. The printer 213 prints image data and document data. As the printer 213, for example, a laser printer or an ink jet printer can be adopted. Note that at least one of the optical disk drive 206, the optical disk 207, the display 208, the keyboard 210, the mouse 211, the scanner 212, and the printer 213 may be omitted.

(ヒープメモリ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 heap memory header 301 that stores management information of the entire heap memory M, a memory block that is allocated to software, and a memory block header 302 that stores management information of the memory block. Including.

ヒープメモリヘッダ301は、size、magic、occupied、myid、next、およびprev、のフィールドを有し、各フィールドに情報を設定することによりヒープメモリM全体の管理情報を記憶する。   The heap memory header 301 has fields of size, magic, occupied, myid, next, and prev, and stores management information of the entire heap memory M by setting information in each field.

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 memory block header 302 has fields of “size”, “magic”, “occupied”, “myid”, “next”, and “prev”, and stores management information of the memory block by setting information in each field.

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 control device 100 stores time information indicating the latest time when the software secures the memory block in association with the software identifier. As a result, when the identifier of software that has already been executed is reused, the control device 100 can cope with the case where a memory block is secured by a plurality of software having the same identifier.

制御装置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 control device 100 indicates the first time when the first memory block is secured in the first memory block. Are stored in association with each other. Furthermore, the control device 100 stores a certain identifier and first time point information in association with each other.

また、制御装置100は、第1のソフトウェアが強制終了した後、或る識別子を第2のソフトウェアに割り振ったとする。そして、制御装置100は、或る識別子により識別される第2のソフトウェアによって第2のメモリブロックが確保された場合、第2のメモリブロックに、第2のメモリブロックが確保された時点を示す第2の時点情報を対応付けて記憶する。さらに、制御装置100は、或る識別子と、第2の時点情報とを対応付けて記憶する。   Further, it is assumed that the control apparatus 100 allocates an identifier to the second software after the first software is forcibly terminated. Then, when the second memory block is secured by the second software identified by a certain identifier, the control device 100 indicates the second time point when the second memory block is secured in the second memory block. 2 point-in-time information is stored in association with each other. Furthermore, the control device 100 stores a certain identifier in association with the second time point information.

ここで、制御装置100は、第1のメモリブロックが異常メモリブロックであるか否かを判定する。制御装置100は、第1のメモリブロックに対応する第1の時点情報が、或る識別子に対応する第1の時点情報および第2の時点情報の中で最新の時点情報であるか否かを判定する。   Here, the control device 100 determines whether or not the first memory block is an abnormal memory block. The control device 100 determines whether or not the first time point information corresponding to the first memory block is the latest time point information among the first time point information and the second time point information corresponding to a certain identifier. judge.

これにより、制御装置100は、第1のメモリブロックを確保したソフトウェアが、現在或る識別子の割り振られている第2のソフトウェアではなく、過去に或る識別子が割り振られていたソフトウェアであると判定する。したがって、制御装置100は、第1のメモリブロックを確保したソフトウェアが既に実行終了しているとして、第1のメモリブロックを異常メモリブロックと判定することができる。   As a result, the control device 100 determines that the software that secures the first memory block is not the second software to which an identifier is currently allocated but the software to which an identifier has been allocated in the past. To do. Therefore, the control apparatus 100 can determine that the first memory block is an abnormal memory block, assuming that the software that has secured the first memory block has already been executed.

ここでは、制御装置100は、或る識別子と対応付けて第1の時点情報と第2の時点情報とを両方記憶したが、これに限らない。例えば、制御装置100は、或る識別子と対応付けて最新の時点情報を記憶してもよい。これにより、制御装置100は、時点情報の記憶に使用する記憶領域のサイズを低減することができる。   Here, the control device 100 stores both the first time point information and the second time point information in association with a certain identifier, but the present invention is not limited to this. For example, the control device 100 may store the latest time point information in association with a certain identifier. Thereby, the control apparatus 100 can reduce the size of the storage area used for storing the time point information.

(制御装置100の機能的構成例)
次に、図5を用いて、制御装置100の機能的構成例について説明する。
(Functional configuration example of the control device 100)
Next, a functional configuration example of the control device 100 will be described with reference to FIG.

図5は、制御装置100の機能的構成例を示すブロック図である。制御装置100は、記憶部101と、実行部501と、更新部502と、計時部503と、取得部504と、判定部505と、制御部506と、を含む。   FIG. 5 is a block diagram illustrating a functional configuration example of the control device 100. The control device 100 includes a storage unit 101, an execution unit 501, an update unit 502, a timing unit 503, an acquisition unit 504, a determination unit 505, and a control unit 506.

記憶部101と、実行部501と、更新部502と、計時部503と、取得部504と、判定部505と、制御部506とは、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをCPU201に実行させることにより、または、I/F209により、その機能を実現する。   The storage unit 101, the execution unit 501, the update unit 502, the timing unit 503, the acquisition unit 504, the determination unit 505, and the control unit 506 are, for example, the ROM 202, the RAM 203, and the magnetic disk 205 illustrated in FIG. The function is realized by causing the CPU 201 to execute a program stored in a storage device such as the optical disk 207 or by the I / F 209.

記憶部101は、メモリ内の記憶領域のうちのソフトウェアからの割当要求に応じてソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、ソフトウェアの識別子を記憶する。記憶部101は、例えば、メモリブロックヘッダのmyidのフィールドを用いて、メモリブロックと対応付けてソフトウェアの識別子を記憶する。記憶部101は、ソフトウェアからの割当要求に応じてソフトウェアが使用する記憶領域として割り当てた使用領域と対応付けて、ソフトウェアの識別子と、ソフトウェアが使用する記憶領域として使用領域を割り当てた時点を示す時点情報と、を記憶してもよい。   The storage unit 101 stores an identifier of software in association with a use area allocated as a storage area used by software in response to an allocation request from software among storage areas in the memory. The storage unit 101 stores, for example, a software identifier in association with a memory block using a myid field of a memory block header. The storage unit 101 correlates with the use area assigned as the storage area used by the software in response to the assignment request from the software, and indicates the time point when the use area is assigned as the storage area used by the software. Information may be stored.

また、記憶部101は、ソフトウェアの識別子と、ソフトウェアからの割当要求に応じてソフトウェアが使用する記憶領域として使用領域を割り当てた時点を示す時点情報と、を対応付けて記憶する。記憶部101は、例えば、時間情報管理テーブル400を用いて、ソフトウェアの識別子と、ソフトウェアの識別子が示すソフトウェアがメモリブロックを確保した時点を示す時点情報と、を対応付けて記憶する。   In addition, the storage unit 101 stores an identifier of software and time information indicating a time point when a use area is allocated as a storage area used by software in response to an assignment request from the software. For example, using the time information management table 400, the storage unit 101 stores a software identifier and time information indicating the time when the software indicated by the software identifier secures a memory block in association with each other.

実行部501は、OSやソフトウェアを実行する。実行部501は、例えば、OSを実行して、ヒープメモリMの初期化要求を発行する。また、実行部501は、例えば、ソフトウェアを実行して、malloc関数を実行することにより、メモリブロックの確保要求を発行する。また、実行部501は、例えば、ソフトウェアを実行して、free関数を実行することにより、メモリブロックの解放要求を発行する。実行結果は、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。これにより、実行部501は、確保処理や解放処理などのトリガを発生させることができる。   The execution unit 501 executes an OS and software. For example, the execution unit 501 issues an initialization request for the heap memory M by executing the OS. Further, the execution unit 501 issues a memory block reservation request by executing software and executing a malloc function, for example. The execution unit 501 issues a memory block release request by executing software and executing a free function, for example. The execution result is stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207, for example. Thereby, the execution part 501 can generate triggers, such as a securing process and a release process.

更新部502は、ヒープメモリMを更新する。更新部502は、例えば、実行部501によって発行された初期化要求を検出して、ヒープメモリMの初期化処理を実行してヒープメモリMを初期化する。また、更新部502は、例えば、実行部501によって発行されたヒープメモリMの確保要求を検出して、ヒープメモリMの確保処理を実行して、OSを介してヒープメモリM内のメモリブロックをソフトウェアに割り当てる。また、更新部502は、例えば、実行部501によって発行されたヒープメモリMの解放要求を検出して、ヒープメモリMの解放処理を実行して、OSを介してヒープメモリM内のメモリブロックを解放する。   The update unit 502 updates the heap memory M. For example, the update unit 502 detects an initialization request issued by the execution unit 501 and executes initialization processing of the heap memory M to initialize the heap memory M. In addition, for example, the update unit 502 detects a heap memory M allocation request issued by the execution unit 501, executes a heap memory M allocation process, and stores memory blocks in the heap memory M via the OS. Assign to software. In addition, for example, the update unit 502 detects a release request for the heap memory M issued by the execution unit 501, executes a release process for the heap memory M, and sets a memory block in the heap memory M via the OS. release.

また、更新部502は、ソフトウェアからの割当要求があった場合、記憶部101に、割当要求された使用領域と対応付けて、ソフトウェアの識別子を記憶する。更新部502は、例えば、実行部501によって発行されたヒープメモリMの確保要求を検出して、実行部501によって実行されて確保要求を発行したソフトウェアにメモリブロックを割り当てる。そして、更新部502は、メモリブロックヘッダのmyidのフィールドにソフトウェアの識別子を記憶する。また、更新部502は、メモリブロックヘッダのmyidのフィールドに、ソフトウェアの識別子と、ソフトウェアがメモリブロックを確保した時点を示す時点情報と、を記憶してもよい。   In addition, when there is an allocation request from software, the update unit 502 stores an identifier of the software in the storage unit 101 in association with the use area requested for allocation. For example, the update unit 502 detects a heap memory M reservation request issued by the execution unit 501 and allocates a memory block to the software executed by the execution unit 501 and issued the reservation request. The update unit 502 stores the software identifier in the myid field of the memory block header. Further, the update unit 502 may store a software identifier and time information indicating the time when the software secures the memory block in the myid field of the memory block header.

また、更新部502は、ソフトウェアからの割当要求があった場合、記憶部101にソフトウェアの識別子に対応する時点情報が記憶されているか否かを判定する。そして、更新部502は、記憶されていれば、当該時点情報の代わりに、割当要求に応じてソフトウェアが使用する記憶領域として使用領域を割り当てた時点を示す時点情報を記憶する。更新部502は、例えば、実行部501によって発行されたヒープメモリMの確保要求を検出して、時間情報管理テーブル400において実行部501によって実行されて確保要求を発行したソフトウェアの識別子に対応する時点情報を、最新の時点情報に更新する。   Further, when there is an allocation request from software, the update unit 502 determines whether or not time information corresponding to the identifier of the software is stored in the storage unit 101. And if the update part 502 is memorize | stored, it will memorize | store the time information which shows the time point which allocated the use area | region as a storage area which software uses according to an allocation request instead of the said time point information. For example, the update unit 502 detects a heap memory M securing request issued by the execution unit 501, and the time corresponding to the identifier of the software executed by the executing unit 501 and issued the securing request in the time information management table 400 Update the information to the latest point-in-time information.

また、更新部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 update unit 502 deletes the software identifier corresponding to the use area specified from the release request from the storage unit 101. . The update unit 502 detects, for example, a release request for the heap memory M issued by the execution unit 501, and is executed by the execution unit 501 and issues a release request from the memory block header of the memory block requested for release. Delete the identifier.

また、更新部502は、後述する判定部505から使用領域の更新要求があった場合、更新要求から特定される使用領域に対応するソフトウェアの識別子を記憶部101から削除してもよい。更新部502は、例えば、判定部505からのヒープメモリMの更新要求を検出して、更新要求されたメモリブロックのメモリブロックヘッダから、ソフトウェアの識別子を削除する。これにより、更新部502は、ヒープメモリヘッダやヒープメモリMやメモリブロックヘッダや時間情報管理テーブルを、最新の状態に更新することができる。   In addition, when there is a use area update request from the determination unit 505 described later, the update unit 502 may delete the software identifier corresponding to the use area specified from the update request from the storage unit 101. For example, the update unit 502 detects an update request for the heap memory M from the determination unit 505, and deletes the software identifier from the memory block header of the memory block requested to be updated. Accordingly, the update unit 502 can update the heap memory header, the heap memory M, the memory block header, and the time information management table to the latest state.

計時部503は、一定時間ごとに判定要求を発行する。これにより、計時部503は、判定処理のトリガを発生させることができる。取得部504は、計時部503からの判定要求を検出し、実行部501からの確保要求を検出し、実行部501からの解放要求を検出し、または判定部505からの更新要求を検出した場合、以下に示す処理を実行する。   The timer unit 503 issues a determination request at regular intervals. Thereby, the time measuring part 503 can generate the trigger of a determination process. When the acquisition unit 504 detects a determination request from the timing unit 503, detects a securing request from the execution unit 501, detects a release request from the execution unit 501, or detects an update request from the determination unit 505 The following processing is executed.

取得部504は、記憶部101から、メモリ内のいずれかの使用領域に対応するソフトウェアの識別子を取得する。取得部504は、例えば、いずれかのメモリブロックのメモリブロックヘッダのmyidのフィールドから、ソフトウェアの識別子を取得する。また、取得部504は、記憶部101から、いずれかの使用領域を割り当てた時点を示す時点情報を取得してもよい。取得部504は、例えば、いずれかのメモリブロックのメモリブロックヘッダのmyidのフィールドから、ソフトウェアの識別子とともに、ソフトウェアがメモリブロックを確保した時点を示す時点情報を取得してもよい。取得したデータは、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。これにより、取得部504は、判定部505による判定処理に用いるデータを取得することができる。   The acquisition unit 504 acquires from the storage unit 101 the software identifier corresponding to one of the used areas in the memory. For example, the acquisition unit 504 acquires a software identifier from the myid field of the memory block header of one of the memory blocks. Further, the acquisition unit 504 may acquire time point information indicating the time point when any of the used areas is allocated from the storage unit 101. For example, the acquisition unit 504 may acquire time information indicating the time when the software secures the memory block together with the software identifier from the myid field of the memory block header of any of the memory blocks. The acquired data is stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207, for example. Thereby, the acquisition unit 504 can acquire data used for the determination process by the determination unit 505.

判定部505は、実行中のソフトウェアの中に、取得した識別子により識別されるソフトウェアがあるか否かを判定する。判定部505は、例えば、取得したソフトウェアの識別子を用いて、ソフトウェアの状態を検出して、ソフトウェアがIdle状態である場合に、実行中のソフトウェアの中に取得した識別子により識別されるソフトウェアがないと判定する。   The determination unit 505 determines whether there is software identified by the acquired identifier in the software being executed. For example, the determination unit 505 detects the software state using the acquired software identifier, and when the software is in the idle state, there is no software identified by the acquired identifier in the running software. Is determined.

また、判定部505は、取得した識別子により識別されるソフトウェアがあると判定した場合、記憶部101を参照して、取得した時点情報が、取得した識別子に対応する最新の時点情報と一致するか否かを判定してもよい。判定部505は、例えば、取得した識別子により識別されるソフトウェアがあると判定した場合、時間情報管理テーブル400を参照して、取得した時点情報が、取得した識別子に対応する最新の時点情報と一致するか否かを判定してもよい。   If the determination unit 505 determines that there is software identified by the acquired identifier, the storage unit 101 is referred to and the acquired time point information matches the latest time point information corresponding to the acquired identifier. It may be determined whether or not. For example, when the determination unit 505 determines that there is software identified by the acquired identifier, the acquired time point information matches the latest time point information corresponding to the acquired identifier with reference to the time information management table 400. It may be determined whether or not to do so.

判定部505は、識別子により識別されるソフトウェアがないと判定した場合、および、取得した時点情報が最新の時点情報と一致しないと判定した場合、いずれかの使用領域の解放要求と更新要求とを発行する。判定結果は、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。これにより、判定部505は、メモリブロックが異常メモリブロックであるか否かを判定することができる。   If the determination unit 505 determines that there is no software identified by the identifier, and determines that the acquired time point information does not match the latest time point information, the determination unit 505 issues a release request and an update request for any of the used areas. Issue. The determination result is stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207, for example. Thereby, the determination unit 505 can determine whether or not the memory block is an abnormal memory block.

制御部506は、識別子により識別されるソフトウェアがないと判定した場合、いずれかの使用領域を解放する。また、制御部506は、取得した時点情報が最新の時点情報と一致しないと判定した場合、いずれかの使用領域を解放してもよい。制御部506は、例えば、判定部505からの解放要求を検出して、解放要求されたメモリブロックを解放する。また、制御部506は、ソフトウェアからの割当要求を検出して、ソフトウェアに使用領域を割り当ててもよい。これにより、制御部506は、既に実行終了したソフトウェアによって確保されたままのメモリブロックを解放することができる。   When the control unit 506 determines that there is no software identified by the identifier, the control unit 506 releases any used area. In addition, when it is determined that the acquired time point information does not match the latest time point information, the control unit 506 may release any used area. For example, the control unit 506 detects a release request from the determination unit 505 and releases the memory block requested to be released. Further, the control unit 506 may detect an allocation request from software and allocate a use area to the software. As a result, the control unit 506 can release the memory block secured by the software that has already been executed.

(制御装置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 control device 100 will be described with reference to FIGS.

図6は、制御装置100によるヒープメモリ制御の流れを示す説明図である。図6に示すように、制御装置100は、ソフトウェアAと、ソフトウェアBと、制御プログラムと、OSとを実行する。   FIG. 6 is an explanatory diagram showing a flow of heap memory control by the control device 100. As illustrated in FIG. 6, the control device 100 executes software A, software B, a control program, and an OS.

図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 acquisition unit 504, the determination unit 505, and the control unit 506 described above.

(1)ソフトウェアAは、例えば、制御装置100の利用者からの操作を受けて実行される。ここで、ソフトウェアAは、malloc関数を実行し、OSを介して、メモリブロックを確保する。このとき、制御プログラムは、ソフトウェアAの識別子を、確保したメモリブロックのメモリブロックヘッダのmyidのフィールドに記憶する。   (1) The software A is executed in response to an operation from a user of the control device 100, for example. Here, the software A executes a malloc function and secures a memory block via the OS. At this time, the control program stores the identifier of the software A in the myid field of the memory block header of the secured memory block.

(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 control device 100. In FIG. 7, the control device 100 initializes the heap memory M. Here, FIG. 7 corresponds to the initial state of FIG.

図7に示すように、制御装置100は、ヒープメモリヘッダ701を作成し、ヒープメモリMを1つのメモリブロックとして扱い、先頭にメモリブロックヘッダ702を作成する。   As shown in FIG. 7, the control device 100 creates a heap memory header 701, treats the heap memory M as one memory block, and creates a memory block header 702 at the head.

制御装置100は、作成したメモリブロックヘッダ702のsizeのフィールドに、メモリブロックのサイズを示す10000Byteを設定する。ここで、メモリブロックのサイズは、例えば、ヒープメモリMのサイズを示す10000Byteからメモリブロックヘッダ702のサイズを減算した結果である。しかしながら、以下の説明では、簡単のため、メモリブロックヘッダ702のサイズを0Byteとして扱うこととする。   The control device 100 sets 10000 bytes indicating the size of the memory block in the size field of the created memory block header 702. Here, the size of the memory block is, for example, a result of subtracting the size of the memory block header 702 from 10000 bytes indicating the size of the heap memory M. However, in the following description, for the sake of simplicity, the size of the memory block header 702 is treated as 0 bytes.

制御装置100は、作成したメモリブロックヘッダ702のoccupiedのフィールドに、未使用であることを示す0を設定する。制御装置100は、作成したメモリブロックヘッダ702のmyidのフィールドに、まだソフトウェアに割り当てられていない空きメモリブロックであることを示す0x0を設定する。   The control device 100 sets 0 indicating that it is unused in the occupied field of the created memory block header 702. The control device 100 sets 0x0 indicating that it is an empty memory block not yet assigned to software in the myid field of the created memory block header 702.

制御装置100は、作成したメモリブロックヘッダ702のnextのフィールドに、ヒープメモリヘッダ701の先頭アドレスを設定する。制御装置100は、作成したメモリブロックヘッダ702のprevのフィールドに、ヒープメモリヘッダ701の先頭アドレスを設定する。   The control device 100 sets the start address of the heap memory header 701 in the next field of the created memory block header 702. The control device 100 sets the head address of the heap memory header 701 in the prev field of the created memory block header 702.

制御装置100は、ヒープメモリヘッダ701のnextに、作成したメモリブロックヘッダ702の先頭アドレスを記憶する。制御装置100は、ヒープメモリヘッダ701のprevに、作成したメモリブロックヘッダ702の先頭アドレスを記憶する。これにより、制御装置100は、ヒープメモリMを初期化することができる。   The control device 100 stores the top address of the created memory block header 702 in the next of the heap memory header 701. The control device 100 stores the top address of the created memory block header 702 in the prev of the heap memory header 701. Thereby, the control apparatus 100 can initialize the heap memory M.

図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 control device 100. In FIG. 8, the control device 100 allocates a 100-byte memory block to the software A. Here, the heap memory M shown in FIG. 8 corresponds to the state in which the memory block is allocated to the software A in (1) of FIG.

図8に示すように、制御装置100は、先頭のメモリブロックヘッダ702に続く100Byteの記憶領域を、メモリブロックとしてソフトウェアAに割り当てて、残りの9900Byteのメモリブロックの先頭にメモリブロックヘッダ801を作成する。   As shown in FIG. 8, the control device 100 allocates a 100-byte storage area following the first memory block header 702 to the software A as a memory block, and creates a memory block header 801 at the beginning of the remaining 9900-byte memory block. To do.

制御装置100は、先頭のメモリブロックヘッダ702のsizeのフィールドに、ソフトウェアAに割り当てたメモリブロックの記憶領域のサイズを示す100Byteを設定する。制御装置100は、先頭のメモリブロックヘッダ702のoccupiedのフィールドに、使用中であることを示す1を設定する。   The control device 100 sets 100 bytes indicating the size of the storage area of the memory block allocated to the software A in the size field of the top memory block header 702. The control device 100 sets 1 indicating that it is in use in the occupied field of the top memory block header 702.

制御装置100は、先頭のメモリブロックヘッダ702のmyidのフィールドに、ソフトウェアAの識別子と、ソフトウェアAにメモリブロックを割り当てた時点と、を示す0x00010303を設定する。   The control device 100 sets 0x00010303 indicating the identifier of the software A and the time when the memory block is allocated to the software A in the myid field of the top memory block header 702.

制御装置100は、先頭のメモリブロックヘッダ702のnextのフィールドに、作成したメモリブロックヘッダ801の先頭アドレスを設定する。制御装置100は、先頭のメモリブロックヘッダ702のprevのフィールドに、ヒープメモリヘッダ701の先頭アドレスを設定する。   The control device 100 sets the top address of the created memory block header 801 in the next field of the top memory block header 702. The control device 100 sets the head address of the heap memory header 701 in the prev field of the head memory block header 702.

制御装置100は、作成したメモリブロックヘッダ801のsizeのフィールドに、メモリブロックのサイズを示す9900Byteを設定する。制御装置100は、作成したメモリブロックヘッダ801のoccupiedのフィールドに、未使用であることを示す0を設定する。制御装置100は、作成したメモリブロックヘッダ801のmyidのフィールドに、まだソフトウェアに割り当てられていない空きメモリブロックであることを示す0x0を設定する。   The control device 100 sets 9900 bytes indicating the size of the memory block in the size field of the created memory block header 801. The control device 100 sets 0 indicating that it is unused in the occupied field of the created memory block header 801. The control device 100 sets 0x0 indicating that it is an empty memory block not yet assigned to software in the myid field of the created memory block header 801.

制御装置100は、作成したメモリブロックヘッダ801のnextのフィールドに、ヒープメモリヘッダ701の先頭アドレスを設定する。制御装置100は、作成したメモリブロックヘッダ801のprevのフィールドに、メモリブロックヘッダ702の先頭アドレスを設定する。制御装置100は、ヒープメモリヘッダ701のprevを、作成したメモリブロックヘッダ801の先頭アドレスに更新する。これにより、制御装置100は、ソフトウェアAにメモリブロックを割り当てることができる。結果として、制御装置100は、ソフトウェアAの処理のために使用するワークエリアとしてメモリブロックを使用して、ソフトウェアAを実行することができる。   The control device 100 sets the start address of the heap memory header 701 in the next field of the created memory block header 801. The control device 100 sets the start address of the memory block header 702 in the prev field of the created memory block header 801. The control device 100 updates prev of the heap memory header 701 to the top address of the created memory block header 801. Thereby, the control apparatus 100 can allocate a memory block to the software A. As a result, the control device 100 can execute the software A using the memory block as a work area used for the processing of the software A.

図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 control device 100. In FIG. 9, the control device 100 updates the time information management table 400 when a 100-byte memory block is allocated to the software A. Here, FIG. 9 corresponds to a case where the time information management table 400 is updated when a memory block is allocated to the software A in (1) of FIG.

制御装置100は、ソフトウェアAの識別子が1であるため、時間情報管理テーブル400の1番目のレコードにソフトウェアAにメモリブロックを割り当てた時点を示す時点情報0x0303を記憶する。これにより、制御装置100は、ソフトウェアAと対応付けて、ソフトウェアAにメモリブロックを割り当てた最新の時点を示す時点情報を記憶しておくことができる。   Since the identifier of software A is 1, the control device 100 stores time information 0x0303 indicating the time when the memory block is allocated to the software A in the first record of the time information management table 400. Thereby, the control device 100 can store time information indicating the latest time when the memory block is allocated to the software A in association with the software A.

また、制御装置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 control device 100 allocates a 100-byte memory block to the software B and updates the time information management table 400 in the same manner as in FIGS. 8 and 9. Here, as in FIGS. 8 and 9, allocating a 100-byte memory block to software B corresponds to the case of allocating a memory block to software B in (2) of FIG. Thereby, the control apparatus 100 can allocate a memory block to the software B. As a result, the control device 100 can execute the software B using the memory block as a work area used for the processing of the software B. Further, the control device 100 can store time information indicating the latest time when the memory block is allocated to the software B in association with the software B.

図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 control device 100. In FIG. 10, the control device 100 releases the memory block assigned to the software A. Here, FIG. 10 corresponds to the case where the memory block allocated to the software A in (3) of FIG. 6 is released.

図10に示すように、制御装置100は、先頭のメモリブロックヘッダ702に続く100ByteのソフトウェアAに割り当てたメモリブロックを解放する。   As shown in FIG. 10, the control device 100 releases the memory block assigned to the 100-byte software A following the first memory block header 702.

ここで、制御装置100は、メモリブロックヘッダ702のprevとのフィールドを参照して、メモリブロックヘッダ702の前にあるメモリブロックヘッダが使用中であるか否かを判定する。制御装置100は、前にあるメモリブロックヘッダが使用中でないと判定した場合は、前にあるメモリブロックヘッダに、メモリブロックヘッダ702を結合する。   Here, the control device 100 refers to the prev field of the memory block header 702 and determines whether or not the memory block header preceding the memory block header 702 is in use. When determining that the preceding memory block header is not in use, the control device 100 couples the memory block header 702 to the preceding memory block header.

また、制御装置100は、メモリブロックヘッダ702のnextのフィールドを参照して、メモリブロックヘッダ702の後ろにあるメモリブロックヘッダが使用中であるか否かを判定する。制御装置100は、後ろにあるメモリブロックヘッダが使用中でないと判定した場合は、後ろにあるメモリブロックヘッダを、メモリブロックヘッダ702に結合する。図10の例では、制御装置100は、メモリブロックヘッダ702の後ろにあるメモリブロックヘッダ801が使用中であるため、メモリブロックヘッダ801を結合しない。   Also, the control device 100 refers to the next field of the memory block header 702 and determines whether or not the memory block header behind the memory block header 702 is in use. When the control device 100 determines that the rear memory block header is not in use, the control device 100 couples the rear memory block header to the memory block header 702. In the example of FIG. 10, the control device 100 does not combine the memory block header 801 because the memory block header 801 behind the memory block header 702 is in use.

制御装置100は、先頭のメモリブロックヘッダ702のsizeのフィールドに、100Byteを設定する。制御装置100は、先頭のメモリブロックヘッダ702のoccupiedのフィールドに、未使用であることを示す0を設定する。制御装置100は、先頭のメモリブロックヘッダ702のmyidのフィールドから、ソフトウェアAの識別子と、ソフトウェアAにメモリブロックを割り当てた時点と、を示す0x00010303を削除する。これにより、制御装置100は、ヒープメモリMに空きメモリブロックを増加させることができ、ヒープメモリMが不足することを防止することができる。   The control device 100 sets 100 bytes in the size field of the top memory block header 702. The control device 100 sets 0 indicating that it is unused in the occupied field of the top memory block header 702. The control device 100 deletes 0x00010303 indicating the identifier of the software A and the time when the memory block is allocated to the software A from the myid field of the top memory block header 702. Thereby, the control apparatus 100 can increase an empty memory block in the heap memory M, and can prevent the heap memory M from running out.

図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 control device 100. In FIG. 11, the control device 100 updates the time information management table 400 when releasing the memory block allocated to the software A. Here, FIG. 11 corresponds to the case where the time information management table 400 is updated when the memory block allocated to the software A in (3) of FIG. 6 is released. Since the identifier of the software A is 1, the control apparatus 100 initializes the first record of the time information management table 400 and stores 0x0000. Thereby, the control apparatus 100 can update the time information management table 400.

図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 control device 100. In FIG. 12, the control device 100 releases the memory block allocated to the software B. Here, FIG. 12 corresponds to the case where the memory block allocated to the software B in (4) of FIG. 6 is released.

図12に示すように、制御装置100は、順次、メモリブロックヘッダのmyidのフィールドの内容を取得する。制御装置100は、例えば、メモリブロックヘッダ801のmyidのフィールドの内容を取得し、取得した内容のうちのソフトウェアBの識別子と、ソフトウェアBにメモリブロックを割り当てた時点を示す時点情報と、を取得する。   As shown in FIG. 12, the control device 100 sequentially acquires the contents of the myid field of the memory block header. For example, the control device 100 acquires the contents of the myid field of the memory block header 801, and acquires the identifier of the software B in the acquired contents and the time information indicating the time when the memory block is allocated to the software B. To do.

次に、制御装置100は、取得したソフトウェアBの識別子を用いて、実行中のソフトウェアの中に、ソフトウェアBがあるか否かを判定する。ここで、制御装置100は、実行中のソフトウェアの中に、ソフトウェアBがないため、ソフトウェアBに割り当てたメモリブロックを解放する。メモリブロックを解放する処理については、図10に示した処理と同様のため、説明を省略する。   Next, using the acquired identifier of software B, control device 100 determines whether software B is present in the software being executed. Here, since there is no software B in the software being executed, the control device 100 releases the memory block allocated to the software B. The processing for releasing the memory block is the same as the processing shown in FIG.

また、制御装置100は、実行中のソフトウェアの中に、ソフトウェアBがある場合、取得した時点情報が示す時点と、時間情報管理テーブル400の2番目のレコードの時点情報が示す時点と、が一致するか否かを判定する。ここで、制御装置100は、時点が一致しない場合、ソフトウェアBに割り当てたメモリブロックを解放する。メモリブロックを解放する処理については、図10に示した処理と同様のため、説明を省略する。   In addition, when the software B is included in the software being executed, the control device 100 matches the time point indicated by the acquired time point information with the time point indicated by the time point information of the second record of the time information management table 400. It is determined whether or not to do. Here, if the time points do not match, the control device 100 releases the memory block allocated to the software B. The processing for releasing the memory block is the same as the processing shown in FIG.

一方で、制御装置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 control device 100 does not release the memory block allocated to the software B. .

図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 control device 100 updates the heap memory M as shown in FIG. 13 by executing the processing of FIG. As a result, the control device 100 can release the memory block secured by the already executed software. Therefore, the control device 100 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 device 100 can prevent the memory block in the heap memory M to be allocated to software from being insufficient, and can execute the software normally.

一方で、制御装置100は、実行中のソフトウェアによって確保されたままのメモリブロックを解放しない。したがって、制御装置100は、実行中のソフトウェアが使用しているメモリブロックを解放して実行中のソフトウェアに不具合が発生することを防止することができる。結果として、制御装置100は、ソフトウェアを正常に実行することができる。   On the other hand, the control device 100 does not release the memory block that is secured by the running software. Therefore, the control device 100 can prevent a problem occurring in the software being executed by releasing the memory block used by the software being executed. As a result, the control device 100 can execute the software normally.

図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 control device 100. In FIG. 14, the control device 100 updates the time information management table 400 when releasing the memory block allocated to the software B. Here, FIG. 14 corresponds to the case where the time information management table 400 is updated when the memory block assigned to the software B in (4) of FIG. 6 is released. Since the identifier of software B is 1, the control device 100 initializes the second record of the time information management table 400 and stores 0x0000.

図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 control device 100 updates the time information management table 400 as shown in FIG. 15 by executing the processing of FIG. Thereby, the control apparatus 100 can update the time information management table 400.

(制御装置100の制御処理手順の一例)
次に、図16を用いて、制御装置100の制御処理手順の一例について説明する。
(Example of control processing procedure of control device 100)
Next, an example of a control processing procedure of the control device 100 will be described with reference to FIG.

図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 control device 100. In FIG. 16, the execution unit 501 reads the OS, executes the OS, and activates the control device 100 (step S1601). Next, the execution unit 501 transmits an initialization process request to the update unit 502 (step S1602). The update unit 502 detects the initialization process request and executes the initialization process (step S1603). Here, when the updating unit 502 ends the initialization process, the updating unit 502 transmits a response to the execution unit 501.

実行部501は、ソフトウェアを実行する(ステップS1604)。実行部501は、ソフトウェア内のmalloc関数を実行することにより、更新部502および制御部506に、確保要求を送信する(ステップS1605)。更新部502および制御部506は、確保処理を実行する(ステップS1606)。ここで、更新部502および制御部506は、確保処理を終了すると、実行部501に応答を送信する。   The execution unit 501 executes the software (step S1604). The execution unit 501 transmits a reservation request to the update unit 502 and the control unit 506 by executing the malloc function in the software (step S1605). The update unit 502 and the control unit 506 execute a securing process (step S1606). Here, the update unit 502 and the control unit 506 transmit a response to the execution unit 501 when the securing process is completed.

また、ここで、実行部501が実行するソフトウェアが強制終了したとする。計時部503は、時間管理処理を実行する(ステップS1607)。計時部503は、時間管理処理を実行することにより、更新部502、取得部504、判定部505、および制御部506は、判定要求を送信する。   Here, it is assumed that the software executed by the execution unit 501 is forcibly terminated. The timer unit 503 executes time management processing (step S1607). When the time measuring unit 503 executes the time management process, the update unit 502, the acquisition unit 504, the determination unit 505, and the control unit 506 transmit a determination request.

更新部502、取得部504、判定部505、および制御部506は、判定要求を検出すると、判定処理を実行する(ステップS1608)。ここで、更新部502、取得部504、判定部505、および制御部506は、判定処理を終了すると、計時部503に応答を送信する。   When the update unit 502, the acquisition unit 504, the determination unit 505, and the control unit 506 detect the determination request, the update unit 502, the acquisition unit 504, the determination unit 505, and the control unit 506 execute determination processing (step S1608). Here, the update unit 502, the acquisition unit 504, the determination unit 505, and the control unit 506 transmit a response to the time measuring unit 503 when the determination process is completed.

これにより、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックを解放することができる。したがって、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックが増大してヒープメモリMのメモリブロックが不足することを防止することができる。結果として、制御装置100は、ソフトウェアに割り当てるヒープメモリM内のメモリブロックが不足することを防止し、ソフトウェアを正常に実行することができる。   As a result, the control device 100 can release the memory block secured by the already executed software. Therefore, the control device 100 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 device 100 can prevent the memory block in the heap memory M to be allocated to software from being insufficient, and can execute the software normally.

一方で、制御装置100は、実行中のソフトウェアによって確保されたままのメモリブロックを解放しない。したがって、制御装置100は、実行中のソフトウェアが使用しているメモリブロックを解放して実行中のソフトウェアに不具合が発生することを防止することができる。結果として、制御装置100は、ソフトウェアを正常に実行することができる。   On the other hand, the control device 100 does not release the memory block that is secured by the running software. Therefore, the control device 100 can prevent a problem occurring in the software being executed by releasing the memory block used by the software being executed. As a result, the control device 100 can execute the software normally.

(制御装置100の初期化処理手順の一例)
次に、図17を用いて、制御装置100の初期化処理手順の一例について説明する。
(Example of initialization processing procedure of control device 100)
Next, an example of an initialization process procedure of the control device 100 will be described with reference to FIG.

図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 control device 100. In FIG. 17, the control device 100 acquires the head address of the heap memory M (step S1701). Next, the control device 100 creates a memory block header and sets information in each field of the memory block header based on the acquired head address (step S1702). The control device 100 creates a memory block header and sets information in each field of the memory block header (step S1703). Thereby, the control apparatus 100 can initialize the heap memory M.

(制御装置100の確保処理手順の一例)
次に、図18を用いて、制御装置100の確保処理手順の一例について説明する。
(Example of secure processing procedure of control device 100)
Next, an example of the securing process procedure of the control device 100 will be described with reference to FIG.

図18は、制御装置100の確保処理手順の一例を示すフローチャートである。図18において、制御装置100は、全てのメモリブロックを選択したか否かを判定する(ステップS1801)。ここで、全てのメモリブロックを選択していない場合(ステップS1801:No)、制御装置100は、ヒープメモリヘッダおよびメモリブロックヘッダを参照して、メモリブロックを選択する(ステップS1802)。   FIG. 18 is a flowchart illustrating an example of a securing process procedure of the control device 100. In FIG. 18, the control device 100 determines whether or not all memory blocks have been selected (step S1801). Here, when all the memory blocks are not selected (step S1801: No), the control device 100 refers to the heap memory header and the memory block header and selects a memory block (step S1802).

次に、制御装置100は、選択したメモリブロックが、未使用であって、確保要求されたサイズ以上であるか否かを判定する(ステップS1803)。ここで、制御装置100は、未使用ではない場合、または確保要求されたサイズ未満である場合(ステップS1803:No)、制御装置100は、ステップS1801の処理に戻る。   Next, the control device 100 determines whether or not the selected memory block is unused and is not less than the size requested to be secured (step S1803). Here, if the control device 100 is not unused or is smaller than the size requested to be secured (step S1803: No), the control device 100 returns to the process of step S1801.

一方で、未使用であって、確保要求されたサイズ以上である場合(ステップ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 control device 100 obtains the identifier of the software that issued the securing request and the time information indicating the secured time. The included data is generated (step S1804). Next, the control device 100 adds an address of the requested size to the start address of the selected memory block, and sets the area after the added address as an empty memory block (step S1805).

そして、制御装置100は、ヒープメモリヘッダおよびメモリブロックヘッダを更新する(ステップS1806)。次に、選択したメモリブロックのメモリブロックヘッダのsizeのフィールドに、確保したメモリブロックのサイズを設定し、occupiedのフィールドに、使用中を示す1を設定する(ステップS1807)。   Then, the control device 100 updates the heap memory header and the memory block header (step S1806). Next, the size of the secured memory block is set in the size field of the memory block header of the selected memory block, and 1 indicating in use is set in the occupied field (step S1807).

そして、制御装置100は、選択したメモリブロックのメモリブロックヘッダのmyidのフィールドに、生成したデータを設定する(ステップS1808)。次に、制御装置100は、確保した時点を示す時点情報を、時間情報管理テーブル400に設定する(ステップS1809)。   Then, the control device 100 sets the generated data in the myid field of the memory block header of the selected memory block (step S1808). Next, the control device 100 sets time information indicating the secured time in the time information management table 400 (step S1809).

次に、制御装置100は、選択したメモリブロックの先頭アドレスへのポインタを実行部501に送信する(ステップS1810)。そして、制御装置100は、確保処理を終了する。   Next, the control device 100 transmits a pointer to the start address of the selected memory block to the execution unit 501 (step S1810). Then, the control device 100 ends the securing process.

また、ステップS1801において、全てのメモリブロックを選択した場合(ステップS1801:Yes)、制御装置100は、メモリブロックを確保できなかったとして、NULLポインタを実行部501に送信する(ステップS1811)。そして、制御装置100は、確保処理を終了する。これにより、制御装置100は、ソフトウェアにメモリブロックを割り当てることができる。結果として、制御装置100は、ソフトウェアの処理のために使用するワークエリアとしてメモリブロックを使用して、ソフトウェアを実行することができる。   If all the memory blocks are selected in step S1801 (step S1801: Yes), the control device 100 transmits a NULL pointer to the execution unit 501 assuming that the memory block could not be secured (step S1811). Then, the control device 100 ends the securing process. Thereby, the control apparatus 100 can allocate a memory block to software. As a result, the control device 100 can execute the software using the memory block as a work area used for software processing.

(制御装置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 control device 100 will be described with reference to FIG.

図19は、制御装置100の時間管理処理手順の一例を示すフローチャートである。図19において、制御装置100は、所定時間が経過したか否かを判定する(ステップS1901)。ここで、所定時間が経過していない場合(ステップS1901:No)、制御装置100は、時間管理処理を終了する。   FIG. 19 is a flowchart illustrating an example of a time management processing procedure of the control device 100. In FIG. 19, the control device 100 determines whether or not a predetermined time has elapsed (step S1901). If the predetermined time has not elapsed (step S1901: No), the control device 100 ends the time management process.

一方で、所定時間が経過した場合(ステップS1901:Yes)、制御装置100は、判定要求を発行する(ステップS1902)。次に、制御部506は、所定時間の計時を初めからやり直す(ステップS1903)。そして、制御部506は、時間管理処理を終了する。これにより、制御装置100は、一定時間ごとに、判定要求を発行することができる。   On the other hand, when the predetermined time has elapsed (step S1901: Yes), the control device 100 issues a determination request (step S1902). Next, the control unit 506 starts counting a predetermined time from the beginning (step S1903). Then, the control unit 506 ends the time management process. Thereby, the control apparatus 100 can issue a determination request at regular time intervals.

(制御装置100の判定処理手順の一例)
次に、図20を用いて、制御装置100の判定処理手順の一例について説明する。
(Example of determination processing procedure of control device 100)
Next, an example of the determination processing procedure of the control device 100 will be described with reference to FIG.

図20は、制御装置100の判定処理手順の一例を示すフローチャートである。図20において、制御装置100は、全てのメモリブロックを選択したか否かを判定する(ステップS2001)。ここで、全てのメモリブロックを選択していない場合(ステップS2001:No)、制御装置100は、ヒープメモリヘッダおよびメモリブロックヘッダを参照して、メモリブロックを選択する(ステップS2002)。   FIG. 20 is a flowchart illustrating an example of the determination processing procedure of the control device 100. In FIG. 20, the control device 100 determines whether or not all memory blocks have been selected (step S2001). Here, when all the memory blocks are not selected (step S2001: No), the control device 100 refers to the heap memory header and the memory block header and selects a memory block (step S2002).

次に、制御装置100は、選択したメモリブロックが、使用中であるか否かを判定する(ステップS2003)。ここで、制御装置100は、使用中ではない場合(ステップS2003:No)、制御装置100は、ステップS2001の処理に戻る。   Next, the control device 100 determines whether or not the selected memory block is in use (step S2003). Here, when the control apparatus 100 is not in use (step S2003: No), the control apparatus 100 returns to the process of step S2001.

一方で、使用中である場合(ステップS2003:Yes)、制御装置100は、選択したメモリブロックのメモリブロックヘッダのmyidのフィールドから、選択したメモリブロックを確保したソフトウェアの識別子と、確保した時点を示す時点情報と、を含むデータを取得する(ステップS2004)。次に、制御装置100は、時間情報管理テーブル400から、取得したデータに含まれるソフトウェアの識別子により識別されるソフトウェアがメモリブロックを確保した最新の時点を示す時点情報を取得する(ステップS2005)。   On the other hand, if it is in use (step S2003: Yes), the control device 100 determines the identifier of the software that secured the selected memory block from the myid field of the memory block header of the selected memory block, and the secured time point. The data including the time point information shown is acquired (step S2004). Next, the control device 100 acquires time point information indicating the latest time point when the software identified by the software identifier included in the acquired data secures the memory block from the time information management table 400 (step S2005).

そして、制御装置100は、取得したデータに含まれる時点情報が示す時点と、取得した最新の時点を示す時点情報が示す最新の時点と、が一致するか否かを判定する(ステップS2006)。ここで、一致しない場合(ステップS2006:No)、制御装置100は、ステップS2001の処理に戻る。   Then, the control device 100 determines whether or not the time indicated by the time information included in the acquired data matches the latest time indicated by the time information indicating the latest acquired time (step S2006). Here, when it does not correspond (step S2006: No), the control apparatus 100 returns to the process of step S2001.

一方で、一致する場合(ステップ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 control apparatus 100 specifies the state of software from the identifier of software (step S2007). Next, the control device 100 determines whether or not the software state is an idle state (step S2008). Here, when it is not an idle state (step S2008: No), the control apparatus 100 returns to the process of step S2001. On the other hand, when it is an idle state (step S2008: Yes), the control apparatus 100 performs a release process (step S2009), and returns to the process of step S2001.

また、ステップS2001において、全てのメモリブロックを選択した場合(ステップS2001:Yes)、制御装置100は、解放するメモリブロックがないとして、判定処理を終了する。これにより、制御装置100は、ソフトウェアに割り当てられたメモリブロックが異常メモリブロックであるか否かを判定することができる。   If all the memory blocks are selected in step S2001 (step S2001: Yes), the control device 100 ends the determination process assuming that there is no memory block to be released. Thereby, the control apparatus 100 can determine whether the memory block allocated to software is an abnormal memory block.

(制御装置100の解放処理手順の一例)
次に、図21を用いて、制御装置100の解放処理手順の一例について説明する。
(Example of release processing procedure of control device 100)
Next, an example of a release process procedure of the control device 100 will be described with reference to FIG.

図21は、制御装置100の解放処理手順の一例を示すフローチャートである。図21において、制御装置100は、選択したメモリブロックの前にあるメモリブロックが未使用であるか否かを判定する(ステップS2101)。ここで、制御装置100は、未使用ではない場合(ステップS2101:No)、ステップS2103の処理に移行する。   FIG. 21 is a flowchart illustrating an example of a release processing procedure of the control device 100. In FIG. 21, the control device 100 determines whether or not the memory block preceding the selected memory block is unused (step S2101). Here, when the control apparatus 100 is not unused (step S2101: No), it transfers to the process of step S2103.

一方で、未使用である場合(ステップS2101:Yes)、制御装置100は、選択したメモリブロックを、選択したメモリブロックの前にあるメモリブロックに結合する(ステップS2102)。   On the other hand, when it is unused (step S2101: Yes), the control device 100 combines the selected memory block with the memory block preceding the selected memory block (step S2102).

次に、制御装置100は、選択したメモリブロックの後ろにあるメモリブロックが未使用であるか否かを判定する(ステップS2103)。ここで、制御装置100は、未使用ではない場合(ステップS2103:No)、ステップS2105の処理に移行する。   Next, the control device 100 determines whether or not the memory block behind the selected memory block is unused (step S2103). Here, when the control apparatus 100 is not unused (step S2103: No), it transfers to the process of step S2105.

一方で、未使用である場合(ステップS2103:Yes)、制御装置100は、選択したメモリブロックに、選択したメモリブロックの後ろにあるメモリブロックを結合する(ステップS2104)。   On the other hand, when unused (step S2103: Yes), the control device 100 couples the memory block behind the selected memory block to the selected memory block (step S2104).

次に、制御装置100は、選択したメモリブロック、または結合したメモリブロックのメモリブロックヘッダに情報を設定して、未使用のメモリブロックに設定する(ステップS2105)。そして、制御装置100は、選択したメモリブロック、または結合したメモリブロックの内容をクリアする(ステップS2106)。次に、制御装置100は、ヒープメモリヘッダに情報を設定する(ステップS2107)。そして、制御装置100は、解放処理を終了する。これにより、制御装置100は、異常メモリブロックを解放することができる。   Next, the control device 100 sets information in the memory block header of the selected memory block or the combined memory block, and sets it as an unused memory block (step S2105). Then, the control device 100 clears the contents of the selected memory block or the combined memory block (step S2106). Next, the control device 100 sets information in the heap memory header (step S2107). Then, the control device 100 ends the release process. Thereby, the control apparatus 100 can release the abnormal memory block.

以上説明したように、制御装置100によれば、ソフトウェアに確保されたメモリブロックについて、実行中のソフトウェアの中に当該ソフトウェアがなければ、異常メモリブロックであると判定することができる。これにより、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックを解放することができる。   As described above, according to the control device 100, if the memory block secured in the software is not included in the software being executed, it can be determined that the memory block is an abnormal memory block. As a result, the control device 100 can release the memory block secured by the already executed software.

したがって、制御装置100は、既に実行終了したソフトウェアによって確保されたままのメモリブロックが増大してヒープメモリMのメモリブロックが不足することを防止することができる。結果として、制御装置100は、ソフトウェアに割り当てるヒープメモリM内のメモリブロックが不足することを防止し、ソフトウェアを正常に実行することができる。また、制御装置100は、ヒープメモリM内の空きメモリブロックを纏めることができ、使用中のメモリブロックを探索する効率を向上させることができる。   Therefore, the control device 100 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 device 100 can prevent the memory block in the heap memory M to be allocated to software from being insufficient, and can execute the software normally. Moreover, the control apparatus 100 can collect the empty memory blocks in the heap memory M, and can improve the efficiency of searching for the memory blocks in use.

ここで、例えば、ソフトウェアの実行開始から所定時間が経過したときに自動的にメモリブロックを解放することが考えられる。しかしながら、この場合、所定時間が経過したときにソフトウェアがまだ実行中であると、ソフトウェアが使用中のメモリブロックを解放して、ソフトウェアが異常動作してしまうことがある。一方で、制御装置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 control device 100 does not release the memory block that is secured by the running software. Therefore, the control device 100 can prevent a problem occurring in the software being executed by releasing the memory block used by the software being executed. As a result, the control device 100 can execute the software normally.

また、制御装置100によれば、メモリブロックを確保した時点を示す時点情報をメモリブロックに対応付けて記憶し、ソフトウェアの識別子とソフトウェアがメモリブロックを確保した最新の時点を示す時点情報とを対応付けて記憶することができる。これにより、制御装置100は、メモリブロックを確保した時点と、ソフトウェアがメモリブロックを確保した最新の時点とが一致するか否かを判定して、ソフトウェアの識別子が使い回しされているかを判定することができる。したがって、制御装置100は、ソフトウェアの識別子に使用するデータ量を低減することができる。   Further, according to the control device 100, the time information indicating the time when the memory block is secured is stored in association with the memory block, and the software identifier is associated with the time information indicating the latest time when the software secures the memory block. It can be memorized. As a result, the control device 100 determines whether or not the time when the memory block is secured coincides with the latest time when the software secures the memory block, and determines whether or not the software identifier is reused. be able to. Therefore, the control device 100 can reduce the amount of data used for the software identifier.

なお、本実施の形態で説明した制御方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本制御プログラムは、ハードディスク、フレキシブルディスク、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 supplementary note 1, wherein:

(付記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 appendix 1 or 2, wherein when the acquired time point information is determined not to match the latest time point information, any one of the used areas is released.

(付記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 appendix 3, wherein a process of storing time point information indicating a time point when the use area is allocated as the storage area to be used is executed.

(付記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 SYMBOLS 100 Control apparatus 501 Execution part 502 Update part 503 Time measuring part 504 Acquisition part 505 Determination part 506 Control part

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.
JP2013084247A 2013-04-12 2013-04-12 Control method, control device, control program, and recording medium Expired - Fee Related JP6163844B2 (en)

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)

* Cited by examiner, † Cited by third party
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

Patent Citations (6)

* Cited by examiner, † Cited by third party
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