JP6354609B2 - Information processing apparatus and memory management program - Google Patents
Information processing apparatus and memory management program Download PDFInfo
- Publication number
- JP6354609B2 JP6354609B2 JP2015016333A JP2015016333A JP6354609B2 JP 6354609 B2 JP6354609 B2 JP 6354609B2 JP 2015016333 A JP2015016333 A JP 2015016333A JP 2015016333 A JP2015016333 A JP 2015016333A JP 6354609 B2 JP6354609 B2 JP 6354609B2
- Authority
- JP
- Japan
- Prior art keywords
- program
- resident
- memory
- work area
- information processing
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Memory System (AREA)
- Stored Programmes (AREA)
Description
本発明は、メモリー上へデータを配置する情報処理装置および当該情報処理装置で稼働するメモリー管理プログラムに関する。 The present invention relates to an information processing apparatus that arranges data on a memory and a memory management program that operates on the information processing apparatus.
従来より、効率的なメモリーの管理方法が求められてきた。例えば、空きメモリーの断片化を最小限に抑えるために、特許文献1に開示されたデータベース演算処理装置では、メモリーに格納するデータを、実際の処理データとその処理のために必要なパラメーターの2種類に分類している。 Conventionally, an efficient memory management method has been demanded. For example, in order to minimize fragmentation of free memory, the database arithmetic processing apparatus disclosed in Patent Document 1 uses data stored in the memory as actual processing data and 2 of parameters necessary for the processing. Classified into types.
そして、これらのデータがメモリー上で混在しないように、一方を高位アドレスから配置し、もう一方を低位アドレスから配置するようにしている。こうすることにより、メモリー上での特性(確保されている期間など)が異なるデータ用のメモリー領域を分けることによりメモリーの断片化を低減させている。 In order to prevent these data from being mixed in the memory, one is arranged from the higher address and the other is arranged from the lower address. In this way, memory fragmentation is reduced by dividing memory areas for data having different characteristics (such as reserved periods) on the memory.
また、例えば、特許文献2において開示されている技術では、決められたサイズより小さいメモリーの確保要求に対しては、メモリー空間を低アドレスから高アドレス方向に空き領域をサーチして、使用するメモリーを確保し、決められたサイズのり大きいメモリーの確保要求に対しては、メモリー空間を高アドレスから低アドレス方向に空き領域をサーチして、使用するメモリーを確保する。このことにより、メモリーのフラグメンテーションを抑制している。 Further, for example, in the technique disclosed in Patent Document 2, in response to a request for securing a memory smaller than a predetermined size, a memory space used by searching for a free area from a low address to a high address in the memory space is used. In response to a request for securing a large memory of a predetermined size, the memory space is searched from the high address to the low address direction to secure the memory to be used. This suppresses memory fragmentation.
特許文献3および特許文献4において開示されている技術も、要求されたメモリーのサイズにより、空き領域のサーチ方向を変更する点で、同様である。 The techniques disclosed in Patent Document 3 and Patent Document 4 are the same in that the search direction of the empty area is changed according to the required memory size.
しかし、特許文献1において開示されたデータベース演算処理装置は、データベース内の、実際の処理データおよび処理に必要なパラメーターという限定されたデータに対して、ソートなど限定された処理を行うものであり、汎用性が無かった。 However, the database processing device disclosed in Patent Document 1 performs limited processing such as sorting on limited data such as actual processing data and parameters necessary for processing in the database, There was no versatility.
また、メモリーを使用する一般的な情報処理装置において汎用性を持たせてメモリーの断片化を低減させるという効果を得る為には、メモリーを使用するプログラムのソースコードを改変する手間がかかってしまうという問題があった。逆に言うならば、改変するソースコードを入手できなければ、特許文献1の技術に汎用性を持たせることは出来なかった。 In addition, it takes time and effort to modify the source code of a program that uses memory in order to obtain the effect of reducing the fragmentation of memory in a general information processing device that uses memory. There was a problem. In other words, if the source code to be modified cannot be obtained, the technique of Patent Document 1 could not be made versatile.
また、上記特許文献の技術はいずれも、要求されたメモリーの確保を行う前に、空き領域のサーチ方向を判断する処理が必要であり、その処理がメモリー確保のためのオーバーヘッドとなっていた。
以上のような事情に鑑み、本発明の目的は、メモリーフラグメンテーションを抑えて適切にメモリーを確保するためのオーバーヘッドを軽減できる情報処理装置および当該情報処理装置で稼働するメモリー管理プログラムを提供することにある。
In addition, each of the techniques of the above-mentioned patent documents requires processing for determining the search direction of a free area before securing the requested memory, and this processing is an overhead for securing the memory.
In view of the circumstances as described above, an object of the present invention is to provide an information processing apparatus capable of reducing the overhead for appropriately securing a memory by suppressing memory fragmentation and a memory management program that operates in the information processing apparatus. is there.
上記目的を達成するため、本発明の一形態に係る情報処理装置は、プログラムの作業領域として用いられるメモリーと、第1のモードと第2のモードとの切り替えが可能であり、前記第1のモード時、前記メモリーに常駐する常駐プログラムを検出し、当該常駐プログラムの識別情報を常駐プログラム情報として前記メモリーに記憶させ、前記第2のモード時、かつ前記作業領域の確保方法を切り替える必要がある時、前記作業領域の確保を要求した要求元プログラムが前記常駐プログラムであるか否かを、当該要求元プログラムの識別情報と前記常駐プログラム情報とを比較して判断し、前記常駐プログラムであると判断された前記要求元プログラムの前記作業領域の確保を、前記メモリーの最高位アドレスおよび最低位アドレスのうち、いずれか一方を開始点として開始し、前記常駐プログラム以外であると判断された前記要求元プログラムの前記作業領域の確保を、前記メモリーの最高位アドレスおよび最低位アドレスのうち、前記開始点と反対側を開始点として開始する制御部とを備える。そのため、メモリーフラグメンテーションを抑えて適切にメモリーを確保するためのオーバーヘッドを軽減できる。 In order to achieve the above object, an information processing apparatus according to an aspect of the present invention is capable of switching between a memory used as a work area of a program and a first mode and a second mode. It is necessary to detect a resident program resident in the memory in the mode, store identification information of the resident program in the memory as resident program information, and switch the method for securing the work area in the second mode. And determining whether the request source program that requested the securement of the work area is the resident program by comparing the identification information of the request source program with the resident program information, and Securing the work area of the determined request source program, among the highest address and lowest address of the memory, Starting with either one of them as a starting point, securing the work area of the request source program determined to be other than the resident program is opposite to the starting point of the highest address and the lowest address of the memory And a control unit that starts from the side as a starting point. Therefore, it is possible to reduce the overhead for securing memory appropriately by suppressing memory fragmentation.
上記目的を達成するため、本発明の一形態に係る情報処理装置では、当該情報処理装置が起動してからの経過時間を計測する計時部をさらに備え、前記制御部は、前記作業領域の確保方法を切り替える必要があるか否かを、前記経過時間に基づいて判断する構成でもよい。 In order to achieve the above object, the information processing apparatus according to an aspect of the present invention further includes a time measuring unit that measures an elapsed time since the information processing apparatus is activated, and the control unit secures the work area. It may be configured to determine whether it is necessary to switch the method based on the elapsed time.
上記目的を達成するため、本発明の一形態に係る情報処理装置では、前記メモリーは、前記要求元プログラムが前記常駐プログラムである場合をカウントする常駐カウンターと、前記要求元プログラムが前記常駐プログラム以外である場合をカウントする非常駐カウンターとを記憶し、前記制御部は、前記要求元プログラムが前記常駐プログラムである場合、前記常駐カウンターをインクリメントし、前記非常駐カウンターをクリアし、前記要求元プログラムが前記常駐プログラム以外である場合、前記常駐カウンターをクリアし、前記非常駐カウンターをインクリメントし、前記作業領域の確保方法を切り替える必要があるか否かを、前記非常駐カウンターまたは前記非常駐カウンターの値が特定の値を超えたか否かに基づいて判断する構成でもよい。 In order to achieve the above object, in the information processing apparatus according to an aspect of the present invention, the memory includes a resident counter that counts when the request source program is the resident program, and the request source program is other than the resident program. A non-resident counter that counts the case where the request source program is the resident program, the control unit increments the resident counter, clears the non-resident counter, and the request source program If the program is not a resident program, the non-resident counter or the non-resident counter value indicates whether the resident counter needs to be cleared, the non-resident counter is incremented, and the work area allocation method needs to be switched. Judgment based on whether or not But good.
上記目的を達成するため、本発明の一形態に係るメモリー管理プログラムは、第1のモード時、プログラムの作業領域として用いられるメモリーに常駐する常駐プログラムを検出し、当該常駐プログラムの識別情報を常駐プログラム情報として前記メモリーに記憶させ、第2のモード時、かつ前記作業領域の確保方法を切り替える必要がある時、前記作業領域の確保を要求した要求元プログラムが前記常駐プログラムであるか否かを、当該要求元プログラムの識別情報と前記常駐プログラム情報とを比較して判断し、前記常駐プログラムであると判断された前記要求元プログラムの前記作業領域の確保を、前記メモリーの最高位アドレスおよび最低位アドレスのうち、いずれか一方を開始点として開始し、前記常駐プログラム以外であると判断された前記要求元プログラムの前記作業領域の確保を、前記メモリーの最高位アドレスおよび最低位アドレスのうち、前記開始点と反対側を開始点として開始する手順をコンピューターに実行させる。 In order to achieve the above object, a memory management program according to an embodiment of the present invention detects a resident program residing in a memory used as a work area of the program in the first mode and makes the identification information of the resident program resident. Whether it is stored in the memory as program information and in the second mode, and when the method for securing the work area needs to be switched, whether the request source program that requested the work area is the resident program or not Determining the identification information of the request source program and the resident program information, and securing the work area of the request source program that is determined to be the resident program, the highest address of the memory and the lowest It starts with one of the unit addresses as the starting point and is determined to be other than the resident program. Has been to secure the working area of the requesting program, among the highest address and the lowest address of the memory, to execute a procedure to enter the opposite side of the starting point as the starting point to the computer.
以上のように、本発明によれば、メモリーフラグメンテーションを抑えて適切にメモリーを確保するためのオーバーヘッドを軽減できる。 As described above, according to the present invention, it is possible to reduce the overhead for appropriately securing the memory while suppressing the memory fragmentation.
以下、図面を参照しながら、本発明の実施形態を説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
<第1の実施形態>
[概要]
まず、本実施形態の概要について説明する。本実施形態では、情報処理装置として、主に一般的なコンピューター、特にPC(Personal Computer)を想定している。しかし、これに限らず、例えば画像形成装置(MFP、Multifunction Peripheral)などに組み込まれる制御部であってもよい。
<First Embodiment>
[Overview]
First, an outline of the present embodiment will be described. In this embodiment, a general computer, particularly a PC (Personal Computer) is mainly assumed as the information processing apparatus. However, the present invention is not limited thereto, and may be a control unit incorporated in an image forming apparatus (MFP, Multifunction Peripheral), for example.
本実施形態にかかる情報処理装置は、情報処理装置上で実行されるプログラムを常駐プログラムと非常駐プログラムの2種類に分類し、それぞれの種類ごとに、プログラムが要求する作業領域をメモリー上に確保する場所を分けることにより、メモリーの断片化を低減させる。なお、本明細書で「メモリーを確保する」という場合は、「メモリー上に作業領域を確保する」ことを指す。 The information processing apparatus according to the present embodiment classifies programs executed on the information processing apparatus into two types, resident programs and non-resident programs, and secures a work area required by the program in the memory for each type. Dividing the location reduces memory fragmentation. In this specification, “reserving a memory” indicates “reserving a work area on a memory”.
そして、さらに、プログラムの種類ごとに、プログラムが要求する作業領域をメモリー上に確保する場所を分ける処理が過度のオーバーヘッドとならないように、必要な場合のみ、メモリー上に確保する場所を分ける処理を行うものである。 In addition, for each type of program, a process to divide the location to be secured in memory only when necessary so that the process of allocating the work area required by the program in memory is not excessive overhead. Is what you do.
常駐プログラムではメモリー上に確保された作業領域が情報処理装置の起動から終了までの長期間に亘り使用されるのに対し、非常駐プログラムでは、ユーザーによりそのプログラムが明示的に起動されてから終了されるまでの短時間のみメモリー上に確保された作業領域が使用される。 In the resident program, the work area secured in the memory is used for a long time from the start to the end of the information processing device, whereas in the non-resident program, the program is ended after the program is explicitly started by the user. The work area secured in the memory is used only for a short time until the start.
すなわち、常駐プログラムと非常駐プログラムでは、メモリー上に確保される作業領域が長時間使用されるか、短時間使用されるかの違いがある。本実施形態では、この違いに着目し、常駐プログラムと非常駐プログラムとで、作業領域をメモリー上の異なる領域に確保することで、長時間使用される作業領域の間に短時間で解放される作業領域が挟まれることによる断片化を低減するようにしている。 That is, there is a difference between a resident program and a non-resident program in which a work area secured on a memory is used for a long time or a short time. In this embodiment, paying attention to this difference, work areas that are released in a short time between work areas that are used for a long time by securing work areas in different areas in the memory between resident programs and non-resident programs. Fragmentation due to the region being sandwiched is reduced.
そして、さらに、必要な場合のみ、断片化を低減する処理を行うことにより、メモリー確保の際の全般的なオーバーヘッドを低減させている。 Furthermore, the overall overhead for securing the memory is reduced by performing a process for reducing fragmentation only when necessary.
なお、本実施形態では、非常駐プログラムは、ユーザーの指示などによりプログラムが終了する際、メモリー上に確保し使用していた作業領域を開放することを前提としている。 In the present embodiment, the non-resident program is premised on releasing the work area secured and used on the memory when the program is terminated by a user instruction or the like.
本実施形態の情報処理装置では、まず常駐プログラム検出モード(第1のモード)において常駐プログラムを検出し、常駐プログラムのリスト(常駐プログラム情報)を作成する。そして、常駐プログラム検出モードを終了後、情報処理装置を通常モード(第2のモード)に変更する。 In the information processing apparatus of this embodiment, first, a resident program is detected in the resident program detection mode (first mode), and a list of resident programs (resident program information) is created. Then, after finishing the resident program detection mode, the information processing apparatus is changed to the normal mode (second mode).
通常モードでは、プログラムの種類によりメモリー上に確保する作業領域を分ける必要がある場合に、情報処理装置は作成されたリストに従い、常駐プログラムがメモリー上に確保する作業領域と、非常駐プログラムがメモリー上に確保する作業領域を分けることにより、メモリー上の作業領域の断片化を低減させながら、メモリーを確保する際のオーバーヘッドを低減させる。 In normal mode, when it is necessary to divide the work area to be secured in the memory according to the type of program, the information processing device follows the created list and the work area secured by the resident program in the memory and the non-resident program in the memory. By dividing the work area to be secured, the overhead in securing the memory is reduced while the fragmentation of the work area on the memory is reduced.
なお、常駐プログラム検出モードから通常モードへの移行は、ユーザーからの明示的な指示により情報処理装置のモード設定を変更後、情報処理装置を再起動することにより行われてもよい。 The transition from the resident program detection mode to the normal mode may be performed by restarting the information processing apparatus after changing the mode setting of the information processing apparatus according to an explicit instruction from the user.
以上、本実施形態の概要について説明した。 The outline of the present embodiment has been described above.
[常駐プログラムについて]
ここでは常駐プログラムについて説明する。
[About resident programs]
Here, the resident program will be described.
常駐プログラムとは、情報処理装置が稼働している間、常に実行されているプログラムのことであり、ユーザーが明示的に指示を与えて起動させなくても自動的に起動されるものである。 A resident program is a program that is always executed while the information processing apparatus is in operation, and is automatically started even if the user does not explicitly give an instruction to start the program.
例えば、OS(Operating System)としてウィンドウズ(登録商標)が稼働するPCであれば、表示画面のGUI(Graphical User Interface)の一部として表示されるタスクトレイに一部の常駐プログラムのアイコンが表示される。 For example, in the case of a PC running Windows (registered trademark) as an OS (Operating System), icons of some resident programs are displayed in a task tray displayed as a part of a GUI (Graphical User Interface) on the display screen. .
常駐プログラムの例としては、アンチウイルスソフトウェアやネットワーク経由でメッセージを遣り取りするためのメッセンジャーなどが挙げられる。 Examples of the resident program include anti-virus software and a messenger for exchanging messages via a network.
以上、常駐プログラムについて説明した。 The resident program has been described above.
[常駐プログラムの検出方法について]
ここでは、本実施形態の情報処理装置が行う、常駐プログラムの検出方法について幾つかの具体例を説明する。
[How to detect resident programs]
Here, some specific examples of the resident program detection method performed by the information processing apparatus of the present embodiment will be described.
(方法1)
CPU負荷の変動率から判断する。情報処理装置を起動し、ユーザーから明示的にプログラムを起動する指示は与えず、放置する。そして、一定期間、プログラムが実行されるCPUの負荷の変動率を監視し、その期間における変動率が特定の値以下に保たれたとき、情報処理装置の稼働状態が安定したと判断する。そして、その時点で稼働しているプログラムが常駐プログラムであると判定する。
(Method 1)
Judged from the CPU load fluctuation rate. The information processing apparatus is started and the user is not given an instruction to explicitly start the program, and is left as it is. Then, the fluctuation rate of the load of the CPU on which the program is executed is monitored for a certain period, and when the fluctuation rate in the period is kept below a specific value, it is determined that the operating state of the information processing apparatus is stable. Then, it is determined that the program operating at that time is a resident program.
(方法2)
CPU負荷から判断する。情報処理装置を起動し、ユーザーから明示的にプログラムを起動する指示は与えず、放置する。そして、一定期間、プログラムが実行されるCPUの負荷を監視し、その期間における負荷が特定の値以下に保たれたとき、情報処理装置の稼働状態が安定したと判断する。そして、その時点で稼働しているプログラムが常駐プログラムであると判定する。
(Method 2)
Judged from CPU load. The information processing apparatus is started and the user is not given an instruction to explicitly start the program, and is left as it is. Then, the load of the CPU on which the program is executed is monitored for a certain period, and when the load during the period is kept below a specific value, it is determined that the operating state of the information processing apparatus is stable. Then, it is determined that the program operating at that time is a resident program.
(方法3)
情報処理装置のOSの設定から判断する。情報処理装置の起動時に自動的に起動されるように設定されたプログラムの一覧を、OSの自動起動設定ファイルから取得する。
(Method 3)
This is determined from the OS setting of the information processing apparatus. A list of programs set to be automatically started when the information processing apparatus is started is acquired from the automatic start setting file of the OS.
以上、本実施形態の情報処理装置が行う、常駐プログラムの検出方法について幾つかの具体例を説明した。 Heretofore, some specific examples of the resident program detection method performed by the information processing apparatus of the present embodiment have been described.
[情報処理装置10の構成]
次に、情報処理装置10の構成について説明する。図1は、情報処理装置10として、一般的なコンピューターを用いた場合の構成図である。
[Configuration of Information Processing Apparatus 10]
Next, the configuration of the
図1に示すように、情報処理装置10は、CPU(Central Processing Unit)11(制御部)、ROM(Read Only Memory)12、RAM(Random Access Memory)13(メモリー)、操作入力部14、ネットワークインターフェイス部15、表示部16、記憶部17、および計時部19を有し、これら各ブロックがバス18を介して接続されている。なお、特に断らない限り、本実施形態の説明でメモリーという場合、RAM13のことを指している。
As shown in FIG. 1, an
ROM12は、各種の処理を実行するためのファームウェア等の複数のプログラムやデータを固定的に記憶する。RAM13は、CPU11の作業用領域として用いられ、OS、実行中の各種アプリケーション、処理中の各種データを一時的に保持する。
The
記憶部17は、例えばHDD(Hard Disk Drive)や、フラッシュメモリー、その他の不揮発性メモリーである。記憶部17には、OSや各種アプリケーション、各種データに加え、後述する常駐プログラム情報17aが記憶される。
The
ネットワークインターフェイス部15は、他のシステムと情報のやりとりを行う為のネットワークと結ばれており、他のシステムと情報の遣り取りをしたりする。
The
CPU11は、ROM12や記憶部17に記憶された複数のプログラムのうち、操作入力部14から与えられる命令に対応するプログラムをRAM13に展開し、この展開されたプログラムにしたがって、表示部16及び記憶部17を適宜制御する。
The
また、CPU11は、情報処理装置10が常駐プログラム検出モードにあるとき、常駐プログラムを検出し、検出結果を常駐プログラムの識別子の一覧として、記憶部17へ常駐プログラム情報として格納する。なお、ここでいう識別子とは、プログラム名やプログラムIDなどのことである。
Further, when the
操作入力部14は、例えばマウス等のポインティングデバイス、キーボード、タッチパネル、その他の操作装置である。
The
表示部16は、例えば液晶ディスプレイ、EL(Electro-Luminescence)ディスプレイ、プラズマディスプレイ、CRT(Cathode Ray Tube)ディスプレイ等である。表示部16は、情報処理装置10に内蔵されていてもよいし、外部接続されていてもよい。
The
計時部19は、情報処理装置10が起動されてからの経過時間を計測する。なお、計時部19は、特定のハードウェアとして実現されてもよいし、一般的なコンピューターにハードウェアとして通常備えられているタイマーと、起動時からの経過時間をカウントするプログラムとを用いて実現されてもよい。
The
以上、情報処理装置10の構成について説明した。
The configuration of the
[RAM13上での作業領域を分ける方法について]
ここでは、プログラムからの作業領域確保要求に応じてRAM13上に確保される作業領域を、常駐プログラムと非常駐プログラムとで分ける方法について簡単に説明する。
[Method of dividing work area on RAM 13]
Here, a method of dividing the work area secured on the
なお、本実施形態でいう作業領域とは、プログラムを実行するために必要な命令コードや処理に必要なデータなどが置かれる領域のことである。 Note that the work area in this embodiment is an area in which instruction codes necessary for executing a program, data necessary for processing, and the like are placed.
本発明では、どのような方法によりRAM13上の作業領域を分けてもよいが、本実施形態では特許文献1において開示された技術を応用して作業領域を分ける方法について説明する。
In the present invention, the work area on the
まず、図2において、作業領域が、常駐プログラムのもの(R1、R2、R3)と非常駐プログラムのもの(N1、N2)とで、大きく高位アドレス側と低位アドレス側とに分けられてRAM13上に配置された状態を示す。
First, in FIG. 2, the work area is divided into a high-order address side and a low-order address side in the
図2では、RAM13のメモリーアドレスの最も高位のアドレス(一方の開始点)から常駐プログラムの作業領域R1、R2、およびR3が配置され、メモリーアドレスの最も低位のアドレス(反対側の開始点)から非常駐プログラムの作業領域N1およびN2が配置されている。
In FIG. 2, the work areas R1, R2, and R3 of the resident program are arranged from the highest address (one start point) of the memory address of the
そして、作業領域として確保されていない空き領域F1、F2、F3、F4、およびF5があり、それらの位置は、高位アドレスから順に空き領域の位置を表す空き領域鎖RC1およびRC2と、低位アドレスから順に空き領域の位置を表す空き領域鎖NC1およびNC2により表されている。 Then, there are empty areas F1, F2, F3, F4, and F5 that are not secured as work areas, and their positions are determined from empty area chains RC1 and RC2 that indicate the position of the empty area in order from the higher address, and from the lower address. It is represented by empty area chains NC1 and NC2 that represent the positions of the empty areas in order.
空き領域F3は、高位アドレスから確保された作業領域と低位アドレスから確保された作業領域の中間に位置しており、空き領域鎖RC2およびNC2の両方から指し示された位置にある。 The free area F3 is located between the work area secured from the higher address and the work area secured from the lower address, and is at the position pointed to by both of the free area chains RC2 and NC2.
次に、図2の状態から、さらに常駐プログラム用の作業領域R4を確保した状態を図3に示す。 Next, FIG. 3 shows a state where a work area R4 for the resident program is secured from the state shown in FIG.
図3では、図2に示した空き領域F3の高位アドレス側に、常駐プログラム用の作業領域R4が確保されている。そして、空き領域F3を指し示す空き領域鎖RC2およびNC2に代わり、空き領域鎖RC2'およびNC2'が、新しい空き領域であるF3'を指し示す状態になっている。 In FIG. 3, a work area R4 for a resident program is secured on the higher address side of the free area F3 shown in FIG. Then, instead of the empty area chains RC2 and NC2 indicating the empty area F3, the empty area chains RC2 ′ and NC2 ′ are in a state indicating the new empty area F3 ′.
なお、上述したように、RAM13を2種類に分けて使用する場合は、RAM13のアドレスの両側(最高位アドレスと最低位アドレス)から作業領域を確保していくと、RAM13内を効率的に利用することが出来る。
As described above, when the
しかし、これに限らず、RAM13を3種類以上に分けて使用することも可能である。3種類以上に分ける場合とは、例えば、作業領域が使用される期間を、常駐プログラム用と非常駐プログラム用の2種類に分ける代わりに、期間の長さに応じて3種類以上に分けるような場合である。
However, the present invention is not limited to this, and the
以上、プログラムからの作業領域確保要求に応じてRAM13上に確保される作業領域を、常駐プログラムと非常駐プログラムとで分ける方法について簡単に説明した。
The method for dividing the work area secured on the
[処理の流れについて]
ここでは、本実施形態にかかる情報処理装置10における処理の流れについて説明する。説明は、常駐プログラム検出モードと通常モードに分けて行う。
[Processing flow]
Here, the flow of processing in the
最初に、常駐プログラム検出モードにおける処理の流れを説明する。図4は、常駐プログラム検出モードにおける処理の流れを説明するためのフローチャートである。 First, the flow of processing in the resident program detection mode will be described. FIG. 4 is a flowchart for explaining the flow of processing in the resident program detection mode.
まず、情報処理装置10が常駐プログラム検出モードにて起動される(ステップS10)。起動は、ユーザーによる指示により行われてもよいし、タイマーなどにより自動的に行われてもよい。
First, the
次に、CPU11が、情報処理装置10が安定した状態になった後、常駐プログラムの検出を行う。そして、検出した全ての常駐プログラムの識別情報を常駐プログラム情報17aとして取得する(ステップS11)。なお、常駐プログラムの検出方法は、上述したとおりである。
Next, the
最後に、CPU11が、前ステップで取得した常駐プログラム情報17aを記憶部17に保存する(ステップS12)。
Finally, the
以上が常駐プログラム検出モードにおける処理の流れである。 The above is the flow of processing in the resident program detection mode.
次に、通常モードにおける処理の流れを説明する。なお、以下の説明では、本発明のポイントとなる部分について概略を説明した後、概略に沿った具体例を説明する。図5は、通常モードにおける処理の概略を説明するためのフローチャートである。 Next, the flow of processing in the normal mode will be described. In the following description, after explaining the outline of the point that is the point of the present invention, a specific example along the outline will be described. FIG. 5 is a flowchart for explaining an outline of processing in the normal mode.
まず、CPU11が、プログラムの種類を区別してメモリーを確保する方法を変える必要があるか否かを判断する(ステップS20)。
First, the
メモリーを確保する方法を変える必要がある場合(ステップS20のY)、CPU11は、プログラムの種類、すなわち、常駐プログラムか非常駐プログラムかにより、メモリー確保の方法、すなわち、空きメモリーを低位アドレスのほうから確保するか高位アドレスのほうからを切り替える(ステップS21)。
When it is necessary to change the method for securing the memory (Y in step S20), the
メモリーを確保する方法を変える必要がない場合(ステップS20のN)、CPU11は、プログラムの種類を判断したり、判断結果によりメモリー確保の方法を切り替えたりせず、特定のメモリー確保の方法、例えば低位アドレスのほうから空きメモリーを確保する方法を用いて一律にメモリーを確保する(ステップS22)。
When there is no need to change the method for securing the memory (N in step S20), the
以上、本発明のポイントとなる部分について概略を説明した。 Heretofore, an outline has been given of the parts that are the points of the present invention.
次に、概略に沿った具体例を説明する。図6は、通常モードにおける処理の具体例を説明するためのフローチャートである。 Next, a specific example along the outline will be described. FIG. 6 is a flowchart for explaining a specific example of processing in the normal mode.
まず、あるプログラムからメモリーを確保する要求が出されたものと仮定する。 First, suppose that a program requests memory allocation.
次に、CPU11が、計時部19を参照し、情報処理装置10が起動してから特定の時間が経過したか否かを判断する(ステップS30)。なお、ステップS30が概略で述べたステップS20に相当する部分である。
Next, the
特定の時間がまだ経過していない場合(ステップS30のN)、CPU11は、次に、記憶部17から常駐プログラム情報17aを取得する(ステップS31)。
When the specific time has not yet elapsed (N in Step S30), the
次に、CPU11が、作業領域を要求した要求元のプログラムは常駐プログラムであるか否かを、取得した常駐プログラム情報17aと要求元のプログラムの識別情報とを比較することにより判断する(ステップS32)。
Next, the
要求元プログラムが常駐プログラムである場合(ステップS32のY)、CPU11は、メモリー空間の最高位アドレスから空き領域鎖RC1、RC2を辿って、空き領域(空きメモリー)をサーチする(ステップS33)。
When the request source program is a resident program (Y in step S32), the
要求元プログラムが常駐プログラムではない場合(ステップS32のN)、CPU11は、メモリー空間の最低位アドレスから空き領域鎖NC1、NC2を辿って、空き領域(空きメモリー)をサーチする(ステップS34)。
When the request source program is not a resident program (N in Step S32), the
最後に、CPU11は、サーチ結果として得られた空き領域に、必要なサイズの作業領域を確保する(ステップS35)。
Finally, the
なお、ステップS30において、特定の時間が経過したと判断された場合(ステップS30のY)、CPU11は、例えば、メモリー空間の最低位アドレスから空き領域鎖NC1、NC2を辿って、空き領域(空きメモリー)をサーチし(ステップS36)、サーチ結果として得られた空き領域に、必要なサイズの作業領域を確保する(ステップS35)。
When it is determined in step S30 that the specific time has elapsed (Y in step S30), the
以上が通常モードにおける処理の流れである。 The above is the flow of processing in the normal mode.
なお、上記で説明した特定の時間とは、情報処理装置10の起動時に実行される常駐プログラムが全て起動し終わったことが推定される時間とすることが好ましい。
Note that the specific time described above is preferably a time when it is estimated that all the resident programs executed when the
例えば、情報処理装置10が、画像形成装置の制御部である場合、画像形成装置の起動が完了し、ユーザーが画像形成装置を使える状態になると、画像形成装置の表示パネルに、画像形成装置がレディ状態になったことを示すメッセージが表示される。
For example, when the
そこで、特定の時間が経過したことにより、情報処理装置10の起動完了を判断する代わりに、レディ状態になったことを示すメッセージを表示パネル上に表示するプログラムが実行されたことに基づいて、メモリーを確保する方法を変える必要がないと判断してもよい。
Therefore, based on the fact that a program that displays a message on the display panel indicating that the
なお、上記の説明では、特定の時間が経過すると、常駐プログラムの起動が完了するとして、特定の時間が経過した以降にメモリーを要求するプログラムは非常駐プログラムであろうということを前提にしている。 In the above description, it is assumed that when a specific time has elapsed, the start of the resident program is completed, and a program that requests memory after the specific time has elapsed will be a non-resident program.
また、上記の説明では、メモリーを確保する方法を変える必要がないと判断した場合、最低位のメモリーアドレスから空きメモリーをサーチすることにしているが、逆に、最高位のメモリーアドレスからサーチしてもよい。 Also, in the above explanation, when it is determined that there is no need to change the method of allocating memory, an empty memory is searched from the lowest memory address, but conversely, the search is started from the highest memory address. May be.
ここでのポイントは、メモリーフラグメンテーションを抑制することであり、同じ種類のプログラム(ここでは非常駐プログラム)がメモリーを連続的に確保できさえすれば、そのメモリーが最低位のメモリーアドレスのほうから確保されるか、最高位のメモリーアドレスのほうから確保されるかは問題ではない。 The point here is to suppress memory fragmentation. As long as the same type of program (here non-resident program) can allocate memory continuously, the memory is allocated from the lowest memory address. It does not matter whether it is reserved from the highest memory address.
以上、本実施形態にかかる情報処理装置10における処理の流れについて説明した。
The flow of processing in the
以上、第1の実施形態について説明した。 The first embodiment has been described above.
<第2の実施形態>
次に、第2の実施形態について説明する。第1の実施形態との相違は、第1の実施形態では、メモリーを確保する方法を変える必要があるか否かを判断するために、情報処理装置10の起動時からの経過時間を用いたのに対し、第2の実施形態では、メモリーを要求したプログラムが常駐プログラムか非常駐プログラムかをカウントするカウンターを用いる点である。
<Second Embodiment>
Next, a second embodiment will be described. The difference from the first embodiment is that in the first embodiment, the elapsed time from the start of the
[情報処理装置10'の構成]
まず、情報処理装置10'の構成について説明する。図7は、情報処理装置10'の構成図である。なお、ここでは、第1の実施形態の情報処理装置10と異なる部分のみ説明する。
[Configuration of
First, the configuration of the
情報処理装置10'は、CPU11(制御部)、ROM12、RAM13(メモリー)、操作入力部14、ネットワークインターフェイス部15、表示部16、および記憶部17'を有し、これら各ブロックがバス18を介して接続されている。
The
記憶部17'には、常駐プログラム情報17aに加えて、後述する常駐カウンター17bおよび非常駐カウンター17cが記憶されている。
In addition to the
以上、情報処理装置10'の構成について説明した。
The configuration of the
[処理の流れについて]
次に、情報処理装置10'における処理の流れについて説明する。なお、情報そり装置10'も、情報処理装置10と同様に、常駐プログラム検出モードと通常モードを持つが、常駐プログラム検出モードにおける処理の流れと、通常モードにおける処理の流れの概略は同様なので、説明を省略し、通常モードにおける具体例のみ説明する。
[Processing flow]
Next, the flow of processing in the
図8は、通常モードにおける処理の具体例を説明するためのフローチャートである。 FIG. 8 is a flowchart for explaining a specific example of processing in the normal mode.
なお、フローチャートには図示していないが、常駐カウンター17bおよび非常駐カウンター17cは、情報処理装置10'が通常モードで起動した際に、クリアされている者とする。
Although not shown in the flowchart, it is assumed that the
まず、あるプログラムからメモリーを確保する要求が出されたものと仮定する。 First, suppose that a program requests memory allocation.
次に、CPU11は、常駐カウンター17bまたは非常駐カウンター17cの値が特定の値を超えたか否かを判断する(ステップS40)。なお、ステップS40が概略で述べたステップS20に相当する部分である。
Next, the
いずれのカウンターも特定の値を超えていない場合(ステップS40のN)、CPU11は、次に、記憶部17から常駐プログラム情報17aを取得する(ステップS41)。
If none of the counters exceeds the specific value (N in Step S40), the
次に、CPU11が、作業領域を要求した要求元のプログラムは常駐プログラムであるか否かを、取得した常駐プログラム情報17aと要求元のプログラムの識別情報とを比較することにより判断する(ステップS42)。
Next, the
要求元プログラムが常駐プログラムである場合(ステップS42のY)、CPU11は、メモリー空間の最高位アドレスから空き領域鎖RC1、RC2を辿って、空き領域(空きメモリー)をサーチする(ステップS43)。
When the request source program is a resident program (Y in Step S42), the
次に、CPU11は、常駐カウンター17bをインクリメントする(ステップS44)。
Next, the
次に、CPU11は、非常駐カウンター17cをクリアする(ステップS45)。
Next, the
ステップS42において要求元プログラムが常駐プログラムではない場合(ステップS42のN)、CPU11は、メモリー空間の最低位アドレスから空き領域鎖NC1、NC2を辿って、空き領域(空きメモリー)をサーチする(ステップS46)。
If the request source program is not a resident program in step S42 (N in step S42), the
次に、CPU11は、非常駐カウンター17cをインクリメントする(ステップS47)。
Next, the
次に、CPU11は、常駐カウンター17bをクリアする(ステップS48)。
Next, the
最後に、CPU11は、サーチ結果として得られた空き領域に、必要なサイズの作業領域を確保する(ステップS49)。
Finally, the
なお、ステップS40において、いずれかのカウンターの値が特定の値を超えた場合(ステップS40のY)、CPU11は、例えば、メモリー空間の最低位アドレスから空き領域鎖NC1、NC2を辿って、空き領域(空きメモリー)をサーチし(ステップS50)、サーチ結果として得られた空き領域に、必要なサイズの作業領域を確保する(ステップS49)。
In step S40, if the value of any counter exceeds a specific value (Y in step S40), the
以上が通常モードにおける処理の流れである。 The above is the flow of processing in the normal mode.
なお、上記の処理では、作業領域の要求が、常駐プログラムと非常駐プログラムとから交互になされる状況では、メモリーのフラグメンテーションを抑制するために、メモリーの確保方法を切り替える必要があるという前提に立っている。 Note that the above processing is based on the premise that it is necessary to switch the memory allocation method in order to suppress memory fragmentation in situations where work area requests are made alternately between resident and non-resident programs. Yes.
また、例えば、非常駐カウンターの値が特定の値を超えたことにより、非常駐プログラムによる作業領域の要求がある程度連続してなされていると判断された場合には、常駐プログラムの起動は完了しているとして、次に来る作業領域の要求も非常駐プログラムからのものであると考える。そのため、プログラムの種類によるメモリー確保の方法の切り替えは行わないようにして、メモリー確保時のオーバーヘッドを削減している。 Also, for example, if it is determined that the work area request by the non-resident program has been made to some extent because the value of the non-resident counter exceeds a specific value, the activation of the resident program is completed. Assuming that the next work area request is also from a non-resident program. For this reason, the memory allocation method is not switched depending on the type of program, thereby reducing the overhead during memory allocation.
以上、第2の実施形態について説明した。 The second embodiment has been described above.
[補足事項]
その他、本技術は、上述の実施形態にのみ限定されるものではなく、本技術の要旨を逸脱しない範囲内において種々変更を加え得ることは勿論である。
[Additional notes]
In addition, the present technology is not limited to the above-described embodiment, and various modifications can be made without departing from the scope of the present technology.
10、10'… 情報処理装置
11 … CPU
12 … ROM
13 … RAM
14 … 操作入力部
15 … ネットワークインターフェイス部
16 … 表示部
17、17'… 記憶部
17a… 常駐プログラム情報
17b… 常駐カウンター
17c… 非常駐カウンター
18 … バス
19 … 計時部
10, 10 '...
12… ROM
13 ... RAM
DESCRIPTION OF
Claims (4)
第1のモードと第2のモードとの切り替えが可能であり、
前記第1のモード時、
前記メモリーに常駐する常駐プログラムを検出し、
当該常駐プログラムの識別情報を常駐プログラム情報として前記メモリーに記憶させ、
前記第2のモード時、かつ前記作業領域の確保方法を切り替える必要がある時、
前記作業領域の確保を要求した要求元プログラムが前記常駐プログラムであるか否かを、当該要求元プログラムの識別情報と前記常駐プログラム情報とを比較して判断し、
前記常駐プログラムであると判断された前記要求元プログラムの前記作業領域の確保を、前記メモリーの最高位アドレスおよび最低位アドレスのうち、いずれか一方を開始点として開始し、
前記常駐プログラム以外であると判断された前記要求元プログラムの前記作業領域の確保を、前記メモリーの最高位アドレスおよび最低位アドレスのうち、前記開始点と反対側を開始点として開始する
制御部と
を備えた情報処理装置。 Memory used as a work area for the program,
Switching between the first mode and the second mode is possible,
During the first mode,
Detecting a resident program resident in the memory,
The identification information of the resident program is stored in the memory as resident program information,
When it is necessary to switch the securing method of the work area at the time of the second mode,
It is determined whether the request source program that has requested the securing of the work area is the resident program by comparing the identification information of the request source program with the resident program information,
Securing the work area of the request source program determined to be the resident program starts from one of the highest address and the lowest address of the memory as a starting point,
A control unit that starts securing the work area of the request source program determined to be other than the resident program, starting from a side opposite to the start point of the highest address and the lowest address of the memory; and An information processing apparatus comprising:
当該情報処理装置が起動してからの経過時間を計測する計時部をさらに備え、
前記制御部は、
前記作業領域の確保方法を切り替える必要があるか否かを、前記経過時間に基づいて判断する
情報処理装置。 The information processing apparatus according to claim 1,
It further includes a time measuring unit that measures an elapsed time since the information processing device is activated,
The controller is
An information processing apparatus that determines, based on the elapsed time, whether or not the work area securing method needs to be switched.
前記メモリーは、前記要求元プログラムが前記常駐プログラムである場合をカウントする常駐カウンターと、前記要求元プログラムが前記常駐プログラム以外である場合をカウントする非常駐カウンターとを記憶し、
前記制御部は、
前記要求元プログラムが前記常駐プログラムである場合、前記常駐カウンターをインクリメントし、前記非常駐カウンターをクリアし、
前記要求元プログラムが前記常駐プログラム以外である場合、前記常駐カウンターをクリアし、前記非常駐カウンターをインクリメントし、
前記作業領域の確保方法を切り替える必要があるか否かを、前記常駐カウンターまたは前記非常駐カウンターの値が特定の値を超えたか否かに基づいて判断する
情報処理装置。
The information processing apparatus according to claim 1,
The memory stores a resident counter that counts when the request source program is the resident program, and a non-resident counter that counts when the request source program is other than the resident program,
The controller is
If the requesting program is the resident program, increment the resident counter, clear the non-resident counter,
If the requesting program is other than the resident program, clear the resident counter, increment the non-resident counter,
An information processing apparatus that determines whether or not the work area securing method needs to be switched based on whether a value of the resident counter or the non-resident counter exceeds a specific value.
プログラムの作業領域として用いられるメモリーに常駐する常駐プログラムを検出し、
当該常駐プログラムの識別情報を常駐プログラム情報として前記メモリーに記憶させ、
第2のモード時、かつ前記作業領域の確保方法を切り替える必要がある時、
前記作業領域の確保を要求した要求元プログラムが前記常駐プログラムであるか否かを、当該要求元プログラムの識別情報と前記常駐プログラム情報とを比較して判断し、
前記常駐プログラムであると判断された前記要求元プログラムの前記作業領域の確保を、前記メモリーの最高位アドレスおよび最低位アドレスのうち、いずれか一方を開始点として開始し、
前記常駐プログラム以外であると判断された前記要求元プログラムの前記作業領域の確保を、前記メモリーの最高位アドレスおよび最低位アドレスのうち、前記開始点と反対側を開始点として開始する
手順をコンピューターに実行させるメモリー管理プログラム。 In the first mode,
Detects a resident program that resides in memory used as a work area for the program,
The identification information of the resident program is stored in the memory as resident program information,
In the second mode and when it is necessary to switch the work area securing method,
It is determined whether the request source program that has requested the securing of the work area is the resident program by comparing the identification information of the request source program with the resident program information,
Securing the work area of the request source program determined to be the resident program starts from one of the highest address and the lowest address of the memory as a starting point,
A procedure for starting the securing of the work area of the request source program determined to be other than the resident program, starting from a side opposite to the start point of the highest address and the lowest address of the memory. Memory management program to be executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015016333A JP6354609B2 (en) | 2015-01-30 | 2015-01-30 | Information processing apparatus and memory management program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015016333A JP6354609B2 (en) | 2015-01-30 | 2015-01-30 | Information processing apparatus and memory management program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2016143108A JP2016143108A (en) | 2016-08-08 |
JP6354609B2 true JP6354609B2 (en) | 2018-07-11 |
Family
ID=56570450
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015016333A Expired - Fee Related JP6354609B2 (en) | 2015-01-30 | 2015-01-30 | Information processing apparatus and memory management program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6354609B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2020041713A (en) * | 2018-09-06 | 2020-03-19 | 東芝ライフスタイル株式会社 | refrigerator |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06105440B2 (en) * | 1990-03-08 | 1994-12-21 | 株式会社日立製作所 | Main memory management method |
JPH03273263A (en) * | 1990-03-23 | 1991-12-04 | Ricoh Co Ltd | Control system for image forming device |
JPH04105128A (en) * | 1990-08-24 | 1992-04-07 | Nec Corp | High speed command starting system by residence |
JPH05324431A (en) * | 1992-05-26 | 1993-12-07 | Toshiba Corp | Data processor |
JP2007328628A (en) * | 2006-06-08 | 2007-12-20 | Toshiba Corp | Memory management method, memory management program and information processor |
JP5977778B2 (en) * | 2014-03-27 | 2016-08-24 | 京セラドキュメントソリューションズ株式会社 | Information processing apparatus and memory management method |
-
2015
- 2015-01-30 JP JP2015016333A patent/JP6354609B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2016143108A (en) | 2016-08-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6615726B2 (en) | Information processing apparatus, information processing method, and program | |
CN104077191A (en) | Method and device used for managing memory resources | |
JP2006277062A (en) | Application management device and storage medium storing its software | |
JP5977778B2 (en) | Information processing apparatus and memory management method | |
CN103778007A (en) | Application managing method and device | |
CN104838369A (en) | Dynamic management of cloud computing infrastructure | |
CN103761036A (en) | Method and device for running application | |
WO2016188102A1 (en) | Task processing method and device | |
US20190227621A1 (en) | System management device | |
JP6354609B2 (en) | Information processing apparatus and memory management program | |
JP6879625B2 (en) | Programmable controller, management device and control system | |
CN106155790B (en) | Application program management method and device and terminal | |
US10754547B2 (en) | Apparatus for managing disaggregated memory and method thereof | |
JP4723465B2 (en) | Job allocation program and job allocation method | |
US20180173540A1 (en) | Program execution system and method for launching resident programs | |
EP2775400B1 (en) | Ressource management system a method | |
JP2017204086A (en) | Information processing device, job management method and job management program | |
JP2011186821A (en) | Virtual-environment management system, device, method, and program | |
JPWO2014027444A1 (en) | Scheduling apparatus and scheduling method | |
US20170102987A1 (en) | Device expected state monitoring and remediation | |
US20160292010A1 (en) | Electronic device that ensures simplified competition avoiding control, method and recording medium | |
JP2020027554A (en) | Information processing device and program | |
JP2008129709A (en) | Task control method, data processing system, task control program, and its storage medium | |
JP2018067057A (en) | Verification device and program for control program | |
JP2018185719A (en) | Information processing system and information processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20161226 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20171010 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20171017 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20171201 |
|
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: 20180515 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20180528 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6354609 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |