[go: up one dir, main page]

JP2011221785A - Information processor, memory management method and program - Google Patents

Information processor, memory management method and program Download PDF

Info

Publication number
JP2011221785A
JP2011221785A JP2010090161A JP2010090161A JP2011221785A JP 2011221785 A JP2011221785 A JP 2011221785A JP 2010090161 A JP2010090161 A JP 2010090161A JP 2010090161 A JP2010090161 A JP 2010090161A JP 2011221785 A JP2011221785 A JP 2011221785A
Authority
JP
Japan
Prior art keywords
application
information
memory
memory area
buffer overrun
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.)
Withdrawn
Application number
JP2010090161A
Other languages
Japanese (ja)
Inventor
Hideaki Ogata
英昭 緒方
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2010090161A priority Critical patent/JP2011221785A/en
Publication of JP2011221785A publication Critical patent/JP2011221785A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Memory System (AREA)

Abstract

【課題】確保されたメモリ領域を用いてアプリケーションが所定の機能を実行する情報処理装置であって、バッファオーバーランが発生しづらい環境を容易に提供することのできる情報処理装置等を提供する。
【解決手段】確保されたメモリ領域を用いてアプリケーションがデータ処理を行う情報処理装置が、バッファオーバーランの発生情報であってバッファオーバーランを発生させたアプリケーションの識別情報を含む情報を記憶する記憶手段と、アプリケーションからメモリ領域の確保を要求された際に、当該アプリケーションの識別情報を取得し、当該識別情報を用いて記憶手段に記憶される発生情報を取得し、当該取得した発生情報に基づいて、確保するメモリ領域の容量を決定して当該メモリ領域を確保し、バッファオーバーランを発生した際に、記憶手段に発生情報を記憶させる、メモリ管理手段と、を有する。
【選択図】 図2
An information processing apparatus in which an application performs a predetermined function using a reserved memory area and can easily provide an environment in which a buffer overrun is unlikely to occur.
An information processing apparatus in which an application performs data processing using a reserved memory area stores information that includes information on occurrence of buffer overrun and identification information of the application that has caused the buffer overrun. And when acquisition of the memory area is requested by the means and the application, the identification information of the application is acquired, the generation information stored in the storage means is acquired using the identification information, and based on the acquired generation information A memory management unit that determines the capacity of the memory area to be secured, secures the memory area, and stores the generated information in the storage unit when a buffer overrun occurs.
[Selection] Figure 2

Description

本発明は、確保されたメモリ領域を用いてアプリケーションが所定の機能を実行する情報処理装置等に関し、特に、上記メモリ領域を越えてメモリにアクセスしてしまうバッファオーバーランが発生しづらい環境を容易に提供することのできる情報処理装置等に関する。   The present invention relates to an information processing apparatus or the like in which an application executes a predetermined function using a reserved memory area, and in particular, an environment where it is difficult to generate a buffer overrun that accesses the memory beyond the memory area. The present invention relates to an information processing apparatus and the like that can be provided.

汎用コンピューターや他の装置と協働する専用コンピューターなどにおいては、所定の機能を実現するためにプログラムによる各種アプリケーションが用いられている。かかるアプリケーションは、通常、プログラムの指示に従ったCPUの動作で実行され、その際にはコンピューターが備えるメモリにデータを書き込んで処理を実行する。   In general-purpose computers and dedicated computers that cooperate with other devices, various applications using programs are used to realize predetermined functions. Such an application is normally executed by the operation of a CPU in accordance with an instruction of a program, and in that case, data is written in a memory included in the computer and processing is executed.

そして、その用いるメモリの領域は、アプリケーションがコンピューターのOS(オペレーティングシステム)に要求することによって確保される。その後、アプリケーションは、OSによって割当てられたそのメモリ領域を利用して所定の処理を実行するが、例外的に、割当てられたメモリ領域の境を越えてメモリにアクセスしてしまう場合(ここでは、バッファオーバーランと呼ぶ)が発生する。このような状況が発生した場合には、プログラムが暴走してしまう虞もあるため、通常は、アプリケーションの処理を停止するなどの対応がなされる。   The memory area to be used is secured when an application requests the OS (operating system) of the computer. After that, the application executes a predetermined process using the memory area allocated by the OS, but exceptionally, the application accesses the memory beyond the boundary of the allocated memory area (here, Called buffer overrun). When such a situation occurs, there is a possibility that the program may run away, and usually, countermeasures such as stopping application processing are taken.

例えば、プリンターのコントローラー部においては、プログラム(アプリケーション)に基づく各種の処理がなされるが、扱う画像データが予想外のデータ量になってしまった場合などにこのバッファオーバーランが発生し得る。特に、可変長のデータとして取り扱う処理において発生する虞がある。   For example, in the controller unit of the printer, various processes based on a program (application) are performed, but this buffer overrun may occur when image data to be handled becomes an unexpected amount of data. In particular, there is a risk of this occurring in processing that handles data of variable length.

また、下記特許文献1では、関連技術として、ガベージ・コレクション対応環境において、メモリ使用状況を管理することについて示されている。   Further, Patent Document 1 below discloses management of memory usage in a garbage collection-compatible environment as a related technique.

特開2007−157131号公報JP 2007-157131 A

上述したバッファオーバーランが発生した場合、従来は、そのアプリケーションのプログラムに不具合があるとして、一般にはそのプログラムを修正するという対応が取られていた。かかるプログラムの修正は、通常の場合、ユーザーができるものではなく、また、そのプログラムの提供者にとっても、そのような状況が発生した環境や条件を特定するなどの解析が大変な作業となるため、すぐに問題を解決するのは難しかった。従って、当該アプリケーションを利用するユーザーにとっては不便であった。   When the above-described buffer overrun has occurred, conventionally, it has been generally considered that the program of the application is defective and the program is corrected. In general, such a program cannot be corrected by the user, and the analysis of identifying the environment and conditions in which such a situation has occurred is also a difficult task for the program provider. It was difficult to solve the problem immediately. Therefore, it is inconvenient for a user who uses the application.

そこで、本発明の目的は、確保されたメモリ領域を用いてアプリケーションが所定の機能を実行する情報処理装置であって、メモリ領域を越えてメモリにアクセスしてしまうバッファオーバーランが発生しづらい環境を容易に提供することのできる情報処理装置、等を提供することである。   Therefore, an object of the present invention is an information processing apparatus in which an application executes a predetermined function using a reserved memory area, and an environment in which a buffer overrun that accesses the memory beyond the memory area is difficult to occur. It is to provide an information processing apparatus and the like that can easily provide the information.

上記の目的を達成するために、本発明の一つの側面は、確保されたメモリ領域を用いてアプリケーションがデータ処理を行うことにより所定の機能を実現する情報処理装置が、前記アプリケーションが上記メモリ領域を越えてメモリにアクセスするバッファオーバーランの発生情報であって、前記バッファオーバーランを発生させた前記アプリケーションの識別情報を含む情報を記憶する記憶手段と、前記アプリケーションから前記メモリ領域の確保を要求された際に、当該アプリケーションの識別情報を取得し、当該識別情報を用いて前記記憶手段に記憶される当該アプリケーションが発生させた前記バッファオーバーランの発生情報を取得し、当該取得した発生情報に基づいて、前記確保するメモリ領域の容量を決定して当該メモリ領域を確保し、前記アプリケーションが前記バッファオーバーランを発生させた際に、前記記憶手段に前記発生情報を記憶させる、メモリ管理手段と、を有する、ことである。   In order to achieve the above object, according to one aspect of the present invention, there is provided an information processing apparatus that realizes a predetermined function by performing data processing by an application using a reserved memory area, wherein the application stores the memory area. A buffer overrun occurrence information for accessing the memory beyond the storage area, and storing means for storing information including identification information of the application that has caused the buffer overrun, and requesting to secure the memory area from the application The identification information of the application is acquired, the generation information of the buffer overrun generated by the application stored in the storage unit is acquired using the identification information, and the acquired generation information is included in the acquired generation information. And determining the capacity of the memory area to be secured based on the memory area Secured, when the application generates the buffer overrun, and stores the generated information in the storage means comprises a memory management unit, and it is.

また、上記の発明において、好ましい態様は、前記メモリ管理手段は、前記取得した発生情報が過去に前記バッファオーバーランを発生させたことを示す場合には、前記要求で前記アプリケーションから示される容量よりも大きい容量を前記確保するメモリ領域の容量として決定する、ことを特徴とする。   In the above invention, a preferable aspect is that, when the acquired generation information indicates that the buffer overrun has occurred in the past, the memory management unit uses a capacity indicated by the application in the request. A larger capacity is determined as the capacity of the memory area to be secured.

更に、上記の発明において、好ましい態様は、前記メモリ管理手段は、前記過去に発生させたバッファオーバーランの回数に従って、前記決定する容量を増やす、ことを特徴とする。   Furthermore, in the above invention, a preferred aspect is characterized in that the memory management means increases the determined capacity in accordance with the number of buffer overruns generated in the past.

上記の目的を達成するために、本発明の別の側面は、確保されたメモリ領域を用いてアプリケーションがデータ処理を行うことにより所定の機能を実現する情報処理装置におけるメモリ管理方法において、前記情報処理装置に、制御手段と、前記アプリケーションが上記メモリ領域を越えてメモリにアクセスするバッファオーバーランの発生情報であって、前記バッファオーバーランを発生させた前記アプリケーションの識別情報を含む情報を記憶する記憶手段と、が備えられ、前記制御手段が、前記アプリケーションから前記メモリ領域の確保を要求された際に、当該アプリケーションの識別情報を取得し、当該識別情報を用いて前記記憶手段に記憶される当該アプリケーションが発生させた前記バッファオーバーランの発生情報を取得し、当該取得した発生情報に基づいて、前記確保するメモリ領域の容量を決定して当該メモリ領域を確保する工程と、前記制御手段が、前記アプリケーションが前記バッファオーバーランを発生させた際に、前記記憶手段に前記発生情報を記憶させる工程と、を有する、ことである。   In order to achieve the above object, according to another aspect of the present invention, there is provided a memory management method in an information processing apparatus that realizes a predetermined function by an application performing data processing using a reserved memory area. In the processing device, the control means and information on occurrence of buffer overrun for accessing the memory beyond the memory area by the application and information including identification information of the application causing the buffer overrun are stored. Storage means, and when the control means is requested by the application to secure the memory area, the control means obtains identification information of the application and stores the identification information using the identification information. Acquires the occurrence information of the buffer overrun generated by the application. Determining the capacity of the memory area to be secured based on the acquired occurrence information and securing the memory area; and the control means, when the application causes the buffer overrun, the storage Storing the generated information in a means.

上記の目的を達成するために、本発明の更に別の側面は、確保されたメモリ領域を用いてアプリケーションがデータ処理を行うことにより所定の機能を実現する情報処理装置に、メモリ管理処理を実行させるメモリ管理プログラムにおいて、前記情報処理装置に、前記アプリケーションが上記メモリ領域を越えてメモリにアクセスするバッファオーバーランの発生情報であって、前記バッファオーバーランを発生させた前記アプリケーションの識別情報を含む情報が記憶され、前記アプリケーションから前記メモリ領域の確保を要求された際に、当該アプリケーションの識別情報を取得し、当該識別情報を用いて前記記憶手段に記憶される当該アプリケーションが発生させた前記バッファオーバーランの発生情報を取得し、当該取得した発生情報に基づいて、前記確保するメモリ領域の容量を決定して当該メモリ領域を確保する工程と、前記アプリケーションが前記バッファオーバーランを発生させた際に、前記記憶手段に前記発生情報を記憶させる工程と、を前記情報処理装置に実行させる、ことである。   In order to achieve the above object, according to yet another aspect of the present invention, a memory management process is performed on an information processing apparatus that realizes a predetermined function by performing data processing by an application using a reserved memory area. In the memory management program to be executed, the information processing apparatus includes information on occurrence of a buffer overrun in which the application accesses the memory beyond the memory area, and identification information on the application that has caused the buffer overrun When the information is stored and the memory area is requested by the application, the identification information of the application is obtained, and the buffer generated by the application is stored in the storage unit using the identification information. Acquires the occurrence information of overrun, and the acquired occurrence Determining a capacity of the memory area to be secured based on the information and securing the memory area; and storing the generated information in the storage means when the application generates the buffer overrun And causing the information processing apparatus to execute.

本発明の更なる目的及び、特徴は、以下に説明する発明の実施の形態から明らかになる。   Further objects and features of the present invention will become apparent from the embodiments of the invention described below.

本発明を適用した情報処理装置を備えるプリンターの実施の形態例に係る構成図である。1 is a configuration diagram according to an embodiment of a printer including an information processing apparatus to which the present invention is applied. コントローラー部3におけるアプリケーションの動作を説明するための構成図である。4 is a configuration diagram for explaining an operation of an application in a controller unit 3. FIG. メモリ管理モジュールMMによる処理の手順を例示したフローチャートである。It is the flowchart which illustrated the procedure of the process by the memory management module MM.

以下、図面を参照して本発明の実施の形態例を説明する。しかしながら、かかる実施の形態例が、本発明の技術的範囲を限定するものではない。なお、図において、同一又は類似のものには同一の参照番号又は参照記号を付して説明する。   Embodiments of the present invention will be described below with reference to the drawings. However, such an embodiment does not limit the technical scope of the present invention. In the drawings, the same or similar elements are denoted by the same reference numerals or reference symbols.

図1は、本発明を適用した情報処理装置を備えるプリンターの実施の形態例に係る構成図である。図1に示すコントローラー部3が本発明を適用した情報処理装置であり、当該装置で行われるアプリケーションの処理においてバッファオーバーランが発生した場合にはそれを記録し、そのアプリケーションからのメモリ確保の要求時には、当該記録に基づいて、要求された容量よりも増やした容量を確保するようにして、バッファオーバーランが発生しづらい環境を提供しようとするものである。   FIG. 1 is a configuration diagram according to an embodiment of a printer including an information processing apparatus to which the present invention is applied. The controller unit 3 shown in FIG. 1 is an information processing apparatus to which the present invention is applied. When an overrun occurs in an application process performed by the apparatus, it is recorded and a memory reservation request from the application is recorded. At times, based on the recording, a capacity increased from the requested capacity is secured to provide an environment in which buffer overrun is unlikely to occur.

図1に示すように、本プリンター2は、ホストコンピューター1からの印刷要求に従って印刷を実行する一般的なプリンターであり、そのコントローラー部3が、本発明を適用した情報処理装置の一例である。   As shown in FIG. 1, the printer 2 is a general printer that executes printing according to a print request from the host computer 1, and the controller unit 3 is an example of an information processing apparatus to which the present invention is applied.

ホストコンピューター1は、プリンター2に印刷指示をするプリンター2のホスト装置であり、パーソナルコンピューター等で構成される。図示していないが、ホストコンピューター1は、一般的なコンピューターと同様のハードウェア構成を備えており、CPU、RAM、ROM、ハードディスク、表示装置、入力装置等が備えられる。   The host computer 1 is a host device of the printer 2 that instructs the printer 2 to print, and is configured by a personal computer or the like. Although not shown, the host computer 1 has the same hardware configuration as a general computer, and includes a CPU, a RAM, a ROM, a hard disk, a display device, an input device, and the like.

また、ホストコンピューター1には、上記印刷指示の機能を担うドライバーが備えられ、ユーザーから印刷要求を受けた場合には、各種の印刷条件を含む印刷ジョブデータを生成してプリンター2へ送信する。なお、当該ドライバーは、処理を指示するプログラムと当該プログラムに従って処理を実行する制御装置(上記CPU等)などで構成される。   The host computer 1 is provided with a driver responsible for the print instruction function. When a print request is received from the user, print job data including various printing conditions is generated and transmitted to the printer 2. The driver includes a program that instructs processing, a control device (such as the CPU) that executes processing according to the program, and the like.

プリンター2は、コントローラー部3と印刷実行部4を備える。コントローラー部3は、上記印刷ジョブデータを受信すると、当該データに含まれる画像データに対して各種の処理を実行し、印刷実行部4に転送するデータを生成する。また、コントローラー部3は、ユーザーインターフェース(図示せず)などプリンター2の各部を制御する。   The printer 2 includes a controller unit 3 and a print execution unit 4. When the controller unit 3 receives the print job data, the controller unit 3 executes various processes on the image data included in the data and generates data to be transferred to the print execution unit 4. The controller unit 3 controls each unit of the printer 2 such as a user interface (not shown).

コントローラー部3には、図1に示すように、I/F11、CPU12、ROM13、RAM14、NVRAM15、エンジンI/F16等が備えられる。I/F11は、ホストコンピューター1との通信を司る部分である。CPU12は、ROM13等に格納されるプログラムに従ってコントローラー部3が行なう各種の処理を実行する。RAM14は、印刷対象画像のデータ等を一時的に保持するメモリである。NVRAM15は、不揮発性のメモリであり、プリンター2の電源がオフになっても記憶しておくべき情報を格納する。ここには、後述するバッファオーバーランの履歴情報(発生情報)が記憶される。エンジンI/F16は、最終的に印刷実行部4へ転送するデータを整えてデータを送出する部分である。   As shown in FIG. 1, the controller unit 3 includes an I / F 11, a CPU 12, a ROM 13, a RAM 14, a NVRAM 15, an engine I / F 16, and the like. The I / F 11 is a part that manages communication with the host computer 1. The CPU 12 executes various processes performed by the controller unit 3 in accordance with a program stored in the ROM 13 or the like. The RAM 14 is a memory that temporarily stores data of an image to be printed. The NVRAM 15 is a non-volatile memory, and stores information that should be stored even when the printer 2 is turned off. In this area, buffer overrun history information (occurrence information) described later is stored. The engine I / F 16 is a part that arranges data to be finally transferred to the print execution unit 4 and transmits the data.

なお、上記CPU12がプログラムに従って実行する各機能が、当該コントローラー部
3における各アプリケーションの機能であり、言い換えれば、プログラムによって実行される各機能は、コントローラー部3に備えられる各アプリケーションによって実行され、各アプリケーションは、CPU12とROM13等に格納される対応したプログラムから構成される。そして、各アプリケーションは、処理実行の際にRAM14の割当てられた領域を用いる。
Each function executed by the CPU 12 according to the program is a function of each application in the controller unit 3. In other words, each function executed by the program is executed by each application provided in the controller unit 3. The application is constituted by a corresponding program stored in the CPU 12 and the ROM 13 or the like. Each application uses the allocated area of the RAM 14 when executing the process.

印刷実行部4は、上記転送されるデータに基づいて印刷媒体に印刷を実行する部分である。   The print execution unit 4 is a part that executes printing on a print medium based on the transferred data.

図2は、コントローラー部3におけるアプリケーションの動作を説明するための構成図である。図2においては、上記アプリケーションによるメモリアクセスに関連する部分についてそれらの機能構成を示している。   FIG. 2 is a configuration diagram for explaining the operation of the application in the controller unit 3. FIG. 2 shows the functional configuration of portions related to memory access by the application.

オペレーティングシステムOSは、コンピューターにおける一般的なOSであり、主に、I/O管理、メモリ管理などを司る。オペレーティングシステムOSは、CPU12とROM13に格納されるプログラム等で構成される。   The operating system OS is a general OS in a computer, and mainly manages I / O management, memory management, and the like. The operating system OS is composed of programs stored in the CPU 12 and the ROM 13.

メモリ管理モジュールMMは、本コントローラー部3の特徴部分であり、各アプリケーションAPからのメモリアクセスを仲介する機能を担う。具体的な処理内容は後述するが、アプリケーションAPがバッファオーバーランを起こした場合には、それをNVRAM15に記録し、アプリケーションAPからメモリ確保の要求を受けた場合には、当該記録に基づいて過去のバッファオーバーランの履歴からメモリ確保量を決定してオペレーティングシステムOSにメモリ確保の要求を行なう。なお、メモリ管理モジュールMMは、CPU12とROM13に格納されるプログラム等で構成される。   The memory management module MM is a characteristic part of the controller unit 3 and has a function of mediating memory access from each application AP. Specific processing contents will be described later, but when the application AP has caused a buffer overrun, it is recorded in the NVRAM 15, and when a request for securing the memory is received from the application AP, the past is based on the record. The memory securing amount is determined from the history of the buffer overrun and the operating system OS is requested to secure the memory. Note that the memory management module MM includes a program stored in the CPU 12 and the ROM 13.

アプリケーションAPは、上述したコントローラー部3のアプリケーションであり、メモリMEを用いて各機能を実行する。例えば、印刷対象画像を画素単位の画像データにする展開処理等の機能を担う。   The application AP is an application of the controller unit 3 described above, and executes each function using the memory ME. For example, it performs functions such as a development process for converting a print target image into image data in pixel units.

メモリMEは、ここでは上記RAM14であり、アプリケーションAPが処理を実行する際に、オペレーティングシステムOSがここにそのための領域を割当て、その領域にデータが書き込まれる。   The memory ME is the RAM 14 here, and when the application AP executes a process, the operating system OS allocates an area for this purpose, and data is written in the area.

以上説明したような構成を有する本プリンター2では、上述のように、コントローラー部3でのメモリ確保に特徴があり、以下、その具体的な内容について説明する。図3は、メモリ管理モジュールMMによる処理の手順を例示したフローチャートである。ここでは、アプリケーションAPからメモリ確保の要求を受けた際の一連の処理内容について説明する。   As described above, the printer 2 having the configuration as described above has a feature in securing the memory in the controller unit 3, and the specific contents thereof will be described below. FIG. 3 is a flowchart illustrating an example of a processing procedure performed by the memory management module MM. Here, a series of processing contents when a memory securing request is received from the application AP will be described.

アプリケーションAPが処理を実行する際には、メモリMEに自分が使用する所定容量の領域を確保する必要があるので、その旨の要求をメモリ管理モジュールMMに行う。当該要求は、従来装置においてはOSに対してなされるが、ここでは、メモリ確保を仲介するメモリ管理モジュールMMに対してなされるように当該アプリケーションAPのプログラムで定められている。また、要求される確保量も当該アプリケーションAPのプログラムで決定される。   When the application AP executes the process, it is necessary to secure a predetermined capacity area for use in the memory ME, and a request to that effect is sent to the memory management module MM. The request is made to the OS in the conventional apparatus, but here, it is determined by the program of the application AP to be made to the memory management module MM that mediates memory reservation. Further, the required secured amount is also determined by the program of the application AP.

当該要求が出されると、その要求をメモリ管理モジュールMMが受信する(図3のステップS1)。この際、メモリ管理モジュールMMは、当該受信した情報から要求されたメモリ確保量の情報を取得すると共に、要求元のアプリケーションAPの識別情報(アプリケーションID)を取得する。当該アプリケーションIDは、他のアプリケーションAP
と当該アプリケーションAPを区別できる情報であり、上記要求に含まれていても良いし、そのアプリケーションAPのプログラムがロードされたメモリME上のアドレスが固定であればそのアドレスをアプリケーションIDとして取得しても良い。
When the request is issued, the memory management module MM receives the request (step S1 in FIG. 3). At this time, the memory management module MM acquires the requested memory allocation amount information from the received information and also acquires the identification information (application ID) of the requesting application AP. The application ID is another application AP
And the application AP may be included in the request, and if the address on the memory ME loaded with the application AP program is fixed, the address is acquired as an application ID. Also good.

次に、メモリ管理モジュールMMは、NVRAM15に記憶された上記バッファオーバーランの履歴情報(発生情報)を参照する(ステップS2)。当該バッファオーバーランの履歴情報は、後述するメモリ管理モジュールMMの処理により、バッファオーバーランが発生する度に記録されるものであり、少なくとも、バッファオーバーランを起こしたアプリケーションAPの上記アプリケーションIDを含み、時系列に記録される。従って、当該履歴情報を参照することで、今回メモリ確保要求をしてきたアプリケーションAPが過去に起こしたバッファオーバーランの回数を知ることができる。なお、当該履歴情報に、バッファオーバーランを発生した日時の情報を含めても良い。   Next, the memory management module MM refers to the buffer overrun history information (occurrence information) stored in the NVRAM 15 (step S2). The buffer overrun history information is recorded each time a buffer overrun occurs by the processing of the memory management module MM described later, and includes at least the application ID of the application AP that has caused the buffer overrun. , Recorded in time series. Therefore, by referring to the history information, it is possible to know the number of buffer overruns that have occurred in the past by the application AP that has requested memory allocation this time. The history information may include information on the date and time when the buffer overrun occurred.

メモリ管理モジュールMMは、上記履歴情報の参照により、上記取得した要求元のアプリケーションAPのアプリケーションIDから、当該アプリケーションAPの履歴情報を抽出(取得)し、当該アプリケーションAPが起こした過去のバッファオーバーランの回数を取得する。   The memory management module MM extracts (acquires) the history information of the application AP from the acquired application ID of the requesting application AP by referring to the history information, and the past buffer overrun caused by the application AP. Get the number of times.

次に、メモリ管理モジュールMMは、当該取得した回数に基づいてオペレーティングシステムOSに要求するメモリ確保量を決定する(ステップS3)。当該メモリ確保量の決定は、過去にバッファオーバーランを起こしている場合に、すなわち、当該取得した回数が1以上である場合に、アプリケーションAPから要求された上述の確保量よりも大きい量になるように行う。具体的には、いくつかの方法で行うことができるが、一例としては、過去のバッファオーバーランの回数が多いほど要求するメモリ確保量を多くする様に行う。この場合、例えば、上記回数が0であれば、アプリケーションAPから要求されたとおりの確保量に決定し、上記回数が1であれば、アプリケーションAPから要求された確保量の1.5倍に決定し、上記回数が2であれば、更にその1.5倍に決定し、以降、同様に、回数が増える度に同じ倍率で増やす様に決定する。あるいは、上記回数が増える度に、アプリケーションAPから要求された確保量の所定割合(例えば、50%)の量が増えるように決定する。   Next, the memory management module MM determines a memory reservation amount requested from the operating system OS based on the acquired number of times (step S3). The determination of the memory allocation amount is larger than the above-described allocation amount requested by the application AP when a buffer overrun has occurred in the past, that is, when the number of times of acquisition is 1 or more. Do as follows. Specifically, it can be performed by several methods, but as an example, the larger the number of past buffer overruns, the larger the required memory allocation. In this case, for example, if the number of times is 0, the secured amount as requested from the application AP is determined, and if the number of times is 1, it is determined to be 1.5 times the secured amount requested from the application AP. If the number of times is 2, it is further determined to be 1.5 times, and thereafter, similarly, every time the number of times increases, it is determined to increase at the same magnification. Alternatively, each time the number of times increases, the predetermined amount (for example, 50%) of the secured amount requested from the application AP is determined to increase.

また、他の方法としては、上記取得された回数が0であれば、アプリケーションAPから要求されたとおりの確保量に決定し、上記回数が1以上であれば、いずれの場合にも、アプリケーションAPから要求された確保量を所定割合で増加させた量に決定する。この場合には、上記履歴情報として、過去にバッファオーバーランを起こしたアプリケーションAPについてはそのアプリケーションIDを1回記録しておけば良い。   As another method, if the number of times acquired is 0, the secured amount is determined as requested by the application AP. If the number of times is 1 or more, the application AP is used in any case. The secured amount requested from is determined to be an amount increased by a predetermined rate. In this case, as the history information, the application ID of the application AP that has caused a buffer overrun in the past may be recorded once.

また、上記履歴情報において所定期間以上前の情報は、上記回数に入れないようにしても良い。すなわち、一定期間以上前に発生した古いバッファオーバーランの記録は考慮しないようにしても良い。これは、当該アプリケーションAPのプログラムについて修正が行なわれており、そのような古い情報がその時点での当該プログラムの状態を示すものではなくなっている可能性があるからである。   In addition, information that is more than a predetermined period in the history information may not be included in the number of times described above. That is, it is possible not to consider the recording of old buffer overruns that occurred before a certain period. This is because the program of the application AP has been corrected, and such old information may not indicate the state of the program at that time.

その後、メモリ管理モジュールMMは、当該決定したメモリ量の確保をオペレーティングシステムOSに対して行なう(ステップS4)。当該要求を受けてオペレーティングシステムOSは、メモリMEに要求された量の領域を割り当てる処理を実行し、その領域が確保されるとその旨をメモリ管理モジュールMMに通知する。   Thereafter, the memory management module MM secures the determined memory amount for the operating system OS (step S4). In response to the request, the operating system OS executes a process of allocating the requested amount of area to the memory ME, and notifies the memory management module MM of the fact when the area is secured.

当該通知を受信したメモリ管理モジュールMMは、そのメモリ確保の結果を上記要求元のアプリケーションAPに通知する(ステップS5)。この際、オペレーティングシステ
ムOSから確保した領域のアドレスが通知されるので、そのアドレスを当該アプリケーションAPに知らせる。
The memory management module MM that has received the notification notifies the requesting application AP of the memory allocation result (step S5). At this time, since the address of the reserved area is notified from the operating system OS, the address is notified to the application AP.

なお、オペレーティングシステムOSが要求された量のメモリを割り当てできない場合には、エラーとして処理がなされ、当該メモリ確保要求の一連の処理も終了する。   Note that if the operating system OS cannot allocate the requested amount of memory, it is processed as an error, and a series of processing for the memory securing request ends.

上記通知の後、上記要求元のアプリケーションAPは、メモリが確保されたので、実際の処理を開始し、確保されたメモリ領域を用いるべくメモリアクセスを行なう。このメモリアクセスも、本コントローラー部3では、メモリ管理モジュールMMを介して行われるので、メモリ管理モジュールMMに対して要求がなされるようにプログラムされている。   After the notification, since the memory of the requesting application AP has been secured, the requesting application AP starts actual processing and performs memory access to use the secured memory area. Since this memory access is also performed in the controller unit 3 via the memory management module MM, it is programmed to make a request to the memory management module MM.

メモリ管理モジュールMMは、当該メモリアクセス要求を受けると(ステップS6のYes)、上述した場合と同様の方法で要求元のアプリケーションAPのアプリケーションIDを取得し、その後、要求されたメモリアクセスを実施する(ステップS7)。すなわち、メモリMEの割り当てられた領域にデータを書き込む。   When the memory management module MM receives the memory access request (Yes in step S6), the memory management module MM acquires the application ID of the requesting application AP in the same manner as described above, and then performs the requested memory access. (Step S7). That is, data is written in the allocated area of the memory ME.

ここで、メモリ管理モジュールMMは、当該メモリアクセスによるバッファオーバーランの発生(ステップS8)、メモリ解放の指示(ステップS9)、あるいは、次のメモリアクセス要求(ステップS6)を待つ。   Here, the memory management module MM waits for occurrence of a buffer overrun due to the memory access (step S8), a memory release instruction (step S9), or a next memory access request (step S6).

もし当該メモリアクセスによるバッファオーバーランの発生があった場合には(ステップS8のYes)、そのことがオペレーティングシステムOSによって検知され、メモリ管理モジュールMMは、当該発生したバッファオーバーランについて上記履歴情報に記録する(ステップS11)。具体的には、NVRAM15にアクセスして、上記要求元の上記取得したアプリケーションIDを所定の情報と共に記録する。なお、オペレーティングシステムOSによって上記バッファオーバーランが検知された場合には、割り込み処理として処理がメモリ管理モジュールMMに移行するように予め設定されている。具体的には、割り込みベクターテーブルの当該箇所にメモリ管理モジュールMMのプログラムのアドレスが設定されている。   If a buffer overrun has occurred due to the memory access (Yes in step S8), this is detected by the operating system OS, and the memory management module MM adds to the history information the buffer overrun that has occurred. Record (step S11). Specifically, the NVRAM 15 is accessed and the acquired application ID of the request source is recorded together with predetermined information. Note that, when the buffer overrun is detected by the operating system OS, it is set in advance so that the process shifts to the memory management module MM as an interrupt process. Specifically, the address of the program of the memory management module MM is set in the corresponding part of the interrupt vector table.

この場合には、その後、アプリケーションAPによる処理が停止され、メモリ管理モジュールMMによる当該メモリ確保の一連の処理が終了する。   In this case, thereafter, the processing by the application AP is stopped, and the series of processing for securing the memory by the memory management module MM is completed.

また、もしバッファオーバーランの発生せずに次のメモリアクセス要求を受けた場合には(ステップS8のNo及びS9のNo、S6のYes)、上述したステップS7の処理から実行される。   If the next memory access request is received without occurrence of buffer overrun (No in step S8, No in S9, Yes in S6), the process is executed from the above-described process in step S7.

また、もし上記アクセス要求をしたアプリケーションAPからメモリ解放の要求を受けた場合には(ステップS9のYes)、メモリ管理モジュールMMは、メモリMEの上記割り当てられた領域を解放する。なお、上記解放要求もメモリ管理モジュールMMになされるようにアプリケーションAPにおいてプログラムされている。かかる解放処理がなされると、メモリ管理モジュールMMによる当該メモリ確保の一連の処理が終了する。   If a memory release request is received from the application AP that has made the access request (Yes in step S9), the memory management module MM releases the allocated area of the memory ME. The release request is also programmed in the application AP so as to be made to the memory management module MM. When such release processing is performed, a series of processing for securing the memory by the memory management module MM ends.

以上説明したように、メモリ管理モジュールMMによるメモリ確保の処理がアプリケーションAPから要求がなされる度に実行される。   As described above, the memory securing process by the memory management module MM is executed every time a request is made from the application AP.

このように本実施の形態例に係るコントローラー部3では、アプリケーションAPからメモリ確保の要求がなされた場合に、メモリ管理モジュールMMが、そのアプリケーションAPによって過去にバッファオーバーランが発生している場合には、要求された容量よりも大きい容量のメモリ領域を確保するようにし、また、そのようなメモリ確保を行なう
ために、バッファオーバーランが発生した場合には、その記録を残すようにする。従って、アプリケーションAPが用いられる場合に、過去にバッファオーバーランを起こしたアプリケーションAPの場合には、メモリ管理モジュールMMによって自動的に確保するメモリ容量が増えるように調整され、バッファオーバーランを起こす可能性が低くなる。よって、アプリケーションが停止してしまう回数も減り、ユーザー利便性が向上する。また、そのアプリケーションAPのプログラム修正を直ぐに行なわなくてもバッファオーバーランに対する対処が可能となる。また、過去のバッファオーバーランの回数により、確保するメモリ容量を順次増やすことにより、さらに、バッファオーバーランを起こす可能性が低くなる。
As described above, in the controller unit 3 according to the present embodiment, when a memory allocation request is made from an application AP, the memory management module MM has received a buffer overrun in the past by the application AP. In this case, a memory area having a capacity larger than the requested capacity is secured, and if a buffer overrun occurs in order to secure such a memory, the record is left. Therefore, when an application AP is used, in the case of an application AP that has caused buffer overrun in the past, the memory capacity automatically secured by the memory management module MM is adjusted so as to increase, and buffer overrun may occur. Low. Therefore, the number of times the application is stopped is reduced, and user convenience is improved. Further, it is possible to cope with a buffer overrun without immediately modifying the program of the application AP. Further, by sequentially increasing the memory capacity to be secured according to the number of past buffer overruns, the possibility of causing a buffer overrun is further reduced.

なお、上記実施形態では、メモリ管理モジュールMMをソフトウェアで実現したが、当該モジュールと同様の機能またはその機能の一部を、MMU等のハードウェアで実現しても良い。   In the above embodiment, the memory management module MM is realized by software. However, a function similar to the module or a part of the function may be realized by hardware such as an MMU.

なお、上記実施形態では、本発明を適用した情報処理装置がプリンター内のコントローラー部であったが、本発明は汎用コンピューターなど他の情報処理装置に適用することができる。パーソナルコンピューターなど多目的で用いられる汎用の環境に適用する場合には、上記メモリ管理モジュールMMと同様のモジュールを起動させた際に、バッファオーバーランが起こった際の割り込み処理として当該モジュールに処理が移行するように、当該モジュールが設定を書き換えるようにすることによって、上記実施形態と同様の処理を実行することができる。また、アプリケーション側では、当該モジュールを用いるものについては、メモリ確保要求、メモリアクセス要求を当該モジュールに対して行うようにプログラムし、当該モジュールを用いないアプリケーションについては、従来通り、OSに対してメモリ確保要求等を行うようにする。   In the above embodiment, the information processing apparatus to which the present invention is applied is the controller unit in the printer, but the present invention can be applied to other information processing apparatuses such as a general-purpose computer. When applied to a general purpose environment such as a personal computer, when the same module as the memory management module MM is activated, the process is transferred to the module as an interrupt process when a buffer overrun occurs. As described above, when the module rewrites the setting, the same processing as that in the above embodiment can be executed. On the application side, programs that use the module are programmed to issue a memory allocation request and memory access request to the module, and applications that do not use the module use the memory for the OS as before. Make a secure request.

本発明の保護範囲は、上記の実施の形態に限定されず、特許請求の範囲に記載された発明とその均等物に及ぶものである。   The protection scope of the present invention is not limited to the above-described embodiment, but covers the invention described in the claims and equivalents thereof.

1 ホストコンピューター、 2 プリンター、 3 コントローラー部、 4 印刷実行部、 11 I/F、 12 CPU(制御手段)、 13 ROM、 14 RAM、 15 NVRAM(記憶手段)、 16 エンジンI/F、 OS オペレーティングシステム、 MM メモリ管理モジュール(メモリ管理手段)、 AP アプリケーション、 ME メモリ   DESCRIPTION OF SYMBOLS 1 Host computer, 2 Printer, 3 Controller part, 4 Print execution part, 11 I / F, 12 CPU (control means), 13 ROM, 14 RAM, 15 NVRAM (storage means), 16 Engine I / F, OS operating system MM memory management module (memory management means) AP application ME memory

Claims (5)

確保されたメモリ領域を用いてアプリケーションがデータ処理を行うことにより所定の機能を実現する情報処理装置であって、
前記アプリケーションが上記メモリ領域を越えてメモリにアクセスするバッファオーバーランの発生情報であって、前記バッファオーバーランを発生させた前記アプリケーションの識別情報を含む情報を記憶する記憶手段と、
前記アプリケーションから前記メモリ領域の確保を要求された際に、当該アプリケーションの識別情報を取得し、当該識別情報を用いて前記記憶手段に記憶される当該アプリケーションが発生させた前記バッファオーバーランの発生情報を取得し、当該取得した発生情報に基づいて、前記確保するメモリ領域の容量を決定して当該メモリ領域を確保し、
前記アプリケーションが前記バッファオーバーランを発生させた際に、前記記憶手段に前記発生情報を記憶させる、メモリ管理手段と、を有する
ことを特徴とする画像処理装置。
An information processing apparatus that realizes a predetermined function by an application performing data processing using a reserved memory area,
Storage means for storing information including occurrence information of a buffer overrun in which the application accesses the memory beyond the memory area and including identification information of the application that has caused the buffer overrun;
When the application requests to secure the memory area, the buffer overrun occurrence information generated by the application that acquires the identification information of the application and is stored in the storage unit using the identification information And determining the capacity of the memory area to be secured based on the obtained occurrence information to secure the memory area,
An image processing apparatus comprising: memory management means for storing the generated information in the storage means when the application generates the buffer overrun.
請求項1において、
前記メモリ管理手段は、前記取得した発生情報が過去に前記バッファオーバーランを発生させたことを示す場合には、前記要求で前記アプリケーションから示される容量よりも大きい容量を前記確保するメモリ領域の容量として決定する
ことを特徴とする画像処理装置。
In claim 1,
The memory management means, when the obtained occurrence information indicates that the buffer overrun has occurred in the past, the capacity of the memory area to secure the capacity larger than the capacity indicated by the application in the request An image processing apparatus characterized by determining as follows.
請求項2において、
前記メモリ管理手段は、前記過去に発生させたバッファオーバーランの回数に従って、前記決定する容量を増やす
ことを特徴とする画像処理装置。
In claim 2,
The memory processing unit increases the capacity to be determined according to the number of buffer overruns generated in the past.
確保されたメモリ領域を用いてアプリケーションがデータ処理を行うことにより所定の機能を実現する情報処理装置におけるメモリ管理方法であって、
前記情報処理装置に、制御手段と、前記アプリケーションが上記メモリ領域を越えてメモリにアクセスするバッファオーバーランの発生情報であって、前記バッファオーバーランを発生させた前記アプリケーションの識別情報を含む情報を記憶する記憶手段と、が備えられ、
前記制御手段が、前記アプリケーションから前記メモリ領域の確保を要求された際に、当該アプリケーションの識別情報を取得し、当該識別情報を用いて前記記憶手段に記憶される当該アプリケーションが発生させた前記バッファオーバーランの発生情報を取得し、当該取得した発生情報に基づいて、前記確保するメモリ領域の容量を決定して当該メモリ領域を確保する工程と、
前記制御手段が、前記アプリケーションが前記バッファオーバーランを発生させた際に、前記記憶手段に前記発生情報を記憶させる工程と、を有する
ことを特徴とするメモリ管理方法。
A memory management method in an information processing apparatus for realizing a predetermined function by an application performing data processing using a reserved memory area,
In the information processing apparatus, control means and information on occurrence of buffer overrun in which the application accesses the memory beyond the memory area, the information including identification information of the application that has caused the buffer overrun. Storage means for storing, and
The buffer generated by the application that acquires the identification information of the application when the control unit is requested by the application to secure the memory area and that is stored in the storage unit using the identification information Obtaining overrun occurrence information, determining the capacity of the memory area to be secured based on the obtained occurrence information, and securing the memory area;
The control means includes a step of storing the generation information in the storage means when the application causes the buffer overrun. The memory management method, comprising:
確保されたメモリ領域を用いてアプリケーションがデータ処理を行うことにより所定の機能を実現する情報処理装置に、メモリ管理処理を実行させるメモリ管理プログラムであって、
前記情報処理装置に、前記アプリケーションが上記メモリ領域を越えてメモリにアクセスするバッファオーバーランの発生情報であって、前記バッファオーバーランを発生させた前記アプリケーションの識別情報を含む情報が記憶され、
前記アプリケーションから前記メモリ領域の確保を要求された際に、当該アプリケーションの識別情報を取得し、当該識別情報を用いて前記記憶手段に記憶される当該アプリケーションが発生させた前記バッファオーバーランの発生情報を取得し、当該取得した発生
情報に基づいて、前記確保するメモリ領域の容量を決定して当該メモリ領域を確保する工程と、
前記アプリケーションが前記バッファオーバーランを発生させた際に、前記記憶手段に前記発生情報を記憶させる工程と、を前記情報処理装置に実行させる
ことを特徴とするメモリ管理プログラム。
A memory management program for causing an information processing apparatus that implements a predetermined function by performing data processing using an allocated memory area to execute a memory management process,
In the information processing apparatus, information on occurrence of a buffer overrun in which the application accesses the memory beyond the memory area, and information including identification information of the application that has caused the buffer overrun is stored.
When the application requests to secure the memory area, the buffer overrun occurrence information generated by the application that acquires the identification information of the application and is stored in the storage unit using the identification information And determining the capacity of the memory area to be secured based on the obtained occurrence information and securing the memory area;
A memory management program that causes the information processing apparatus to execute a step of storing the generated information in the storage means when the application generates the buffer overrun.
JP2010090161A 2010-04-09 2010-04-09 Information processor, memory management method and program Withdrawn JP2011221785A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010090161A JP2011221785A (en) 2010-04-09 2010-04-09 Information processor, memory management method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010090161A JP2011221785A (en) 2010-04-09 2010-04-09 Information processor, memory management method and program

Publications (1)

Publication Number Publication Date
JP2011221785A true JP2011221785A (en) 2011-11-04

Family

ID=45038700

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010090161A Withdrawn JP2011221785A (en) 2010-04-09 2010-04-09 Information processor, memory management method and program

Country Status (1)

Country Link
JP (1) JP2011221785A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019139330A (en) * 2018-02-06 2019-08-22 富士通株式会社 Memory management program, memory management method and memory management device
JP2019161557A (en) * 2018-03-15 2019-09-19 株式会社東芝 Encryption communication apparatus, encryption communication system, encryption communication method, and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019139330A (en) * 2018-02-06 2019-08-22 富士通株式会社 Memory management program, memory management method and memory management device
JP7000892B2 (en) 2018-02-06 2022-01-19 富士通株式会社 Memory management program, memory management method, and memory management device
JP2019161557A (en) * 2018-03-15 2019-09-19 株式会社東芝 Encryption communication apparatus, encryption communication system, encryption communication method, and program

Similar Documents

Publication Publication Date Title
JP5708049B2 (en) Information processing apparatus, control method, control program, and recording medium
JP4886866B2 (en) Method for speeding up access to main storage device and storage device system
US20130097358A1 (en) Method for sharing memory of virtual machine and computer system using the same
US9542228B2 (en) Image processing apparatus, control method thereof and storage medium
JP5832556B2 (en) Image processing apparatus and image forming apparatus
JP5338435B2 (en) Information processing program, information processing apparatus, and information processing method
US20180173473A1 (en) Method for operating a print server for digital high-capacity printing systems
US20150134892A1 (en) Information processing apparatus, method of controlling the same, and storage medium
US7911639B2 (en) Image forming device
US10303404B2 (en) Method for operating a print server for digital high-capacity printing systems
JP2011221785A (en) Information processor, memory management method and program
JPWO2010032330A1 (en) Information processing apparatus and memory protection method thereof
US8239634B2 (en) Input/output control based on information specifying input/output issuing source and input/output priority
US9552170B2 (en) Memory managing apparatus and image processing apparatus
JP6358330B2 (en) Information processing apparatus, information processing system, memory management method, and memory management program
JP4311386B2 (en) File operation restriction system, file operation restriction program, file operation restriction method, electronic apparatus, and printing apparatus
JP6090057B2 (en) Status information recording apparatus and program
US20160205275A1 (en) Image forming apparatus
JP2007323393A (en) Image processing apparatus and program
WO2009104720A1 (en) Resource usage control system, method of controlling resource usage, program for controlling resource usage
US20120166606A1 (en) Distributed file operation apparatus, distributed file operation method, and non-transitory computer-readable medium storing distributed file operation program
US9361305B2 (en) Image forming apparatus having a file system
JP2012008838A (en) Print document conversion device and program
JP2004272479A (en) Information processor, image forming device, swap-out control method, program therefor, and recording medium recorded with program
JP2018049511A (en) Information processing device and program

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20130702