JP2011175395A - Information processor, image reading device, portable terminal, memory control method for information processor, and program - Google Patents

Information processor, image reading device, portable terminal, memory control method for information processor, and program Download PDF

Info

Publication number
JP2011175395A
JP2011175395A JP2010038154A JP2010038154A JP2011175395A JP 2011175395 A JP2011175395 A JP 2011175395A JP 2010038154 A JP2010038154 A JP 2010038154A JP 2010038154 A JP2010038154 A JP 2010038154A JP 2011175395 A JP2011175395 A JP 2011175395A
Authority
JP
Japan
Prior art keywords
memory
application
area
securing
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2010038154A
Other languages
Japanese (ja)
Inventor
Shigeru Tadokoro
茂 田所
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.)
Canon Electronics Inc
Original Assignee
Canon Electronics Inc
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 Canon Electronics Inc filed Critical Canon Electronics Inc
Priority to JP2010038154A priority Critical patent/JP2011175395A/en
Publication of JP2011175395A publication Critical patent/JP2011175395A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Memory System (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To suppress the performance deterioration of an application by reducing the number of times of the memory securing processing and memory releasing processing of an operation system whose memory securing processing and memory releasing processing is relatively slow, and reducing the stand-by time of the application. <P>SOLUTION: A memory management mechanism 50 to be executed by the control part of an information processor secures a memory region with a prescribed capacity by making the memory securing request of the prescribed capacity to an operation system (virtual memory management module 43) in response to the first memory securing request from the application 44, and assigns an unused region in the secured memory region to the application 44 in response to a memory securing request from the application 44, and releases assignment to the application 44 with respect to the region whose release request has been made from the application 44 in response to a memory release request from the application 44, and performs assignment to the application 44 again. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、メモリ確保要求を受けた際に物理メモリ領域の確保を行い、メモリ解放要求を受けた際に前記確保した物理メモリ領域の解放を行うオペレーティングシステムで動作する情報処理装置のメモリ制御に関する。   The present invention relates to memory control of an information processing apparatus operating in an operating system that secures a physical memory area when receiving a memory securing request and releases the secured physical memory area when receiving a memory release request. .

オペレーティングシステム(OS)は、様々なタスクから要求されるメモリ確保を一つの物理メモリというリソースを利用して分配する機能を持っている。   The operating system (OS) has a function of distributing memory reservation required by various tasks using a resource called a single physical memory.

特許文献1では、様々なタスクから要求される物理メモリへのメモリ確保を含むアクセスをバスのロックフラグで実現し、メモリの利用効率とパフォーマンス向上の両立させる技術が開示されている。   Japanese Patent Application Laid-Open No. 2004-228561 discloses a technique for realizing access including physical memory allocation required by various tasks with a bus lock flag to achieve both improvement in memory utilization and performance.

一方、OSには、メモリ確保・解放要求を受けた時点で物理メモリ領域の確保・解放を行うものと、メモリ確保要求・解放を受けた時点では物理メモリ領域の確保・解放は行わずに実際にメモリ領域へのアクセスが発生した時点で物理メモリ領域の確保・解放を行うものがある。一般的に前者は後者よりメモリ確保・解放要求時の処理に時間がかかることが知られている。   On the other hand, in the OS, the physical memory area is secured / released when the memory allocation / release request is received, and the physical memory area is not allocated / released when the memory allocation request / release is received. In some cases, the physical memory area is secured / released when the memory area is accessed. In general, it is known that the former takes more time to process a memory reservation / release request than the latter.

また、OSには、メモリ使用効率を向上させるために、使用中のメモリ領域の圧縮処理や断片化解消処理やクリア処理などを行う高度なメモリ管理機能を有するものがある。このようなOSで動作する装置では、OSに対してメモリ確保要求や解放要求を行うタイミングで前記メモリ使用効率を上げる処理が発生していた。これらの処理は、物理メモリへのアクセス回数が多くなるため、処理に時間がかかることが知られている。   Some OSs have an advanced memory management function for performing compression processing, defragmentation processing, clear processing, and the like of a memory area in use in order to improve memory use efficiency. In such an apparatus operating on the OS, processing for increasing the memory use efficiency occurs at the timing when a memory securing request or a release request is issued to the OS. These processes are known to take time because the number of accesses to the physical memory increases.

特開平2−146669号公報JP-A-2-146669

上述の高度なメモリ管理が行われているOSを採用した場合、メモリの使用効率を重視するために、メモリ確保処理の中で、使用中のメモリ領域の圧縮処理や断片化解消処理やクリア処理などが行われ、その結果としてメモリの確保処理や解放処理のパフォーマンスが低下してしまっているものが存在する。   When the above-mentioned OS with advanced memory management is adopted, in order to place importance on the memory usage efficiency, the memory allocation process used in the memory allocation process is compressed, defragmented, and cleared. As a result, the performance of the memory allocation process and the release process has been reduced.

また、上述の高度なメモリ管理は行われなくとも、メモリ確保要求を受けた時点で物理メモリ領域の確保を行うOSは、メモリ確保要求を受けた時点では物理メモリ領域の確保は行わずに実際にメモリ領域へのアクセスが発生した時点で物理メモリ領域の確保を行うOSより、メモリ確保要求時の処理に時間がかかってしまう。   Even if the above-described advanced memory management is not performed, the OS that secures the physical memory area at the time of receiving the memory securing request does not actually secure the physical memory area at the time of receiving the memory securing request. When an access to the memory area occurs, the OS that secures the physical memory area takes time to process the memory securing request.

よって、これらのOSを採用した装置の場合、アプリケーションがメモリの確保や解放をOSに要求する際にパフォーマンスが低下してしまう可能性がある。   Therefore, in the case of an apparatus using these OSs, there is a possibility that the performance may be lowered when an application requests the OS to secure or release memory.

例えば、画像処理を行うアプリケーションでは、画像を展開し、処理を行うため、メモリ確保要求と解放要求が数多く行われ、また、必要とする画像メモリの容量も大きく、上述のようなOS上で実行された場合、パフォーマンスが低下してしまう可能性がある。   For example, in an application that performs image processing, a large number of memory allocation requests and release requests are made in order to expand and process images, and a large amount of image memory is required, which is executed on the OS as described above. If this happens, performance may decrease.

また、近年の携帯端末では、ウェブページを表示するアプリケーション(ウェブブラウザ)や、画像処理等の各種アプリケーションを実行可能なものがあるが、携帯端末等には必ずしも物理メモリが潤沢に存在するとはいえない。
このため、容量が不定なウェブページの表示や画像処理を行う等の使用するメモリ容量の大きいアプリケーションが、上述のようなOSで動作する携帯端末で実行された場合、パフォーマンスが低下してしまう可能性がある。
Moreover, in recent portable terminals, there are applications (web browsers) that display web pages and various applications such as image processing, but it can be said that the portable terminals and the like do not necessarily have plenty of physical memory. Absent.
For this reason, when an application with a large memory capacity to be used, such as displaying a web page with an undefined capacity or performing image processing, is executed on a portable terminal operating on the OS as described above, the performance may be degraded. There is sex.

本発明は、上記の問題点を解決するためになされたもので、本発明の目的は、例えば、メモリ確保・解放要求を受けた際に物理メモリ領域の確保・解放を行うOSや、高度なメモリ管理機能を有するOS等のようにメモリ確保解放動作が比較的遅いOSを用いた情報処理装置において、当該OSに対するメモリ確保・解放要求を行う回数を減らし、アプリケーションのパフォーマンス低下を抑える仕組みを提供することである。   The present invention has been made to solve the above-described problems. The object of the present invention is, for example, an OS that secures / releases a physical memory area when a memory secure / release request is received, In an information processing apparatus using an OS that has a relatively slow memory allocation / release operation, such as an OS having a memory management function, a mechanism is provided to reduce the number of memory allocation / release requests to the OS and suppress the performance degradation of the application. It is to be.

本発明は、メモリ確保要求を受けた際に物理メモリ領域の確保を行い、メモリ解放要求を受けた際に前記確保した物理メモリ領域の解放を行うオペレーティングシステムで動作する情報処理装置であって、アプリケーションプログラムからの最初のメモリ確保要求に応じて、前記オペレーティングシステムに対して所定容量のメモリ確保要求を行って、前記所定容量のメモリ領域を確保する確保手段と、前記アプリケーションプログラムからのメモリ確保要求に応じて、前記確保手段で確保したメモリ領域内の前記アプリケーションプログラムへ割り当てていない状態の領域を、前記アプリケーションプログラムに対して割り当てる割当手段とを有することを特徴とする。   The present invention is an information processing apparatus that operates in an operating system that secures a physical memory area when receiving a memory securing request and releases the secured physical memory area when receiving a memory release request, In response to an initial memory securing request from the application program, a securing means for securing a memory area of the predetermined capacity by making a memory securing request of the predetermined capacity to the operating system, and a memory securing request from the application program And an allocating unit that allocates, to the application program, an area that is not allocated to the application program in the memory area secured by the securing unit.

本発明によれば、予め所定容量のメモリを確保しておくことにより、オペレーションシステムに対するメモリ確保要求、メモリ解放要求の回数を実質的に減らし、アプリケーションからのメモリ確保要求やメモリ解放要求に速やかに対応し、アプリケーションを無駄に待たせないことで、アプリケーションのパフォーマンス低下を抑えることができる。   According to the present invention, by securing a predetermined amount of memory in advance, the number of memory securing requests and memory releasing requests to the operating system is substantially reduced, and a memory securing request and memory releasing request from an application can be promptly met. Correspondingly, the application performance can be prevented from deteriorating by not waiting the application unnecessarily.

本発明の実施例1を示す情報処理装置を適用した画像読取装置の概略構成を示す斜視図。1 is a perspective view showing a schematic configuration of an image reading apparatus to which an information processing apparatus showing Embodiment 1 of the present invention is applied. 本発明の情報処理装置を適用した画像読取装置の機能ブロック図。1 is a functional block diagram of an image reading apparatus to which an information processing apparatus of the present invention is applied. 本実施例の情報処理装置上で動作するオペレーティングシステムのメモリ確保動作を示す模式図。FIG. 3 is a schematic diagram illustrating a memory securing operation of an operating system that operates on the information processing apparatus according to the embodiment. 本発明の実施例1に係る画像読取装置のメモリ確保シーケンス図。FIG. 3 is a memory allocation sequence diagram of the image reading apparatus according to the first embodiment of the present invention. 本発明の実施例1におけるメモリ管理機構のメモリ管理テーブルの一例を示す図。The figure which shows an example of the memory management table of the memory management mechanism in Example 1 of this invention. 本発明の実施例1に係る情報処理装置を適用した画像読取装置のメモリ確保シーケンス処理(メモリ管理機構のメモリ確保処理)を示したフローチャート。3 is a flowchart showing a memory reservation sequence process (memory management process of the memory management mechanism) of the image reading apparatus to which the information processing apparatus according to the first embodiment of the invention is applied. 本発明の実施例1に係る画像読取装置のメモリ解放シーケンス処理(メモリ管理機構のメモリ解放処理)を示したフローチャート。3 is a flowchart showing a memory release sequence process (memory release process of the memory management mechanism) of the image reading apparatus according to the first embodiment of the present invention. 本発明の実施例2におけるメモリ管理機構のメモリ管理テーブルの一例を示した図。The figure which showed an example of the memory management table of the memory management mechanism in Example 2 of this invention. 本発明の実施例2に係る画像読取装置のメモリ確保シーケンス処理(メモリ管理機構のメモリ確保処理)を示したフローチャート。9 is a flowchart showing a memory securing sequence process (memory securing process of a memory management mechanism) of an image reading apparatus according to Embodiment 2 of the present invention. 本発明の実施例2に係る画像読取装置のメモリ解放シーケンス処理(メモリ管理機構のメモリ確保処理)を示したフローチャート。9 is a flowchart showing a memory release sequence process (memory securing process of the memory management mechanism) of the image reading apparatus according to the second embodiment of the present invention.

以下、本発明を実施するための形態について図面を用いて説明する。   Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.

図1は、本発明の実施例1を示す情報処理装置を適用した画像読取装置の概略構成を示す斜視図である。
図1に示すように、本実施例の画像読取装置1は、ネットワーク型スキャナであり、装置本体を構成する下部ユニット10と、この下部ユニット10に対してヒンジ等のリンク部材を介して開閉自在に支持され閉状態で下部ユニット10との間に原稿の搬送路(図示なし)を形成する上部ユニット20とを備えている。
FIG. 1 is a perspective view showing a schematic configuration of an image reading apparatus to which an information processing apparatus showing Embodiment 1 of the present invention is applied.
As shown in FIG. 1, the image reading apparatus 1 of this embodiment is a network type scanner, and can be opened and closed with a lower unit 10 constituting the apparatus main body and a link member such as a hinge with respect to the lower unit 10. And an upper unit 20 that forms a document conveyance path (not shown) with the lower unit 10 in a closed state.

また、本実施例では、下部ユニット10の上端部には、原稿が積載される給紙トレイ11が設けられている。そして、給紙トレイ11上に積載される原稿は、下部ユニット10と上部ユニット20との間の搬送路に沿って自動搬送され、装置内部の後述する画像読取部により画像の読取処理が実行される。なお、画像読取を終えた原稿は、下部ユニット10の下端部に設けられた排紙トレイ12に向かって排出されるようになっている。   In this embodiment, a paper feed tray 11 on which documents are stacked is provided at the upper end of the lower unit 10. Documents stacked on the paper feed tray 11 are automatically conveyed along a conveyance path between the lower unit 10 and the upper unit 20, and image reading processing is executed by an image reading unit (described later) inside the apparatus. The The original after image reading is discharged toward a paper discharge tray 12 provided at the lower end of the lower unit 10.

さらに、本実施例の画像読取装置1は、上部ユニット20の前面に各種情報を表示する情報表示部21が配設されている。ここで、情報表示部21は、例えば、本実施例では、液晶パネル21aと、ユーザ操作を受け付ける透明なタッチパネル21bとからなる。即ち、情報表示部21では、液晶パネル21aを介して、例えば、画像読取部で読み取った原稿画像を表示したり、読取モードの設定や各種設定に用いる設定画面を表示したりすることができる。また、ユーザは、タッチパネル21bを用いることにより、例えば、液晶パネル21aに設定画面や入力画面等を表示させながら、各種設定項目の入力を直接行うことができる。   Further, the image reading apparatus 1 of the present embodiment is provided with an information display unit 21 that displays various information on the front surface of the upper unit 20. Here, for example, in this embodiment, the information display unit 21 includes a liquid crystal panel 21a and a transparent touch panel 21b that receives a user operation. That is, the information display unit 21 can display, for example, a document image read by the image reading unit or a setting screen used for setting a reading mode and various settings via the liquid crystal panel 21a. The user can directly input various setting items by using the touch panel 21b, for example, while displaying a setting screen, an input screen, or the like on the liquid crystal panel 21a.

ここで、図2を参照し、本発明の情報処理装置を適用した画像読取装置1の機能を示す構成要素について説明する。   Here, with reference to FIG. 2, components that indicate functions of the image reading apparatus 1 to which the information processing apparatus of the present invention is applied will be described.

図2は、本発明の情報処理装置を適用した画像読取装置1の機能ブロック図である。
図2に示すように、本実施例の画像読取装置1は、情報を伝達するシステムバス30に対し、ADF(Auto Document Feeder)スキャナ部となる画像読取部31と、この画像読取部31等を制御するCPU(Central Processing Unit)や後述するアドレステーブルを用いて仮想アドレスを物理アドレスに変換する機能を有するMMU(Memory Management Unit)を含む制御部32と、スキャン動作を指示する処理方法や読取設定情報等の各種データやプログラムを格納する不揮発性のフラッシュメモリからなる記録媒体33と、読み取った画像データや各種のデータやプログラムなどを一時的に蓄積するRAM(Random Access Memory)34とがそれぞれ接続されている。なお、画像読取部31とシステムバス30とは、例えば、USBインタフェース等の所定のインタフェースを介して接続される構成であってもよい。また、制御部32のMMUは、CPU(プロセッサ)に内蔵されたモジュールであってよいし、CPUに結合された別のチップであってよい。
FIG. 2 is a functional block diagram of the image reading apparatus 1 to which the information processing apparatus of the present invention is applied.
As shown in FIG. 2, the image reading apparatus 1 according to the present embodiment includes an image reading unit 31 serving as an ADF (Auto Document Feeder) scanner unit, an image reading unit 31 and the like for a system bus 30 that transmits information. A control unit 32 including a CPU (Central Processing Unit) to be controlled and an MMU (Memory Management Unit) having a function of converting a virtual address into a physical address using an address table to be described later, a processing method for instructing a scan operation, and reading setting A recording medium 33 composed of a non-volatile flash memory for storing various data such as information and programs and a RAM (Random Access Memory) 34 for temporarily storing read image data, various data and programs, etc. are connected to each other. Has been. The image reading unit 31 and the system bus 30 may be configured to be connected via a predetermined interface such as a USB interface, for example. The MMU of the control unit 32 may be a module built in a CPU (processor), or may be another chip coupled to the CPU.

また、システムバス30には、GUIを表示する液晶パネル21aと、GUI(Graphical User Interface)を用いた操作を受け付けるタッチパネル21bとからなる情報表示部21が接続されている。さらに、システムバス30には、読み込まれた画像データ等を他のコンピュータ(PC(Personal Computer)、クライアントコンピュータ等を含む)やサーバー(ホストコンピュータや、セグメント間の通信を中継するサーバー等を含む)等に送信する外部通信インタフェース35が接続されている。   In addition, an information display unit 21 including a liquid crystal panel 21 a that displays a GUI and a touch panel 21 b that receives an operation using a GUI (Graphical User Interface) is connected to the system bus 30. Further, the system bus 30 stores the read image data and the like with other computers (including PCs (Personal Computers), client computers, etc.) and servers (including host computers and servers that relay communications between segments). An external communication interface 35 that transmits to the network is connected.

なお、制御部32のCPUは、記録媒体33に記録されたプログラム(オペレーティングシステムに対応するプログラムやアプリケーションプログラム)を実行することにより、画像読取装置1を制御する。   The CPU of the control unit 32 controls the image reading apparatus 1 by executing a program (a program or application program corresponding to the operating system) recorded on the recording medium 33.

図3は、本実施例の情報処理装置上で動作するオペレーティングシステムのメモリ確保動作を示す模式図である。
アプリケーションプログラム(以下、アプリケーション)44がメモリを確保するためには、アプリケーション44は、オペレーティングシステム(以下、OS)のインタフェース(Windows(登録商標)の場合、例えばVirtualAlloc API)を用いて、仮想メモリ管理モジュール43(即ち、OSのメモリ管理機能の1つ)にメモリ確保の要求をする。なお、OSのメモリ管理機能は、アプリケーションが起動されると、該アプリケーションに対して、仮想メモリ空間とアドレステーブルを提供する。アドレステーブルは、物理メモリ(RAM34)上等で記憶管理される。なお、アドレステーブル変換モジュール42(上述したMMUやOSのメモリ管理機能等で構成される)は、このアドレステーブルを用いて仮想メモリ上の仮想アドレスを物理メモリ(RAM34)上の物理アドレスに変換する。なお、MMU内に、アドレステーブルの複製を保持し、上記アドレス変換を高速に行う構成もある。
FIG. 3 is a schematic diagram illustrating a memory securing operation of the operating system that operates on the information processing apparatus according to the present exemplary embodiment.
In order for an application program (hereinafter referred to as an application) 44 to secure a memory, the application 44 uses an operating system (hereinafter referred to as an OS) interface (for example, VirtualAlloc API in the case of Windows (registered trademark)) to manage virtual memory. The module 43 (that is, one of the OS memory management functions) is requested to secure the memory. Note that the memory management function of the OS provides a virtual memory space and an address table to the application when the application is activated. The address table is stored and managed on a physical memory (RAM 34). The address table conversion module 42 (configured by the above-described MMU or OS memory management function) converts a virtual address on the virtual memory into a physical address on the physical memory (RAM 34) using this address table. . There is also a configuration in which a copy of the address table is held in the MMU and the address conversion is performed at high speed.

メモリ確保が要求されたOSの仮想メモリ管理モジュール43は、仮想メモリのアドレステーブルに基づいて仮想メモリを物理メモリに割り当てるアドレステーブル変換モジュール42にメモリ割り当てを要求する。
要求されたアドレステーブル変換モジュール42は、物理メモリアクセスモジュール41を介して物理メモリの空き領域を探索し(領域予約し)、物理メモリの空き領域のアドレスを取得し、物理メモリの空き領域を仮想メモリの空き領域に関連付ける情報をアドレステーブルにセットする。
即ち、物理メモリの領域を仮想メモリの領域に割り当てる(マップする)。さらに、アドレステーブル変換モジュール42は、上述のように物理メモリの領域が割り当てられた(マップされた)仮想メモリの領域の先頭アドレスを、仮想メモリ管理モジュール43介して、確保したメモリの先頭アドレスとしてアプリケーション44に返す。
The virtual memory management module 43 of the OS requested to secure the memory requests memory allocation to the address table conversion module 42 that allocates the virtual memory to the physical memory based on the virtual memory address table.
The requested address table conversion module 42 searches the physical memory free area via the physical memory access module 41 (reserves the area), obtains the address of the physical memory free area, and uses the physical memory free area as virtual. Information related to the free area of the memory is set in the address table.
That is, the physical memory area is allocated (mapped) to the virtual memory area. Further, the address table conversion module 42 uses the start address of the virtual memory area to which the physical memory area is allocated (mapped) as described above as the start address of the secured memory via the virtual memory management module 43. Return to application 44.

このように、本発明の情報処理装置(画像読取装置1)上で動作するOSは、アプリケーション44からメモリ領域の確保要求(メモリ確保要求)を受けた際に物理メモリの割り当てを行う(物理メモリを確保する)ものである。また、アプリケーション44からメモリ解放要求を受けた際に物理メモリの割り当てを解除する(物理メモリを解放する)ものである。よって、本発明の情報処理装置上で動作するOSは、アプリケーションプログラムからメモリ領域の確保要求を受けても実際にそのメモリにアクセスされるまでは物理メモリの割り当てを行わないようなOSとは異なり、メモリ確保、解放時の動作が比較的遅くなってしまう。このため、アプリケーション44が頻繁にメモリ確保を要求する場合、動作速度の低下を招いてしまうおそれがある。   As described above, the OS operating on the information processing apparatus (image reading apparatus 1) of the present invention allocates physical memory when receiving a memory area securing request (memory securing request) from the application 44 (physical memory). Secure). In addition, when a memory release request is received from the application 44, the allocation of physical memory is released (physical memory is released). Therefore, the OS running on the information processing apparatus of the present invention is different from the OS that does not allocate physical memory until the memory is actually accessed even when a memory area securing request is received from an application program. The operation at the time of memory allocation and release becomes relatively slow. For this reason, when the application 44 frequently requests memory reservation, the operation speed may be reduced.

また、物理メモリが潤沢に存在するシステムでは、アドレステーブル変換モジュール42は、すぐさま物理メモリの空き領域を探して仮想メモリに割り当てる物理アドレスを返すことが出来る。しかし、本実施例の画像読取装置1のように、組み込み機器等の物理メモリが少ないシステムのOSや、仮想メモリの管理に厳密な言語で作成されたプログラムでは、アドレステーブル変換モジュール42で物理メモリ領域を確保する前に、仮想メモリや物理メモリの使用中メモリ領域の圧縮処理や断片化解消処理やクリア処理が発生する。このため、アドレステーブル変換モジュール42の反応が遅くなってしまう。このようなアドレス変換処理は、アプリケーション44がメモリ確保を仮想メモリに要求するたびに発生するため、メモリを頻繁に確保、解放するシステムではさらなる動作速度の低下を招いてしまう。なお、本実施例の画像読取装置1では、OSのアドレステーブル変換モジュール42の仕様により物理メモリを例えば512MBしか認識できないものとするが、本発明はこれに限定されるものではない。   Further, in a system with abundant physical memory, the address table conversion module 42 can immediately search for a free area in the physical memory and return a physical address assigned to the virtual memory. However, in the case of an OS of a system having a small physical memory, such as an embedded device, or a program created in a language strict for virtual memory management, such as the image reading apparatus 1 of the present embodiment, the address table conversion module 42 uses the physical memory. Before the area is secured, compression processing, fragmentation elimination processing, and clear processing of the memory area in use of the virtual memory and physical memory occur. For this reason, the reaction of the address table conversion module 42 is delayed. Such an address conversion process occurs every time the application 44 requests the virtual memory to secure the memory. Therefore, in a system that frequently secures and releases the memory, the operation speed further decreases. In the image reading apparatus 1 according to the present embodiment, the physical memory can recognize only 512 MB, for example, according to the specification of the address table conversion module 42 of the OS, but the present invention is not limited to this.

図4は、本発明の実施例1に係る画像読取装置1のメモリ確保シーケンス図である。
図4において、50はメモリ管理機構である。一般的なメモリ確保シーケンスでは、図3に示したように、アプリケーション44が直接、仮想メモリ管理モジュール43(即ち、OSのメモリ管理機能の1つ)にメモリ確保解放処理を呼び出すため、メモリ管理機構50が存在しない状態と同じになる。
FIG. 4 is a memory allocation sequence diagram of the image reading apparatus 1 according to the first embodiment of the present invention.
In FIG. 4, 50 is a memory management mechanism. In a general memory allocation sequence, as shown in FIG. 3, the application 44 directly calls a memory allocation release process to the virtual memory management module 43 (that is, one of the memory management functions of the OS). It becomes the same as the state where 50 does not exist.

そのため、一般的なメモリ確保シーケンスでは、メモリ確保・解放処理で比較的時間がかかるOSで動作する情報処理装置においては、図3で説明したような動作速度の低下を招いてしまう。   For this reason, in a general memory allocation sequence, an information processing apparatus operating on an OS that takes a relatively long time for memory allocation / release processing causes a decrease in the operation speed as described with reference to FIG.

そこで本発明では、アプリケーション44から直接、仮想メモリ管理モジュール43(OS)のメモリ確保処理を呼び出す代わりに、アプリケーション44から(メモリ確保要求として)メモリ管理機構50のメモリ確保処理を呼び出す構成とする。また、アプリケーション44から直接、仮想メモリ管理モジュール43(OS)のメモリ解放処理を呼び出す代わりに、アプリケーション44から(メモリ解放要求として)メモリ管理機構50のメモリ解放処理を呼び出す構成とする。このように、アプリケーション44からメモリ管理機構50のメモリ確保処理・解放処理を用いることにより、アドレステーブル変換モジュール42で発生するメモリ確保処理・メモリ解放処理の実行回数を実質的に減らし、実行速度の低下を防ぐものとする。そのための処理の流れは図6以降にて説明する。
メモリ管理機構50は、制御部32内のCPUが記録媒体33にコンピュータ読み取り可能に記録されたプログラムを読み出して実行することにより実現されるものであり、本発明の確保手段、割当手段、割当解除手段、解放手段等を有する。
Therefore, in the present invention, instead of calling the memory securing process of the virtual memory management module 43 (OS) directly from the application 44, the memory securing process of the memory management mechanism 50 is called from the application 44 (as a memory securing request). Further, instead of calling the memory release process of the virtual memory management module 43 (OS) directly from the application 44, the memory release process of the memory management mechanism 50 is called from the application 44 (as a memory release request). As described above, by using the memory securing process / release process of the memory management mechanism 50 from the application 44, the number of executions of the memory securing process / memory releasing process occurring in the address table conversion module 42 is substantially reduced, and the execution speed can be reduced. Shall prevent decline. The process flow for this will be described with reference to FIG.
The memory management mechanism 50 is realized by the CPU in the control unit 32 reading and executing a program recorded on the recording medium 33 so as to be readable by a computer. Means, release means and the like.

なお、アプリケーション44は、画像読取部31により取得される画像データを物理メモリ(RAM34)に格納して画像処理し、記録媒体33に出力する(記録媒体33に記録する)ものとする。本発明ではパフォーマンスを要求し、かつ要求するメモリサイズが大きく、またメモリ確保要求、メモリ解放要求の回数が多い画像メモリ(上述の画像データを格納するためのメモリ)の確保及び解放時に、アプリケーション44がメモリ管理機構50を用いるものとする。即ち、アプリケーション44は、画像読取部31により取得される画像データを記憶するためにメモリ管理機構50にメモリ確保要求を行い、前記画像データを記憶するために割り当てられたメモリ領域をメモリ管理機構50に返却するためにメモリ解放要求を行う。よって、アプリケーションプログラム44は、画像読取部31で画像の読み取りを行う際にメモリ管理機構50にメモリ確保要求を行い、画像データの処理を完了した際にメモリ管理機構50にメモリ解放要求を行う。なお、アプリケーション44は、画像メモリの確保・解放かそれ以外のメモリ確保・解放かを区別できる構成とする。   Note that the application 44 stores the image data acquired by the image reading unit 31 in a physical memory (RAM 34), performs image processing, and outputs the image data to the recording medium 33 (records it on the recording medium 33). In the present invention, at the time of securing and releasing an image memory (memory for storing the above-described image data) that requires performance, requires a large memory size, and has a large number of memory securing requests and memory releasing requests, Assume that the memory management mechanism 50 is used. That is, the application 44 makes a memory allocation request to the memory management mechanism 50 in order to store the image data acquired by the image reading unit 31, and allocates a memory area allocated to store the image data to the memory management mechanism 50. Request memory release to return to Therefore, the application program 44 issues a memory allocation request to the memory management mechanism 50 when the image reading unit 31 reads an image, and issues a memory release request to the memory management mechanism 50 when the image data processing is completed. The application 44 is configured to be able to distinguish whether the image memory is secured / released or other memory secured / released.

また、本発明のメモリ管理機構50のメモリ確保処理、及び、解放処理の機能は、ライブラリ等のプログラムで提供され、アプリケーション44からこれらのプログラムを呼び出すことにより、実行可能である。   The functions of the memory securing process and the releasing process of the memory management mechanism 50 of the present invention are provided by programs such as a library and can be executed by calling these programs from the application 44.

以下、図5を参照して、本発明のメモリ管理機構50がメモリ管理に用いる標準メモリ管理テーブルについて説明する。
図5は、本発明の実施例1におけるメモリ管理機構50のメモリ管理テーブルの一例を示す図である。
図5において、51は標準メモリ管理テーブルであり、本発明の管理手段に対応する。標準メモリ管理テーブル51において、列52は、メモリ管理番号を示している。列52は、メモリ管理番号に対応するアドレスのメモリ確保状態を示している。そして、標準メモリ管理テーブル51の各行が、それぞれメモリ管理番号(列52)と、メモリ確保状態(列53)との対応を示している。本実施例では、標準メモリ管理テーブル51は、65536個の要素が存在し、一つの要素(メモリ管理番号ごと)あたり4KBのメモリの使用状態を記憶している。
Hereinafter, a standard memory management table used for memory management by the memory management mechanism 50 of the present invention will be described with reference to FIG.
FIG. 5 is a diagram illustrating an example of a memory management table of the memory management mechanism 50 according to the first embodiment of this invention.
In FIG. 5, 51 is a standard memory management table, which corresponds to the management means of the present invention. In the standard memory management table 51, a column 52 indicates a memory management number. A column 52 indicates a memory reservation state of an address corresponding to the memory management number. Each row of the standard memory management table 51 indicates the correspondence between the memory management number (column 52) and the memory allocation state (column 53). In this embodiment, the standard memory management table 51 has 65536 elements, and stores the usage status of 4 KB of memory per element (for each memory management number).

この標準メモリ管理テーブル51は、画像読取装置1内部でアプリケーションから最初のメモリ確保要求が行われた時に(即ち、メモリ管理機構50のメモリ確保要求処理が最初に呼び出された時に)、メモリ管理機構50により、RAM34上に作成される。この際、メモリ管理機構50は、所定のメモリ量(例えば、OSに一度に予約可能な最大メモリ容量、本実施例では256MBとする)の仮想メモリを予約するようにOSに要求する(Windows(登録商標)の場合、例えばVirtualAlloc APIを用いてOSに仮想メモリの予約を要求する)。OSは、この要求に応じて、上記アプリケーションの仮想メモリ内の領域を予約する。この予約処理により、メモリ管理機構50は連続したメモリ領域を確保可能となる。さらに、メモリ管理機構50は、標準メモリ管理テーブル51を作成した際に、標準メモリ管理テーブル51内の全てのメモリ管理番号に対応する領域(全領域)の状態を「未確保」と初期化しておく。なお、メモリ確保状態には、「未確保」、「未使用」、「先頭」、「使用中」がある。まず、「未確保」は、メモリ管理番号に対応する仮想メモリ領域(4KB)に対して、物理メモリが割り当てられていない状態を示す(未確保領域)。「未使用」は、メモリ管理番号に対応する仮想メモリ領域に対して物理メモリが割り当ている状態(使用可能な状態)で且つアプリケーションへ割り当てられていない状態を示す(未使用領域)。「先頭」及び「使用中」は、メモリ管理番号に対応する仮想メモリ領域が、メモリ管理機構50のメモリ確保処理によりアプリケーションに割り当てられている状態(アプリケーションが使用している状態)を示す(使用領域)。なお、「先頭」は、上記アプリケーションに割り当てられている領域の先頭領域、「使用中」は先頭領域以外の領域を示す。このような標準メモリ管理テーブル51を設けることにより、メモリ管理機構50は、上述の予約したメモリ領域内の状態(確保の有無、アプリケーションへの割り当ての有無等)を管理することができる。   The standard memory management table 51 is stored in the memory management mechanism when the first memory reservation request is made by an application in the image reading apparatus 1 (that is, when the memory reservation request process of the memory management mechanism 50 is first called). 50 is created on the RAM 34. At this time, the memory management mechanism 50 requests the OS to reserve a virtual memory having a predetermined amount of memory (for example, the maximum memory capacity that can be reserved in the OS at a time, which is 256 MB in this embodiment) (Windows ( In the case of (registered trademark), for example, a virtual memory reservation is requested from the OS using the VirtualAlloc API). In response to this request, the OS reserves an area in the virtual memory of the application. By this reservation processing, the memory management mechanism 50 can secure a continuous memory area. Further, when the memory management mechanism 50 creates the standard memory management table 51, the memory management mechanism 50 initializes the state of all areas (all areas) corresponding to all memory management numbers in the standard memory management table 51 to “unallocated”. deep. Note that the memory reservation state includes “not reserved”, “not used”, “first”, and “in use”. First, “unallocated” indicates a state in which no physical memory is allocated to the virtual memory area (4 KB) corresponding to the memory management number (unallocated area). “Unused” indicates a state in which physical memory is allocated to the virtual memory area corresponding to the memory management number (usable state) and not allocated to the application (unused area). “Top” and “In Use” indicate a state in which the virtual memory area corresponding to the memory management number is allocated to the application by the memory allocation process of the memory management mechanism 50 (a state in which the application is in use) region). Note that “head” indicates the head area of the area allocated to the application, and “in use” indicates an area other than the head area. By providing such a standard memory management table 51, the memory management mechanism 50 can manage the state (presence / absence of reservation, presence / absence of assignment to an application, etc.) in the reserved memory area.

以下、図6、図7を参照して、実施例1の画像読取装置1におけるメモリ確保シーケンス処理、及び、メモリ解放シーケンス処理について説明する。
図6は、本発明の実施例1に係る情報処理装置を適用した画像読取装置のメモリ確保シーケンス処理(メモリ管理機構50のメモリ確保処理)を示したフローチャートである。図中、S601〜S607は各ステップを示す。なお、このフローチャートの処理は、制御部32内のCPUが記録媒体33にコンピュータ読み取り可能に記録されたプログラムを読み出して実行することにより実現される。また、このメモリ確保処理は、アプリケーション44からメモリ管理機構50にメモリ確保指示(メモリ確保要求)があった時にメモリ管理機構50で実行される。
Hereinafter, the memory allocation sequence process and the memory release sequence process in the image reading apparatus 1 according to the first embodiment will be described with reference to FIGS.
FIG. 6 is a flowchart showing a memory securing sequence process (memory securing process of the memory management mechanism 50) of the image reading apparatus to which the information processing apparatus according to the first embodiment of the present invention is applied. In the figure, S601 to S607 indicate each step. Note that the processing in this flowchart is realized by the CPU in the control unit 32 reading and executing a program recorded in the recording medium 33 so as to be readable by a computer. This memory securing process is executed by the memory management mechanism 50 when a memory securing instruction (memory securing request) is issued from the application 44 to the memory management mechanism 50.

まず、S601において、メモリ管理機構50(制御部32内のCPU)は、今回のメモリ確保要求がアプリケーション44から仮想メモリに対して行われる最初のメモリ確保要求かどうか(即ち、メモリ未確保かどうか)を判定する。なお、本実施例では最初のメモリ確保要求かどうかは、図5の標準メモリ管理テーブル51のメモリ管理番号1番が「未確保」状態かどうかで判断する。即ち、標準メモリ管理テーブル51のメモリ管理番号1番が「未確保」状態であった時に最初のメモリ確保要求であると判断する。また、S601の時点で、標準メモリ管理テーブル51が作成されていない場合も、メモリ管理機構50は、最初のメモリ確保と判断し、この場合、上述の手順で標準メモリ管理テーブル51を作成するものとする。   First, in step S601, the memory management mechanism 50 (the CPU in the control unit 32) determines whether or not the current memory reservation request is the first memory reservation request made from the application 44 to the virtual memory (that is, whether or not the memory has not been reserved). ). In this embodiment, whether or not it is the first memory reservation request is determined by whether or not the memory management number 1 in the standard memory management table 51 of FIG. That is, when the memory management number 1 in the standard memory management table 51 is in an “unsecured” state, it is determined that this is the first memory reservation request. Further, even when the standard memory management table 51 is not created at the time of S601, the memory management mechanism 50 determines that the first memory is secured, and in this case, creates the standard memory management table 51 according to the above procedure. And

上記S601において、メモリ確保要求が最初(1回目)のメモリ確保要求(メモリ未確保)であると判定した場合、メモリ管理機構50は、所定容量(予めアプリケーション44の処理全体で必要とされているメモリ量)が物理メモリ上に空きメモリとして存在するかどうかを調べるために、S602に処理を進める。   If it is determined in S601 that the memory allocation request is the first (first) memory allocation request (memory not yet allocated), the memory management mechanism 50 has a predetermined capacity (preliminarily required for the entire processing of the application 44). In order to check whether or not the (memory amount) exists as free memory on the physical memory, the process proceeds to S602.

なお、予め処理全体で必要とされているメモリの使用量は記録媒体33上に値が格納されているものとする。本実施例の場合では、49152ブロック分を予め確保する確保量とする。この確保量は、画像読取装置1のアプリケーションプログラムの設定によって必要なメモリ量に変動する。本実施例の画像読取装置1では、画像読取装置1の画像読取部31が一度の読み取り処理で読み取り可能な画像データの容量に応じて決定してもよい。例えば、上記確保量は、画像読取部31が一度の読み取り処理で原稿の両面を読み取り可能な装置であれば、画像読取部31で読み取る原稿片面あたりの画像データの読み取りサイズの少なくとも3倍のメモリ量としてもよい。また、上記確保量は、画像読取部31が一度の読み取り処理で原稿の片面を読み取る装置であれば、画像読取部31で読み取る原稿片面あたりの画像データの読み取りサイズの少なくとも2倍のメモリ量としてもよい。即ち、上記確保量は、画像読取部31で読み取る原稿片面あたりの画像データの読み取りサイズの少なくとも複数倍のメモリ量としてもよい。なお、画像読取部31で読み取られ物理メモリに格納された画像データの、アプリケーション44による画像処理単位は、原稿片面の画像データ単位である。即ち、上記確保量は、画像読取部31が一度の読み取り処理で読み取る画像データのサイズに、アプリケーション44での画像処理単位(原稿片面)の画像データのサイズを、加算したサイズに対応するメモリ量としてもよい。
また、上記確保量は、OSに一度に要求可能な最大メモリ容量からシステム使用容量(上記予め確保するメモリ以外に、制御部32のCPUが使用する容量)を差し引いたメモリ量としてもよい。
It is assumed that the memory usage required for the entire process is stored on the recording medium 33 in advance. In the case of the present embodiment, 49152 blocks are set as the secured amount to be secured in advance. The secured amount varies depending on the setting of the application program of the image reading apparatus 1 to a necessary memory amount. In the image reading apparatus 1 of the present embodiment, the image reading unit 31 of the image reading apparatus 1 may determine according to the volume of image data that can be read by one reading process. For example, if the image reading unit 31 is a device that can read both sides of a document with a single reading process, the above-mentioned secured amount is a memory that is at least three times the reading size of image data per one side of the document read by the image reading unit 31 It may be an amount. Further, if the image reading unit 31 is a device that reads one side of a document by a single reading process, the secured amount is a memory amount that is at least twice the reading size of image data per one side of the document read by the image reading unit 31. Also good. That is, the secured amount may be a memory amount that is at least a multiple of the reading size of the image data per one side of the document read by the image reading unit 31. Note that the image processing unit by the application 44 of the image data read by the image reading unit 31 and stored in the physical memory is an image data unit on one side of the document. That is, the secured amount is the amount of memory corresponding to the size obtained by adding the size of the image data of the image processing unit (one side of the original) in the application 44 to the size of the image data read by the image reading unit 31 in one reading process. It is good.
Further, the secured amount may be a memory amount obtained by subtracting the system use capacity (capacity used by the CPU of the control unit 32 in addition to the memory secured in advance) from the maximum memory capacity that can be requested to the OS at a time.

S602では、メモリ管理機構50は、予め処理全体で必要とされているメモリ量が物理メモリ上に空きメモリとして存在するかどうかを判定する。そして、S602において、必要とされているメモリ量が物理メモリ上に空きメモリとして存在しないと判定した場合、メモリ管理機構50は、メモリ不足をアプリケーション44に通知するために、S605へ処理を進める。   In S602, the memory management mechanism 50 determines in advance whether or not the amount of memory required for the entire processing exists as free memory on the physical memory. If it is determined in S602 that the required amount of memory does not exist as free memory on the physical memory, the memory management mechanism 50 advances the process to S605 in order to notify the application 44 of memory shortage.

一方、S602において、必要とされているメモリ量が物理メモリ上に空きメモリとして存在すると判定した場合、メモリ管理機構50は、処理全体で必要な量を実際に確保するために、S603(確保処理)へ処理を進める。このS602の処理により、アプリケーション44で必要とされる空きメモリ量が物理メモリ上に存在する場合にのみ、OSにメモリ確保要求を行うように制御でき、確保できない容量のメモリをOSに要求してエラーとなってしまうといった無駄を回避することができる。即ち、アプリケーション44で必要とされる空きメモリ量が存在しない場合には、アプリケーション44を待たせることなく、速やかにエラー処理を行うことができる。   On the other hand, if it is determined in S602 that the required amount of memory exists as free memory on the physical memory, the memory management mechanism 50 determines whether the required amount of the entire process is actually reserved in S603 (allocating process). ). By the processing of S602, it is possible to control the OS to make a memory reservation request only when the amount of free memory required by the application 44 exists in the physical memory. It is possible to avoid waste such as an error. In other words, when there is no free memory amount required by the application 44, error processing can be performed promptly without causing the application 44 to wait.

S603では、メモリ管理機構50は、必要とされているメモリ量が物理メモリ上に空きメモリとして存在していることが分かっているので、処理全体で必要なメモリ量を実際に確保するようにOSにメモリ確保要求を行う(OSがWindows(登録商標)の場合、例えばVirtualAlloc APIを用いてOSにメモリ確保を要求する)。OSは、このメモリ確保要求に応じて、要求された容量の物理メモリを確保する。即ち、OSは、図3で説明したように、要求された容量の物理メモリの空き領域を仮想メモリ上の領域(標準メモリ管理テーブル51作成時に予約した領域内の領域)にマッピングして(物理メモリの空き領域と仮想メモリの領域に関連付ける情報をアドレステーブルにセットして)、物理メモリの領域が割り当てられた仮想メモリの領域の先頭アドレスをメモリ管理機構50に返す。メモリ管理機構50は、OSから応答された仮想メモリの先頭メモリアドレスから確保したメモリ量分だけ「未使用」フラグをメモリ管理機構50の状態53にセットして、S604へ処理を進める。このS603の処理により、メモリ管理機構50は、標準メモリ管理テーブル51作成時に予約した領域内の各メモリ管理番号に対応する領域が、メモリ確保済みの領域か、メモリ未確保の領域であるか管理し、これ以後、確保済みの領域をアプリケーション44に迅速に割り当てることが可能となる。   In S603, the memory management mechanism 50 knows that the required amount of memory exists as free memory on the physical memory, so that the OS can actually secure the required amount of memory for the entire process. (When the OS is Windows (registered trademark), for example, a virtual alloc API is used to request memory reservation from the OS). In response to this memory reservation request, the OS secures a physical memory having the requested capacity. That is, as described in FIG. 3, the OS maps the physical memory free space of the requested capacity to the virtual memory area (the area in the area reserved when the standard memory management table 51 is created) (physical memory). The information relating to the free memory area and the virtual memory area is set in the address table), and the start address of the virtual memory area to which the physical memory area is allocated is returned to the memory management mechanism 50. The memory management mechanism 50 sets the “unused” flag in the state 53 of the memory management mechanism 50 by the amount of memory secured from the top memory address of the virtual memory responded from the OS, and advances the process to S604. Through the processing of S603, the memory management mechanism 50 manages whether the area corresponding to each memory management number in the area reserved when the standard memory management table 51 is created is an area where the memory has been reserved or an area where the memory has not been reserved. Thereafter, the reserved area can be quickly allocated to the application 44.

一方、上記S601において、メモリ確保要求が2回目以降である(メモリ確保済み)と判定した場合には、メモリ管理機構50は、必要なメモリがメモリ管理機構50により確保した空きメモリとして存在するかどうかを調べるために、S604へ処理を進める。   On the other hand, if it is determined in S601 that the memory allocation request is the second or later (memory allocation has been completed), the memory management mechanism 50 determines whether the necessary memory exists as a free memory allocated by the memory management mechanism 50. In order to check whether or not, the process proceeds to S604.

S604では、メモリ管理機構50は、現在、アプリケーション44から要求されているメモリ量がメモリ管理機構50の標準メモリ管理テーブル51で「未使用」とされている領域に存在するかどうかを判定する。そして、S604において、要求されているメモリ量が標準メモリ管理テーブル51に空きメモリとして存在すると判定した場合には、メモリ管理機構50は、アプリケーションで使用可能な状態にするために、S606(割当処理)へ処理を進める。   In S <b> 604, the memory management mechanism 50 determines whether or not the memory amount currently requested by the application 44 exists in an area “unused” in the standard memory management table 51 of the memory management mechanism 50. If the memory management mechanism 50 determines in S604 that the requested memory amount exists as free memory in the standard memory management table 51, the memory management mechanism 50 performs S606 (allocation processing) in order to make it usable by the application. ).

S606では、メモリ管理機構50は、アプリケーション44に要求されたメモリ量がメモリ管理機構50上に空きメモリとして存在していることが分かっているので、要求サイズ分の「未使用」フラグが付いているメモリ領域を検索し、その先頭アドレスをアプリケーション44に使用可能なメモリ領域として通知する(割り当てる)。また、メモリ管理機構50は、次のメモリ確保要求があった時に使用中のメモリ領域を使用可能だと返さないために先頭アドレスから要求分だけメモリを使用中であることを記憶しておくために、S607へ処理を進める。このS606の通知を受けたアプリケーション44は、通知された先頭アドレスから要求した分だけのメモリを使用することが可能となる。   In S606, the memory management mechanism 50 knows that the amount of memory requested by the application 44 exists as free memory on the memory management mechanism 50, and therefore has an “unused” flag for the requested size. And the start address is notified (assigned) to the application 44 as a usable memory area. Further, the memory management mechanism 50 stores that the memory is being used for the requested amount from the top address in order not to return that the used memory area is usable when the next memory securing request is made. Then, the process proceeds to S607. The application 44 that has received the notification in S606 can use as much memory as requested from the notified start address.

次に、S607では、メモリ管理機構50は、アプリケーション44に使用可能なメモリ領域として先頭アドレスから要求サイズ分だけメモリ管理機構50の標準メモリ管理テーブル51のメモリ状態を「使用中」と記憶しておく処理を行い(ただし先頭アドレスは「先頭」と記憶しておく)、処理を終了する。このS607の処理により、メモリ管理機構50は、上記メモリ確保済みのメモリ領域内のアプリケーション44に割り当て済みのメモリ領域(使用領域)を確実に管理し、アプリケーション44へのメモリ割り当てを速やかに行うことができる。なお、先頭アドレスは、今回確保されたメモリ容量を状態と一緒に記憶し、上記S604で空き領域を探す検索処理実行時に参照するようにしてもよい。   In step S <b> 607, the memory management mechanism 50 stores the memory state of the standard memory management table 51 of the memory management mechanism 50 as “used” for the requested size from the top address as a memory area usable for the application 44. Processing (however, the start address is stored as “start”), and the processing ends. By the processing of S607, the memory management mechanism 50 reliably manages the memory area (used area) allocated to the application 44 in the memory area where the memory is secured, and quickly allocates the memory to the application 44. Can do. The start address may be stored together with the memory capacity reserved this time and referred to when executing a search process for searching for a free area in S604.

一方、S604において、要求されているメモリ量が標準メモリ管理テーブル51に空きメモリとして存在しないと判定した場合には、メモリ管理機構50は、メモリ不足をアプリケーション44に通知するために、S605へ処理を進める。   On the other hand, if it is determined in S604 that the requested memory amount does not exist as free memory in the standard memory management table 51, the memory management mechanism 50 performs the process in S605 to notify the application 44 of the memory shortage. To proceed.

S605では、メモリ管理機構50は、処理全体で必要とされているメモリ量が物理メモリ上に空きメモリとして存在していないか、アプリケーション44から要求されているメモリ量分だけメモリ管理機構50が確保したメモリ領域に「未使用」状態(空きメモリ領域)が存在していないため、アプリケーション44にメモリ不足であることを、エラーを返すことで通知し、処理を終了する。このS605の処理により、確保したメモリ領域内に、アプリケーションで必要とされる空きメモリ量が存在しない場合には、アプリケーション44を待たせることなく、速やかにエラー処理を行うことができる。
以上のメモリ確保シーケンス処理により、メモリ管理機構50は、アプリケーション44を待たせることなく、速やかにアプリケーションから要求された容量のメモリをアプリケーション44に割り当てることができる。即ち、アプリケーション44は、要求した容量のメモリを速やかに取得して、処理を続行することができ、無駄な待機時間を抑え、パフォーマンスの低下を抑えることができる。
なお、アプリケーションプログラム44は、プログラムの終了時に、割り当てられた領域の全てを返却するためのメモリ解放要求を出力するように構成してもよい。
In step S <b> 605, the memory management mechanism 50 secures the memory management mechanism 50 by the amount of memory requested by the application 44, whether the amount of memory required for the entire processing does not exist as free memory on the physical memory. Since there is no “unused” state (free memory area) in the memory area, the application 44 is notified that the memory is insufficient by returning an error, and the process ends. As a result of the processing in S605, if there is no free memory amount required by the application in the reserved memory area, error processing can be performed promptly without causing the application 44 to wait.
Through the above memory allocation sequence process, the memory management mechanism 50 can quickly allocate a memory having a capacity requested by the application to the application 44 without causing the application 44 to wait. In other words, the application 44 can quickly acquire the requested amount of memory and continue the processing, and can reduce unnecessary waiting time and performance degradation.
The application program 44 may be configured to output a memory release request for returning all the allocated areas when the program ends.

図7は、本発明の実施例1に係る画像読取装置のメモリ解放シーケンス処理(メモリ管理機構50のメモリ解放処理)を示したフローチャートである。図中、S701〜S705は各ステップを示す。なお、このフローチャートの処理は、制御部32内のCPUが記録媒体33にコンピュータ読み取り可能に記録されたプログラムを読み出して実行することにより実現される。また、このメモリ解放処理は、アプリケーション44からメモリ管理機構50に先頭アドレスを指定した解放指示(メモリ解放要求)があった時にメモリ管理機構50で実行される。   FIG. 7 is a flowchart showing a memory release sequence process (memory release process of the memory management mechanism 50) of the image reading apparatus according to the first embodiment of the present invention. In the figure, S701 to S705 indicate each step. Note that the processing in this flowchart is realized by the CPU in the control unit 32 reading and executing a program recorded in the recording medium 33 so as to be readable by a computer. This memory release process is executed by the memory management mechanism 50 when the application 44 issues a release instruction (memory release request) specifying the start address to the memory management mechanism 50.

S701において、メモリ管理機構50(制御部32内のCPU)は、今回のメモリ解放要求で指定された先頭アドレスが図6のメモリ確保シーケンス処理で確保された仮想メモリの先頭アドレスかどうかを判定する。具体的には、標準メモリ管理テーブル51のメモリ管理番号52に対応したメモリアドレスかどうかを判定することになる。   In S701, the memory management mechanism 50 (the CPU in the control unit 32) determines whether or not the start address specified in the current memory release request is the start address of the virtual memory reserved in the memory reservation sequence process of FIG. . Specifically, it is determined whether or not the memory address corresponds to the memory management number 52 of the standard memory management table 51.

そして、S701において、メモリ解放要求で指定された先頭アドレスが図6のメモリ確保シーケンス処理で確保された仮想メモリの先頭アドレスでないと判定した場合、メモリ管理機構50は、メモリ管理機構50で確保されたメモリではないので処理を終了する。例えば、標準メモリ管理テーブル51のメモリ管理番号2番や3番や6番などが指定された場合は、メモリ状態が「先頭アドレス」では無いので処理を終了する条件となる。   If it is determined in S701 that the head address specified by the memory release request is not the head address of the virtual memory secured by the memory securing sequence process of FIG. 6, the memory management mechanism 50 secures the memory management mechanism 50. Since it is not a valid memory, the process is terminated. For example, when the memory management number 2, 3, 6, or the like in the standard memory management table 51 is designated, the memory state is not “the top address”, and therefore the condition is to end the processing.

一方、S701において、メモリ解放要求で指定された先頭アドレスが図6のメモリ確保シーケンスで確保された仮想メモリの先頭アドレスであると判定した場合、メモリ管理機構50は、未使用状態にリセットするために、S702(割当解除処理)へ処理を進める。   On the other hand, if it is determined in S701 that the head address specified in the memory release request is the head address of the virtual memory secured in the memory securing sequence of FIG. 6, the memory management mechanism 50 resets to the unused state. Then, the process proceeds to S702 (assignment release process).

S702では、メモリ管理機構50は、先頭アドレスから次の先頭アドレスまで、もしくは次の未使用のアドレスまで未使用状態に変更する。即ち、メモリ管理機構50は、アプリケーション44から解放要求された領域に対する、アプリケーション44へのメモリの割り当てを解除して、該領域をアプリケーション44に再割当可能にする。例えば標準メモリ管理テーブル51におけるメモリ管理番号1番が指定された場合は、メモリ管理番号1番から3番までのメモリ状態を「未使用」に変更する。また、メモリ管理番号4番が指定された場合は、メモリ管理番号4番のみを「未使用」に変更する。このS702の処理により、アプリケーション44からメモリ解放要求(返却)されたメモリ領域の割り当てを解除して再度アプリケーション44に割り当て可能にする(アプリケーション44からのメモリ返却を処理する)ことができる。   In S702, the memory management mechanism 50 changes the state from the first address to the next start address or from the next unused address to the unused state. In other words, the memory management mechanism 50 cancels the allocation of the memory to the application 44 for the area requested to be released from the application 44 and allows the area to be reassigned to the application 44. For example, when the memory management number 1 in the standard memory management table 51 is designated, the memory statuses of the memory management numbers 1 to 3 are changed to “unused”. When the memory management number 4 is designated, only the memory management number 4 is changed to “unused”. Through the processing of S702, the allocation of the memory area requested to be released (returned) by the application 44 can be released and can be allocated again to the application 44 (memory return from the application 44 is processed).

次に、S703において、メモリ管理機構50は、使用中のメモリがメモリ管理機構50上に存在する(即ち、S702で「未使用」フラグをセットしたアドレスに対応するメモリが最後の使用中メモリ)かどうかを判定する。そして、S703において、使用中のメモリがメモリ管理機構50上に存在すると判定した場合、メモリ管理機構50は、解放処理を終了する。なお、本実施例において使用中のメモリが存在するかどうかを調べる処理は、標準メモリ管理テーブル51のメモリ管理番号52を1から順番に検索し、テーブルの最後の番号まで先頭アドレス状態になっているかどうかを調べることによって実現されるものとする。   Next, in S703, the memory management mechanism 50 determines that the memory in use exists on the memory management mechanism 50 (that is, the memory corresponding to the address for which the “unused” flag is set in S702 is the last memory in use). Determine whether or not. If it is determined in S703 that the memory in use exists on the memory management mechanism 50, the memory management mechanism 50 ends the release process. In this embodiment, the process of checking whether there is a memory in use is performed by searching the memory management number 52 of the standard memory management table 51 in order from 1, and the first address state is reached until the last number in the table. It shall be realized by checking whether or not.

一方、S703において、使用中のメモリがメモリ管理機構50上に存在しないと判定した場合、メモリ管理機構50は、メモリ管理機構50で確保したメモリ(図6のS603で確保したメモリ)を解放するために、S704へ処理を進める。   On the other hand, if it is determined in S703 that the memory in use does not exist on the memory management mechanism 50, the memory management mechanism 50 releases the memory secured by the memory management mechanism 50 (the memory secured in S603 in FIG. 6). Therefore, the process proceeds to S704.

S704では、メモリ管理機構50は、図6のS603で確保されたメモリ分が仮想メモリ上にマッピングされている物理メモリを解放する処理を行う。図5の例では、メモリ管理番号1から49152までの領域をOSの仮想メモリのマッピングから解放する。メモリ管理機構50は、図6のS603で確保されたメモリのメモリ解放要求をOSに行う(Windows(登録商標)の場合、例えばVirtualFree APIを用いてOSにメモリ解放を要求する)。OSは、この要求に応じて、要求された領域をOSの仮想メモリのマッピングから解放する。即ち、OSは、アドレステーブルから、物理メモリの領域を仮想メモリの領域に関連付ける情報を削除して、該当する物理メモリの領域を再度、仮想メモリに割り当て可能にする。このS705の処理により、確保した領域を全て解放して、任意のプログラムが使用可能な状態とすることができる。   In S704, the memory management mechanism 50 performs a process of releasing the physical memory in which the memory secured in S603 in FIG. 6 is mapped on the virtual memory. In the example of FIG. 5, the areas with memory management numbers 1 to 49152 are released from the virtual memory mapping of the OS. The memory management mechanism 50 makes a memory release request for the memory secured in S603 of FIG. 6 to the OS (in the case of Windows (registered trademark), for example, a virtual free API is used to request memory release from the OS). In response to this request, the OS releases the requested area from the virtual memory mapping of the OS. That is, the OS deletes information relating the physical memory area to the virtual memory area from the address table, and enables the corresponding physical memory area to be assigned to the virtual memory again. Through the processing in S705, all the reserved areas can be released, and any program can be used.

上記S704で仮想メモリを解放したので、次のメモリ確保要求をアプリケーション44から受けた時に最初のメモリ確保とみなす必要がある。そこで、S705において、メモリ管理機構50は、標準メモリ管理テーブル51の全てのメモリ管理番号52のメモリ状態53を「未確保」状態に変更する処理を行い、処理を終了する。このS705の処理により、メモリ管理機構50は、標準メモリ管理テーブル51作成時に予約した領域内の各メモリ管理番号に対応する領域が、メモリ未確保の領域であることを確実に管理し、再度、アプリケーション44からメモリ確保要求を受けた際には、再度、OSにメモリ確保要求を行って、メモリ確保することができる。   Since the virtual memory is released in S704, it is necessary to consider the first memory reservation when the next memory reservation request is received from the application 44. Therefore, in S705, the memory management mechanism 50 performs a process of changing the memory state 53 of all the memory management numbers 52 in the standard memory management table 51 to the “unsecured” state, and ends the process. Through the processing in S705, the memory management mechanism 50 reliably manages that the area corresponding to each memory management number in the area reserved when the standard memory management table 51 is created is an area where memory is not yet secured. When a memory securing request is received from the application 44, the memory securing request can be made to the OS again to secure the memory.

以上のメモリ解放シーケンス処理により、メモリ管理機構50は、アプリケーション44を待たせることなく、速やかにアプリケーションから要求された領域のメモリを再割り当て可能な領域とすることができる(返却処理できる)。即ち、アプリケーション44は、必要なくなったメモリを速やかに返却して、処理を続行することができ、無駄な待機時間を抑え、パフォーマンスの低下を抑えることができる。   Through the memory release sequence process described above, the memory management mechanism 50 can quickly make the memory in the area requested by the application a realizable area without waiting for the application 44 (can be returned). In other words, the application 44 can quickly return the memory that is no longer needed, and can continue the processing, thereby suppressing unnecessary waiting time and suppressing performance degradation.

なお、複数のアプリケーションからのメモリ確保要求がメモリ管理機構50にあった場合、即ち、例えば、ワークフローを想定して画像等の直接データを扱うアプリケーションからデータベースなどが扱うデータを管理するアプリケーションにリレーされるような場合(スキャナ等の制御に用いる専用アプリケーションと各種データベース用等の汎用アプリケーションとの連携等の場合)には、最初のアプリケーションで確保したメモリを次のアプリケーションに受け渡す仕組みをメモリ管理機構において提供するようにしてもよい。   When there is a memory allocation request from a plurality of applications in the memory management mechanism 50, that is, for example, an application that handles direct data such as images is relayed to an application that manages data handled by a database, assuming a workflow. In such a case (in the case of cooperation between a dedicated application used for scanner control and general-purpose applications such as for various databases), the memory management mechanism provides a mechanism for transferring the memory reserved in the first application to the next application. May be provided.

例えば、最初のアプリケーションが終了する前に、メモリ管理機構50で確保したメモリ領域をリレーしたいアプリケーションプロセスのメモリ管理機構50にコピーして再マッピングしてから、最初のアプリケーションのプロセスが終了するなどの処理を行う。具体的には、上述のVirtualAlloc等を用いて予約した仮想メモリ領域(即ち、管理テーブル501で管理している領域であり、図6のS601でメモリ確保した領域を含む)をVirtualCopy等を用いてプロセス間の仮想メモリコピーを行うことでリレーを実現する。つまり、メモリ管理機構50へのアプリケーション毎のメモリ確保要求を管理しながら、各メモリ確保要求とメモリ解放とのタイミングを考慮し、最初のアプリケーションで確保したメモリの全部又は一部を、次のアプリケーションにリレーする際に当該次のアプリケーションにメモリを割り当てるようにしてもよい。これにより、メモリを有効利用することができる。   For example, before the first application is terminated, the memory area secured by the memory management mechanism 50 is copied to the memory management mechanism 50 of the application process to be relayed and remapped, and then the process of the first application is terminated. Process. Specifically, the virtual memory area reserved by using the above VirtualAlloc or the like (that is, the area managed by the management table 501 and including the area in which the memory is secured in S601 in FIG. 6) is used by using VirtualCopy or the like. Relay is realized by copying virtual memory between processes. That is, while managing the memory allocation request for each application to the memory management mechanism 50, considering the timing of each memory allocation request and memory release, all or a part of the memory allocated in the first application is transferred to the next application. When relaying to, the memory may be allocated to the next application. Thereby, the memory can be used effectively.

以上説明したとおり、本発明の情報処理装置(画像読取装置1)では、OSに頻繁にメモリ確保要求やメモリ解放要求を行うことなく、アプリケーションからの頻繁に行われるメモリ確保要求やメモリ解放要求に応えて、アプリケーションにメモリを割り当てることが可能となるため、メモリ確保要求を受けた際に物理メモリ領域の確保を行い、メモリ解放要求を受けた際に前記確保した物理メモリ領域の解放を行うOSで動作する環境において、本発明のメモリ管理機構50によりアプリケーションからのメモリ確保要求やメモリ解放要求に速やかに対応し、アプリケーションを無駄に待たせることなくなるので、アプリケーションのパフォーマンス低下を抑えることができる。したがって、処理全体のパフォーマンスを向上し、ユーザの利便性を向上することができる。特に、画像メモリの確保及び解放時にメモリ管理機構50を用いることにより、パフォーマンスを要求する画像処理中は、OSが時間のかかるメモリ確保、解放処理を行わなくなるので、処理全体のパフォーマンスを向上することができる。   As described above, in the information processing apparatus (image reading apparatus 1) according to the present invention, a memory allocation request or a memory release request that is frequently made by an application is performed without frequently making a memory allocation request or a memory release request to the OS. In response, the memory can be allocated to the application. Therefore, an OS that secures a physical memory area when a memory securing request is received and releases the secured physical memory area when a memory releasing request is received. In the environment where the application operates, the memory management mechanism 50 of the present invention can quickly respond to the memory securing request and the memory release request from the application, and the application is not made to wait unnecessarily, so that the performance degradation of the application can be suppressed. Therefore, it is possible to improve the performance of the entire process and improve user convenience. In particular, by using the memory management mechanism 50 at the time of securing and releasing the image memory, the OS does not perform time-consuming memory securing and releasing processing during image processing that requires performance, thereby improving the performance of the entire processing. Can do.

なお、メモリ確保、解放時に圧縮処理や断片化解消処理やクリア処理などを行う高度なメモリ管理機能を有するOSで動作する情報読取装置では、OSに頻繁にメモリ確保要求やメモリ解放要求を行うことがなくなるので、メモリ確保処理、メモリ解放処理時にOSにより実行される解放時に圧縮処理や断片化解消処理やクリア処理によるパフォーマンス低下が抑えることができ、さらなる効果を期待できる。   Note that in an information reading apparatus operating on an OS having an advanced memory management function that performs compression processing, fragmentation elimination processing, clear processing, etc. at the time of memory allocation / release, the OS frequently makes memory allocation requests and memory release requests. Therefore, a decrease in performance due to compression processing, fragmentation elimination processing, and clear processing at the time of release executed by the OS during memory allocation processing and memory release processing can be suppressed, and further effects can be expected.

以下、実施例2について説明する。
図8は、本発明の実施例2におけるメモリ管理機構50のメモリ管理テーブルの一例を示した図である。
実施例2では、メモリ管理テーブルは、高速メモリ確保可能な予約メモリ領域の標準メモリ管理テーブル51と、低速ながら要求に応じてその都度メモリを確保する拡張メモリ管理テーブル81の二つが存在するものとする。拡張メモリ管理テーブル81は、本発明の拡張管理手段に対応す
Example 2 will be described below.
FIG. 8 is a diagram showing an example of the memory management table of the memory management mechanism 50 according to the second embodiment of the present invention.
In the second embodiment, there are two memory management tables: a standard memory management table 51 of a reserved memory area where high-speed memory can be secured, and an extended memory management table 81 which secures memory each time it is requested at a low speed. To do. The extended memory management table 81 corresponds to the extended management means of the present invention.

拡張メモリ管理テーブル81において、列82は、メモリ管理番号を示している。列82は、メモリ管理番号に対応するアドレスのメモリ確保状態を示している。各行がそれぞれメモリ管理番号(列82)と、メモリ確保状態(列83)との対応を示している。   In the extended memory management table 81, a column 82 indicates a memory management number. A column 82 indicates a memory reservation state of an address corresponding to the memory management number. Each row indicates the correspondence between the memory management number (column 82) and the memory allocation state (column 83).

標準メモリ管理テーブル51と拡張メモリ管理テーブル81は、画像読取装置1内部でアプリケーションから最初のメモリ確保要求が成された時にRAM34上に制御部32の指示により作成され、全てのメモリ管理番号は未確保状態として初期化される。標準メモリ管理テーブル51と拡張メモリ管理テーブル81の作成方法については、実施例1で示した標準メモリ管理テーブル51の作成方法と同様であるので説明は省略する。   The standard memory management table 51 and the extended memory management table 81 are created in accordance with an instruction from the control unit 32 on the RAM 34 when the first memory reservation request is made from an application within the image reading apparatus 1, and all memory management numbers are not yet stored. Initialized as a secured state. The method for creating the standard memory management table 51 and the extended memory management table 81 is the same as the method for creating the standard memory management table 51 shown in the first embodiment, and a description thereof will be omitted.

実施例2では、標準メモリ管理テーブル51と拡張メモリ管理テーブル81はそれぞれ65536個の要素が存在し、一つの要素(メモリ管理番号ごと)あたり4KBのメモリの使用状態を記憶している。   In the second embodiment, each of the standard memory management table 51 and the extended memory management table 81 has 65536 elements, and stores a memory usage state of 4 KB per element (for each memory management number).

図9は、本発明の実施例2に係る画像読取装置のメモリ確保シーケンス処理(メモリ管理機構50のメモリ確保処理)を示したフローチャートである。図中、S601〜S607、S900〜S905は各ステップを示し、図6と同一のステップには同一のステップ番号を付してある。なお、このフローチャートの処理は、制御部32内のCPUが記録媒体33にコンピュータ読み取り可能に記録されたプログラムを読み出して実行することにより実現される。また、このメモリ確保処理は、アプリケーション44からメモリ管理機構50にメモリ確保指示(メモリ確保要求)があった時にメモリ管理機構50で実行される。   FIG. 9 is a flowchart showing a memory securing sequence process (memory securing process of the memory management mechanism 50) of the image reading apparatus according to the second embodiment of the present invention. In the figure, S601 to S607 and S900 to S905 indicate the respective steps, and the same steps as those in FIG. Note that the processing in this flowchart is realized by the CPU in the control unit 32 reading and executing a program recorded in the recording medium 33 so as to be readable by a computer. This memory securing process is executed by the memory management mechanism 50 when a memory securing instruction (memory securing request) is issued from the application 44 to the memory management mechanism 50.

本実施例では、図9(a)のS604において、要求されているメモリ量が標準メモリ管理テーブル51に空きメモリとして存在しないと判定した場合(S604でNoの場合)、メモリ管理機構50(制御部32内のCPU)は、エラーとすることなく、S900において、拡張メモリ確保処理(図9(b))を実行する。この場合、本実施例では、エラーにはならないが、メモリ確保処理・解放処理が本来のOSのメモリ確保処理・メモリ解放処理として行われるため、実施例1で示したメモリ管理機構50のメモリ確保処理と比較すると高速化は望めない。   In this embodiment, if it is determined in S604 of FIG. 9A that the requested memory amount does not exist as free memory in the standard memory management table 51 (No in S604), the memory management mechanism 50 (control) The CPU in the unit 32 executes the extended memory securing process (FIG. 9B) in S900 without causing an error. In this case, although no error occurs in the present embodiment, the memory allocation processing / release processing is performed as the original OS memory allocation processing / memory release processing, so the memory management mechanism 50 described in the first embodiment allocates memory. Compared with processing, speeding up cannot be expected.

以下、図9(b)を用いて、上記S900の拡張メモリ確保処理について説明する。
S901では、メモリ管理機構50は、アプリケーション44から要求されたメモリ量が物理メモリ上に空きメモリとして存在するかどうかを判定する。そして、S901において、アプリケーション44から要求されたメモリ量が物理メモリ上に空きメモリとして存在しないと判定した場合、メモリ管理機構50は、メモリ不足をアプリケーション44に通知するために、S903へ処理を進める。このS901の処理により、アプリケーション44で必要とされる空きメモリ量が物理メモリ上に存在する場合にのみ、OSにメモリ確保要求を行うように制御でき、確保できない容量のメモリをOSに要求してエラーとなってしまうといった無駄を回避することができる。即ち、アプリケーション44で必要とされる空きメモリ量が存在しない場合には、アプリケーション44を待たせることなく、速やかにエラー処理を行うことができる。
Hereinafter, the extended memory securing process in S900 will be described with reference to FIG.
In S901, the memory management mechanism 50 determines whether or not the memory amount requested by the application 44 exists as free memory on the physical memory. If it is determined in S901 that the amount of memory requested by the application 44 does not exist as free memory in the physical memory, the memory management mechanism 50 advances the process to S903 in order to notify the application 44 of memory shortage. . With the processing of S901, it is possible to control the OS to make a memory reservation request only when the amount of free memory required by the application 44 exists on the physical memory, and request the OS for a memory capacity that cannot be secured. It is possible to avoid waste such as an error. In other words, when there is no free memory amount required by the application 44, error processing can be performed promptly without causing the application 44 to wait.

S903では、メモリ管理機構50は、アプリケーション44から要求とされているメモリ量が物理メモリ上に空きメモリとして存在していないため、アプリケーション44にメモリ不足であることをエラーを返すことで通知し、処理を終了する。   In S903, the memory management mechanism 50 notifies the application 44 that the memory is insufficient because the amount of memory requested from the application 44 does not exist as free memory on the physical memory, by returning an error, The process ends.

一方、S901において、アプリケーション44から要求されたメモリ量が物理メモリ上に空きメモリとして存在すると判定した場合、メモリ管理機構50は、アプリケーション44から要求されたメモリ量を実際に確保するために、S902〜S905(拡張割当処理)へ処理を進める。   On the other hand, if it is determined in S901 that the memory amount requested by the application 44 exists as a free memory in the physical memory, the memory management mechanism 50 performs S902 in order to actually secure the memory amount requested by the application 44. The process proceeds to S905 (extended allocation process).

S902では、メモリ管理機構50は、アプリケーション44から要求されたメモリ量が物理メモリ上に空きメモリとして存在していることが分かっているので、アプリケーション44から要求されたメモリ量を実際に確保するようにOSにメモリ確保要求を行う。OSは、この要求に応じて、要求された容量の物理メモリを確保する。即ち、OSは、図3で説明したように、物理メモリの空き領域を仮想メモリ上の領域にマッピングして(物理メモリの空き領域と仮想メモリの領域に関連付ける情報をアドレステーブルにセットして)、物理メモリの領域が割り当てられた仮想メモリの領域の先頭アドレスをメモリ管理機構50に返す。そして、メモリ管理機構50は、アプリケーション44で使用可能な状態にするためにS904へ処理を進める。このS902の処理により、アプリケーション44で必要とされる空きメモリ量の物理メモリを確保することができる。   In S902, the memory management mechanism 50 knows that the amount of memory requested by the application 44 exists as a free memory in the physical memory, so that it actually secures the amount of memory requested by the application 44. The memory is requested to the OS. In response to this request, the OS secures a physical memory having the requested capacity. That is, as described in FIG. 3, the OS maps the free area of the physical memory to the area on the virtual memory (sets information associated with the free area of the physical memory and the virtual memory area in the address table). The start address of the virtual memory area to which the physical memory area is allocated is returned to the memory management mechanism 50. Then, the memory management mechanism 50 advances the process to S904 to make the application 44 usable. Through the processing in S902, it is possible to secure a physical memory having an amount of free memory required by the application 44.

S904では、メモリ管理機構50は、上記S902で確保して仮想メモリ上にマッピングした先頭アドレスを(OSから応答された仮想メモリの先頭メモリアドレス)をアプリケーション44に使用可能なメモリ領域として通知する。このS902の通知を受けたアプリケーション44は、通知された先頭アドレスから要求した分だけのメモリを使用することが可能となる。また、メモリ管理機構50は、直接物理メモリを確保しているため標準メモリ管理テーブル51の一括管理されているメモリ領域とは異なるので、上記先頭アドレスから確保したメモリ量分だけ拡張メモリとして確保中であることを記憶しておくため、S905へ処理を進める。   In S904, the memory management mechanism 50 notifies the application 44 of the start address secured in S902 and mapped on the virtual memory (the start memory address of the virtual memory returned from the OS) as a usable memory area. The application 44 that has received the notification in S902 can use as much memory as requested from the notified start address. Further, since the memory management mechanism 50 directly reserves physical memory and is different from the memory area collectively managed in the standard memory management table 51, the memory management mechanism 50 is currently secured as an extended memory by the amount of memory secured from the top address. In order to store this, the process proceeds to S905.

S905では、メモリ管理機構50は、アプリケーション44が使用可能なメモリ領域として先頭アドレスから要求サイズ分、メモリ管理機構50の拡張メモリ管理テーブル81の状態を「拡張先頭」,「拡張確保」(メモリ管理番号1,2番のように)と記憶し(拡張確保領域として登録し)、処理を終了する。なお、拡張確保先頭アドレスに、今回確保されたメモリ容量を状態と一緒に記憶するようにしても良い。このS905の処理により、メモリ管理機構50は、拡張メモリ管理テーブル81作成時に予約した領域内の各メモリ管理番号に対応する領域が、メモリ確保してアプリケーション44に割り当てた領域か、メモリ未確保の領域であるか確実に管理し、以後、メモリ確保及びアプリケーション44へのメモリ割り当てを速やかに行うことができる。   In S905, the memory management mechanism 50 sets the status of the extended memory management table 81 of the memory management mechanism 50 as the memory size that can be used by the application 44 for the requested size from the start address, “extension start”, “ensure expansion” (memory management). (Such as No. 1 and No. 2) are stored (registered as an expansion reservation area), and the process is terminated. Note that the memory capacity reserved this time may be stored together with the state at the expansion reserved head address. Through the processing of S905, the memory management mechanism 50 determines whether the area corresponding to each memory management number in the area reserved when the extended memory management table 81 is created is an area allocated to the application 44 after securing the memory, or an unallocated memory. It is possible to reliably manage the area, and thereafter, the memory can be secured and the memory can be quickly allocated to the application 44.

以上説明したとおり、実施例2のメモリ確保シーケンス処理では、予め確保したメモリを超えるメモリ容量を要求された場合でも、アプリケーションから要求され際に要求された容量だけメモリを追加確保して、メモリ不足に陥ることなく、アプリケーションにメモリを割り当てて処理を続行することができる。また、システムに対する影響を最低限に抑えることができる。   As described above, in the memory allocation sequence processing according to the second embodiment, even when a memory capacity exceeding the memory allocated in advance is requested, additional memory is ensured by the capacity requested when requested by the application, and the memory is insufficient. Without falling into the process, memory can be allocated to the application and the process can be continued. Further, the influence on the system can be minimized.

図10は、本発明の実施例2に係る画像読取装置のメモリ解放シーケンス処理(メモリ管理機構50のメモリ確保処理)を示したフローチャートである。図中、S701〜S705、S1000〜S1003は各ステップを示し、図7と同一のステップには同一のステップ番号を付してある。なお、このフローチャートの処理は、制御部32内のCPUが記録媒体33にコンピュータ読み取り可能に記録されたプログラムを読み出して実行することにより実現される。また、このメモリ解放処理は、アプリケーション44からメモリ管理機構50へ先頭アドレスを指定して解放指示(メモリ解放要求)があった時にメモリ管理機構50で実行される。   FIG. 10 is a flowchart showing a memory release sequence process (memory securing process of the memory management mechanism 50) of the image reading apparatus according to the second embodiment of the present invention. In the figure, S701 to S705 and S1000 to S1003 indicate steps, and the same steps as those in FIG. Note that the processing in this flowchart is realized by the CPU in the control unit 32 reading and executing a program recorded in the recording medium 33 so as to be readable by a computer. This memory release process is executed by the memory management mechanism 50 when a release instruction (memory release request) is issued from the application 44 to the memory management mechanism 50 by designating the head address.

本実施例では、図10(a)のS701において、メモリ解放要求で指定された先頭アドレスが図9(a)のS606,S607で確保された仮想メモリの先頭アドレスでないと判定した場合(S701でNoの場合)、メモリ管理機構50(制御部32内のCPU)は、S1000において、拡張メモリ解放処理(図10(b))を実行する。   In this embodiment, when it is determined in S701 in FIG. 10A that the head address specified in the memory release request is not the head address of the virtual memory secured in S606 and S607 in FIG. 9A (in S701). In the case of No), the memory management mechanism 50 (CPU in the control unit 32) executes an extended memory release process (FIG. 10B) in S1000.

以下、図10(b)を用いて、上記S1000の拡張メモリ解放処理について説明する。
S1001では、メモリ管理機構50は、今回のメモリ解放要求が図9(b)のメモリ確保シーケンス処理で仮想メモリの拡張確保された先頭アドレスかどうかを判別する。具体的には拡張メモリ管理テーブル81で指定されたアドレスのメモリ状態が「拡張先頭」になっているかどうかを判別する。そして、上記S1001において、メモリ解放要求で指定された仮想メモリのアドレスが拡張確保された先頭アドレスでないと判定した場合、メモリ管理機構50は、メモリ管理機構50で確保されたメモリではないので処理を終了する。具体的には、拡張メモリ管理テーブル81のメモリ管理番号1番や3番以外が指定された場合は、拡張確保された先頭アドレスでは無いので処理を終了する条件となる。
Hereinafter, the extended memory release process of S1000 will be described with reference to FIG.
In S1001, the memory management mechanism 50 determines whether or not the current memory release request is the start address where the expansion of the virtual memory is secured in the memory securing sequence process of FIG. 9B. Specifically, it is determined whether or not the memory state of the address specified in the extended memory management table 81 is “extended head”. If it is determined in S1001 that the virtual memory address specified in the memory release request is not the expanded reserved start address, the memory management mechanism 50 does not have the memory reserved by the memory management mechanism 50, and the process is performed. finish. Specifically, when a memory management number other than 1 or 3 in the extended memory management table 81 is designated, it is a condition for ending the processing because it is not the start address secured for expansion.

一方、上記S1001において、メモリ解放要求で指定された仮想メモリのアドレスが拡張確保された先頭アドレスであると判定した場合、メモリ管理機構50は、物理メモリの解放処理を行うためにS1002(拡張解放処理)へ処理を進める。   On the other hand, if it is determined in S1001 that the address of the virtual memory specified in the memory release request is the head address that has been secured, the memory management mechanism 50 performs S1002 (expanded release) to perform the physical memory release process. Process proceeds to (Process).

S1002では、メモリ管理機構50は、拡張メモリ管理テーブル81において、拡張確保された先頭アドレス(「拡張確保」のアドレス)から次の拡張確保された先頭アドレスまで、もしくは次の「未確保」のアドレスまで検索し、その分の拡張確保された物理メモリを解放するようにOSにメモリ解放要求を行う。図8の例では、拡張メモリ管理テーブル81におけるメモリ管理番号1番が指定された場合はメモリ管理番号1番から2番までに相当するメモリをOSの仮想メモリのマッピングから解放するメモリ解放要求をOSに行う。また、3番が指定された時は3番に相当するメモリのみをOSの仮想メモリのマッピングから解放するメモリ解放要求をOSに行う。OSは、この要求に応じて、要求された領域をOSの仮想メモリのマッピングから解放する。即ち、OSは、アドレステーブルから、物理メモリの領域を仮想メモリの領域に関連付ける情報を削除して、該当する物理メモリの領域を再度、仮想メモリに割り当て可能にする。このS1002の処理により、アプリケーション44から返却された拡張メモリ領域を解放し、任意のプログラムが使用可能な状態とすることができる。   In S1002, the memory management mechanism 50 in the extended memory management table 81 extends from the head address reserved for expansion (the address of “ensured expansion”) to the head address reserved for the next expansion or the next “unsecured” address. And the OS is requested to release the memory so as to release the physical memory that has been secured. In the example of FIG. 8, when the memory management number 1 in the extended memory management table 81 is designated, a memory release request for releasing the memory corresponding to the memory management numbers 1 to 2 from the virtual memory mapping of the OS is issued. To the OS. When No. 3 is designated, a memory release request is issued to the OS to release only the memory corresponding to No. 3 from the virtual memory mapping of the OS. In response to this request, the OS releases the requested area from the virtual memory mapping of the OS. That is, the OS deletes information relating the physical memory area to the virtual memory area from the address table, and enables the corresponding physical memory area to be assigned to the virtual memory again. By the processing in S1002, the extended memory area returned from the application 44 can be released, and any program can be used.

次に、S1003において、メモリ管理機構50は、上記S1002の処理で解放されたメモリ管理番号に相当するアドレスは物理メモリを解放済みなので、上記S1002の処理で解放されたメモリ管理番号に相当するアドレスの拡張メモリ管理テーブル81のメモリ状態83を「未確保」状態に変更する処理を行い(未確保領域として登録し)、処理を終了する。このS1003の処理により、メモリ管理機構50は、上記S1002で解放したメモリ領域を、再度、メモリ確保することが可能となる。
以上のように、実施例2のメモリ解放シーケンス処理では、実施例2のメモリ確保シーケンス処理で追加確保したメモリを、アプリケーションからメモリ解放された際に解放して、任意のプログラムが使用可能にして、システムがメモリ不足に陥ってしまうことを抑えることができる。
Next, in S1003, since the memory management mechanism 50 has released the physical memory at the address corresponding to the memory management number released in the process of S1002, the address corresponding to the memory management number released in the process of S1002 above. The process of changing the memory state 83 of the extended memory management table 81 to the “unsecured” state is performed (registered as an unsecured area), and the process ends. By the processing in S1003, the memory management mechanism 50 can secure the memory for the memory area released in S1002 again.
As described above, in the memory release sequence process according to the second embodiment, the memory additionally reserved in the memory reservation sequence process according to the second embodiment is released when the memory is released from the application so that an arbitrary program can be used. The system can be prevented from running out of memory.

以上説明したとおり、本発明の実施例2の画像読取装置では、予め確保した予約メモリを超えるメモリ容量を要求された場合でも、メモリ不足に陥ることなく、アプリケーションにメモリを割り当てて処理を続行できるため、システムの使い勝手を向上することができる。   As described above, in the image reading apparatus according to the second embodiment of the present invention, even when a memory capacity exceeding the reserved memory reserved in advance is requested, the process can be continued by allocating memory to the application without falling short of memory. Therefore, the usability of the system can be improved.

(他の実施例1)
本発明の情報処理装置は、スマートフォン、携帯電話、各種タブレット型コンピュータ等を含む携帯端末であってもよい。
(Other Example 1)
The information processing apparatus of the present invention may be a mobile terminal including a smartphone, a mobile phone, various tablet computers, and the like.

本発明の携帯端末は、図2に示した情報処理装置と同様に、制御部、RAM、記録媒体、通信部、表示部等を有し、制御部が、通信部により受信したウェブページをRAM(物理メモリ)を用いて表示部に表示処理するウェブ表示アプリケーション(ウェブブラウザ)を実行可能である。なお、ウェブページとは、htmlやxmlなどを始めとしたタグマークアップ言語(構造化言語)を用いて動画、画像、文章などを表示するためのデータやjava(登録商標)スクリプト等のユーザ入力によってその表示内容を変化させるためのプログラムを含むものであり(即ち、構造化言語を用いて表現されたデータであり)、ウェブブラウザ等のアプリケーションにより表示可能である。ウェブページは、マークアップ言語によって階層化されているために解析が終了するまでデータの容量が不定である。   Similar to the information processing apparatus shown in FIG. 2, the portable terminal of the present invention has a control unit, a RAM, a recording medium, a communication unit, a display unit, and the like, and the control unit stores the web page received by the communication unit in the RAM. A web display application (web browser) that performs display processing on the display unit using (physical memory) can be executed. A web page refers to user input such as data for displaying moving images, images, text, etc. using a tag markup language (structured language) such as html or xml, or a Java (registered trademark) script. Includes a program for changing the display content (that is, data expressed using a structured language) and can be displayed by an application such as a web browser. Since the web page is hierarchized by the markup language, the data capacity is undefined until the analysis is completed.

また、カメラ等の撮像部を有し、撮像部により撮像処理を実行させて撮像部から取得された画像データの画像処理を行う画像処理アプリケーションを実行可能に構成してもよい。また、通信部から取得された画像データの画像処理を行う画像処理アプリケーションを実行可能に構成してもよい。上記携帯端末と外部装置としてのスキャナを(有線又は無線で)通信可能に接続して、スキャナから画像データを取得して画像処理を行う画像処理アプリケーションを実行可能に構成してもよい。さらに、上記携帯端末と外部装置としてのプリンタを(有線又は無線で)通信可能に接続して、RAM又は記録媒体に格納される画像データを画像処理してプリンタで印刷させる画像処理アプリケーションを実行可能に構成してもよい。   In addition, an image processing application that includes an image capturing unit such as a camera and performs image processing of image data acquired from the image capturing unit by causing the image capturing unit to perform image capturing processing may be configured to be executable. Further, an image processing application that performs image processing of image data acquired from the communication unit may be configured to be executable. The portable terminal and a scanner as an external device may be connected so as to be communicable (wired or wirelessly), and an image processing application that acquires image data from the scanner and performs image processing may be configured to be executable. Furthermore, the portable terminal and a printer as an external device can be communicably connected (wired or wirelessly) to execute an image processing application that performs image processing on image data stored in a RAM or a recording medium and prints the image on the printer. You may comprise.

また、本発明の携帯端末は、メモリ確保要求を受けた際に物理メモリ領域の確保を行い、メモリ解放要求を受けた際に前記確保した物理メモリ領域の解放を行うオペレーティングシステムで動作する。さらに、本発明の携帯端末は、上述した実施例1、実施例2に示したメモリ管理機構を有する。また、本発明の携帯端末で動作する上記ウェブ表示アプリケーションは、ウェブページの表示処理を行うためのメモリの確保及び解放時に、メモリ管理機構50を用いるものとする。なお、このアプリケーションは、ウェブページの表示処理を行うためのメモリの確保・解放か、それ以外のメモリ確保・解放かを区別できる構成となっている。このアプリケーションの場合、メモリ管理機構50がアプリケーションからの最初のメモリ要求の際に一括してメモリ確保するメモリ確保量は、OSに一度に要求可能な最大メモリ容量からシステム使用容量(上記予め確保するメモリ以外に、携帯端末の制御部(CPU)が使用する必要最低限の容量)を差し引いたメモリ量としてもよい。   The portable terminal of the present invention operates in an operating system that secures a physical memory area when a memory securing request is received and releases the secured physical memory area when a memory release request is received. Furthermore, the portable terminal of the present invention has the memory management mechanism shown in the first and second embodiments. The web display application that operates on the portable terminal of the present invention uses the memory management mechanism 50 when securing and releasing the memory for performing the web page display process. Note that this application is configured to be able to distinguish between securing / releasing memory for performing web page display processing and securing / releasing other memory. In the case of this application, the memory allocation amount that the memory management mechanism 50 collects memory at the time of the first memory request from the application is determined from the maximum memory capacity that can be requested to the OS at one time from the system use capacity (the above-mentioned reservation is ensured in advance). In addition to the memory, a memory amount obtained by subtracting a necessary minimum capacity used by the control unit (CPU) of the mobile terminal may be used.

同様に、上記画像処理アプリケーションは、画像メモリの確保・解放かそれ以外のメモリ確保・解放かを区別できる構成であり、画像メモリの確保及び解放時にメモリ管理機構50を用いるものとする。この画像処理アプリケーションの場合、メモリ管理機構50がアプリケーションからの最初のメモリ要求の際に一括してメモリ確保するメモリ確保量は、カメラやスキャナが一度の読み取り処理で読み取る画像データのサイズに、アプリケーションでの画像処理単位(例えば、スキャンの場合は原稿片面、カメラの場合は1フレーム、プリントの場合は1ページ)の画像データのサイズを、加算したサイズに対応するメモリ量としてもよい。つまり、原稿の画像読み取り処理であれば、アプリケーションによる画像処理能力に応じて、例えば、数ページ分、原稿の枚数分に相当する所定容量のメモリ量をメモリ確保量とすることができる。   Similarly, the image processing application is configured to be able to distinguish whether the image memory is secured / released or other memory secured / released, and the memory management mechanism 50 is used when securing and releasing the image memory. In the case of this image processing application, the memory allocation amount that the memory management mechanism 50 collects memory at the time of the first memory request from the application is equal to the size of the image data that the camera or scanner reads in one reading process. The size of image data in the image processing unit (for example, one side of a document for scanning, one frame for a camera, and one page for a print) may be the amount of memory corresponding to the added size. That is, in the case of document image reading processing, a memory capacity of a predetermined capacity corresponding to, for example, several pages and the number of sheets of the document can be set as the memory reservation amount according to the image processing capability of the application.

このような構成を有することにより、必ずしも物理メモリが潤沢に存在しない携帯端末であっても、容量が不定なウェブページの表示や画像処理を行う等の使用するメモリ容量の大きくなる可能性のあるアプリケーションが、上述のようなOSで動作する携帯端末で実行された場合でも、アプリケーションからのメモリ確保要求やメモリ解放要求に速やかに対応し、アプリケーションを無駄に待たせることなくなるので、アプリケーションのパフォーマンスの低下を抑えることができる。   By having such a configuration, even a mobile terminal that does not necessarily have abundant physical memory may increase the memory capacity to be used, such as displaying web pages or performing image processing with an undefined capacity. Even when an application is executed on a portable terminal operating on the OS as described above, it can quickly respond to a memory securing request or a memory releasing request from the application, and the application does not have to wait unnecessarily. The decrease can be suppressed.

本発明では、メモリ確保・解放要求を受けた時点で物理メモリ領域の確保・解放を行うOSや、メモリ確保・解放要求を受けた際に使用中のメモリ領域の圧縮処理や断片化解消処理やクリア処理などを行う高度なメモリ管理機能を有するOSのように、メモリの確保処理と解放処理が比較的遅いOSで動作する情報処理装置にて、OSに対するメモリの確保要求と解放要求の回数を減らして、アプリケーションのパフォーマンスの低下を抑える。特に、パフォーマンスが要求される処理中では、OSに対するメモリの確保要求と解放要求は行わないように構成する。   In the present invention, an OS that secures / releases a physical memory area when a memory securing / release request is received, a compression process or a fragmentation elimination process for a memory area that is in use when a memory securing / release request is received, The number of memory allocation requests and release requests to the OS is determined in an information processing apparatus that operates on an OS with relatively slow memory allocation and release processing, such as an OS having an advanced memory management function that performs clear processing and the like. To reduce application performance degradation. In particular, during processing that requires performance, it is configured not to make a memory allocation request and a release request to the OS.

具体的にはパフォーマンスが要求される処理が開始される前に高速に処理したい処理分のメモリ容量を予め確保しておき、処理中はOSに対してメモリ確保要求や、メモリ解放要求は行わないようにする。そして、その処理が終了したら、処理前に確保したメモリを解放するようにする。また、システムや他のアプリケーションでもメモリは使用されるため、全ての物理メモリを高速な画像処理用に割り当てることは難しいため、予め確保した領域を超える容量のメモリの確保については、その時点でOSに対してメモリ確保要求、メモリ解放要求を随時行い、メモリ不足に陥らないように構成する。   Specifically, a memory capacity for processing to be processed at a high speed is secured in advance before processing requiring performance is started, and no memory allocation request or memory release request is issued to the OS during the processing. Like that. When the process is completed, the memory secured before the process is released. Also, since memory is used in the system and other applications, it is difficult to allocate all physical memory for high-speed image processing. In order to prevent a memory shortage, a memory securing request and a memory releasing request are made at any time.

以上の構成により、OSがメモリ確保・解放を行う回数を減らし、本発明のメモリ管理機構50によりアプリケーションからのメモリ確保要求やメモリ解放要求に速やかに対応し、アプリケーションを無駄に待たせないことで、アプリケーションのパフォーマンス低下を抑えることができる。また、予め確保した予約メモリを超えるメモリ容量を要求された場合でも、アプリケーションから要求され際に要求された容量だけメモリを追加確保して、メモリ不足に陥ることなく、アプリケーションにメモリを割り当てて処理を続行することが可能となる。また、システムに対する影響を最低限に抑えることができる。   With the above configuration, the number of times the OS performs memory allocation / release is reduced, the memory management mechanism 50 of the present invention can quickly respond to memory allocation requests and memory release requests from the application, and the application does not wait unnecessarily. , Application performance degradation can be suppressed. In addition, even when a memory capacity exceeding the reserved memory reserved in advance is requested, additional memory is secured by the capacity requested when requested by the application, and the memory is allocated to the application without causing a memory shortage. It is possible to continue. Further, the influence on the system can be minimized.

なお、上述した各種データの構成及びその内容はこれに限定されるものではなく、用途や目的に応じて、様々な構成や内容で構成されることは言うまでもない。   It should be noted that the configuration and contents of the various data described above are not limited to this, and it goes without saying that the various data and configurations are configured according to the application and purpose.

以上、一実施例について示したが、本発明は、例えば、システム、装置、方法、プログラムもしくは記憶媒体等としての実施態様をとることが可能であり、具体的には、複数の機器から構成されるシステムに適用しても良いし、また、一つの機器からなる装置に適用しても良い。   Although one embodiment has been described above, the present invention can take the form of, for example, a system, apparatus, method, program, or storage medium, and specifically includes a plurality of devices. The present invention may be applied to a system including a single device.

(他の実施例2)
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
また、本発明は、複数の機器から構成されるシステムに適用しても、1つの機器からなる装置に適用してもよい。
(Other Example 2)
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.
Further, the present invention may be applied to a system composed of a plurality of devices or an apparatus composed of a single device.

本発明は上記実施例に限定されるものではなく、本発明の趣旨に基づき種々の変形(各実施例の有機的な組合せを含む)が可能であり、それらを本発明の範囲から除外するものではない。即ち、上述した各実施例及びその変形例を組み合わせた構成も全て本発明に含まれるものである。   The present invention is not limited to the above embodiments, and various modifications (including organic combinations of the embodiments) are possible based on the spirit of the present invention, and these are excluded from the scope of the present invention. is not. That is, the present invention includes all the combinations of the above-described embodiments and modifications thereof.

本発明の情報処理装置を、メモリ確保・解放要求を受けた時点で物理メモリ領域の確保・解放を行うOSや、メモリ確保・解放要求を受けた際に使用中のメモリ領域の圧縮処理や断片化解消処理やクリア処理などを行う高度なメモリ管理機能を有するOSのみでなく、メモリの確保処理と解放処理が比較的遅いOSで動作する情報処理装置に適用することで効果を期待できる。   The information processing apparatus according to the present invention includes an OS that secures / releases a physical memory area when a memory allocation / release request is received, and a compression process or fragment of a memory area that is in use when a memory allocation / release request is received The effect can be expected by applying it not only to an OS having an advanced memory management function for performing de-serialization processing, clear processing, etc., but also to an information processing apparatus that operates on an OS with relatively slow memory securing and releasing processes.

1 情報処理装置(画像読取装置)
21 情報表示部
31 画像読取部
32 制御部
33 記憶媒体
34 RAM
35 外部通信インタフェース(外部通信I/F)
50 メモリ管理機構
51 標準メモリ管理テーブル
81 拡張メモリ管理テーブル
1. Information processing device (image reading device)
21 Information Display Unit 31 Image Reading Unit 32 Control Unit 33 Storage Medium 34 RAM
35 External communication interface (external communication I / F)
50 Memory management mechanism 51 Standard memory management table 81 Extended memory management table

Claims (25)

メモリ確保要求を受けた際に物理メモリ領域の確保を行い、メモリ解放要求を受けた際に前記確保した物理メモリ領域の解放を行うオペレーティングシステムで動作する情報処理装置であって、
アプリケーションプログラムからの最初のメモリ確保要求に応じて、前記オペレーティングシステムに対して所定容量のメモリ確保要求を行って、前記所定容量のメモリ領域を確保する確保手段と、
前記アプリケーションプログラムからのメモリ確保要求に応じて、前記確保手段で確保したメモリ領域内の前記アプリケーションプログラムへ割り当てていない状態の領域を、前記アプリケーションプログラムに対して割り当てる割当手段と、
を有することを特徴とする情報処理装置。
An information processing apparatus operating in an operating system that secures a physical memory area when receiving a memory securing request and releases the secured physical memory area when receiving a memory release request,
In accordance with an initial memory securing request from the application program, a securing unit that performs a memory securing request with a predetermined capacity to the operating system and secures the memory area with the predetermined capacity;
An allocating unit that allocates, to the application program, an area that is not allocated to the application program in the memory area secured by the securing unit in response to a memory securing request from the application program;
An information processing apparatus comprising:
前記アプリケーションから前記確保手段のメモリ確保処理、前記割当手段の割当処理を含む処理を呼び出すようにしたことを特徴とする請求項1に記載の情報処理装置。   The information processing apparatus according to claim 1, wherein a process including a memory securing process of the securing unit and an allocation process of the allocating unit is called from the application. 前記アプリケーションプログラムからのメモリ解放要求に応じて、前記アプリケーションプログラムから解放要求された領域に対する、前記アプリケーションプログラムへの割り当てを解除する割当解除処理を行う割当解除手段を有することを特徴とする請求項1又は2に記載の情報処理装置。   2. The apparatus according to claim 1, further comprising: deallocation means for performing deallocation processing for deallocating an area requested to be released from the application program in response to a memory release request from the application program. Or the information processing apparatus of 2. 前記アプリケーションから前記割当解除手段の割当解除処理を呼び出すようにしたことを特徴とする請求項3に記載の情報処理装置。   The information processing apparatus according to claim 3, wherein an allocation cancellation process of the allocation cancellation unit is called from the application. 前記割当解除手段により前記アプリケーションプログラムに対して割り当てられた領域が全て割当解除された場合、前記オペレーティングシステムに対して、前記確保手段が確保した前記メモリ領域のメモリ解放要求を行う解放手段を有することを特徴とする請求項3又は4に記載の情報処理装置。   A release unit that issues a memory release request for the memory area secured by the securing unit to the operating system when all the areas allocated to the application program are deallocated by the deallocation unit; The information processing apparatus according to claim 3 or 4, characterized in that: 前記確保手段で確保したメモリ領域内の各領域の前記アプリケーションプログラムへの割り当て状態を記憶管理する管理手段を有し、
前記確保手段は、前記確保したメモリ領域内の全領域を、前記アプリケーションプログラムへ割り当てられていない状態の領域を示す未使用領域として前記管理手段に登録し、
前記割当手段は、前記アプリケーションプログラムへ割り当てた領域を、前記アプリケーションプログラムへ割り当てられている状態の領域を示す使用領域として前記管理手段に登録し、
前記割当解除手段は、前記アプリケーションへの割り当てを解除した領域を、前記未使用領域として前記管理手段に登録することを特徴とする請求項3乃至5のいずれか1項に記載の情報処理装置。
Management means for storing and managing the allocation state of each area in the memory area secured by the securing means to the application program;
The securing means registers all areas in the secured memory area in the management means as unused areas indicating areas not allocated to the application program,
The assigning means registers the area assigned to the application program in the managing means as a use area indicating an area assigned to the application program,
The information processing apparatus according to any one of claims 3 to 5, wherein the deallocation unit registers an area that has been unassigned to the application as the unused area in the management unit.
前記割当手段は、前記確保手段で確保したメモリ領域内に、前記アプリケーションプログラムから要求された容量の、前記アプリケーションプログラムへ割り当てられていない状態の領域が存在しない場合、前記オペレーティングシステムに対して前記アプリケーションプログラムから要求された容量のメモリ確保要求を行って新たなメモリ領域を確保し、該確保した新たなメモリ領域を前記アプリケーションプログラムに対して割り当てる拡張割当処理を行うことを特徴とする請求項3乃至6のいずれか1項に記載の情報処理装置。   When the allocation unit does not have an area of the capacity requested by the application program that is not allocated to the application program in the memory area secured by the securing unit, the allocation unit 4. A memory allocation request for a capacity requested by a program is made, a new memory area is secured, and an extended allocation process for allocating the secured new memory area to the application program is performed. The information processing apparatus according to any one of 6. 前記割当解除手段は、前記アプリケーションプログラムからメモリ解放要求されたメモリ領域が前記拡張割当処理により割り当てられたメモリ領域である場合、前記オペレーティングシステムに対して、前記解放要求されたメモリ領域のメモリ解放要求を行う拡張解放処理を行うことを特徴とする請求項7に記載の情報処理装置。   When the memory area requested for memory release from the application program is a memory area allocated by the extended allocation process, the deallocation unit issues a memory release request for the memory area requested for release to the operating system. The information processing apparatus according to claim 7, wherein an extended release process is performed. 前記拡張割当処理により新たに確保可能なメモリ領域の確保状態を記憶管理する拡張管理手段を有し、
前記割当手段は、前記拡張割当処理で確保した領域を、拡張確保領域として前記拡張管理手段に登録し、
前記割当解除手段は、前記拡張解放処理で解放した領域を、未確保領域として前記拡張管理手段に登録することを特徴とする請求項8に記載の情報処理装置。
Extended management means for storing and managing a secured state of a memory area that can be newly secured by the extended allocation process;
The allocating means registers the area secured by the extended allocation process as an expanded secured area in the extended management means,
9. The information processing apparatus according to claim 8, wherein the deallocation unit registers the area released by the extension release process in the extension management unit as an unsecured area.
前記オペレーティングシステムは、前記物理メモリの確保を行う際、及び/又は、前記物理メモリの解放を行う際に、前記物理メモリの圧縮処理、及び/又は、断片化解消処理を行うことを特徴とする請求項1乃至9のいずれか1項に記載の情報処理装置。   The operating system performs a compression process and / or a fragmentation elimination process of the physical memory when the physical memory is secured and / or when the physical memory is released. The information processing apparatus according to any one of claims 1 to 9. 前記アプリケーションプログラムは、プログラムの終了時に、前記割当手段で割り当てられた領域の全てを返却するためのメモリ解放要求を出力することを特徴とする請求項1乃至10のいずれか1項に記載の情報処理装置。   11. The information according to claim 1, wherein the application program outputs a memory release request for returning all the areas allocated by the allocation unit when the program ends. Processing equipment. 画像を読み取って画像データを取得する画像読取手段を有し、
前記アプリケーションプログラムは、前記画像読取手段により取得される画像データを前記物理メモリに格納して処理することを特徴とする請求項1乃至11のいずれか1項に記載の情報処理装置。
Having image reading means for reading image and acquiring image data;
The information processing apparatus according to claim 1, wherein the application program stores and processes image data acquired by the image reading unit in the physical memory.
前記アプリケーションプログラムは、前記画像読取手段により取得される画像データを記憶するために前記メモリ確保要求を行い、前記画像データを記憶するために割り当てられたメモリ領域を返却するために前記メモリ解放要求を行うことを特徴とする請求項12に記載の情報処理装置。   The application program makes the memory allocation request to store the image data acquired by the image reading means, and issues the memory release request to return the memory area allocated to store the image data. The information processing apparatus according to claim 12, wherein the information processing apparatus is performed. 前記アプリケーションプログラムは、前記画像読取手段で画像の読み取りを行う際に前記メモリ確保要求を行い、前記画像データの処理を完了した際に前記メモリ解放要求を行うことを特徴とする請求項12又は13に記載の情報処理装置。   14. The application program makes the memory allocation request when the image reading unit reads an image, and makes the memory release request when the processing of the image data is completed. The information processing apparatus described in 1. 前記所定容量は、オペレーティングシステムに一度に要求可能な最大メモリ容量から、該所定容量のメモリ以外に当該情報処理装置が使用する容量を差し引いたメモリ容量であることを特徴とする請求項1乃至14のいずれか1項に記載の情報処理装置。   15. The predetermined capacity is a memory capacity obtained by subtracting a capacity used by the information processing apparatus in addition to the predetermined capacity from a maximum memory capacity that can be requested to the operating system at a time. The information processing apparatus according to any one of the above. 前記所定容量は、前記画像読取手段が一度の読み取り処理で読み取る画像データのサイズに、前記アプリケーションプログラムにおいて処理単位となる画像データのサイズを加算したメモリ容量を含むことを特徴とする請求項12乃至14のいずれか1項に記載の情報処理装置。   13. The predetermined capacity includes a memory capacity obtained by adding a size of image data as a processing unit in the application program to a size of image data read by the image reading unit in one reading process. The information processing apparatus according to any one of 14. 前記情報処理装置は、携帯端末であることを特徴とする請求項1乃至16のいずれか1項に記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the information processing apparatus is a mobile terminal. 前記情報処理装置は、通信手段と表示手段とを有し、
前記アプリケーションプログラムは、前記通信手段により受信した構造化言語を用いて表現されたデータを前記物理メモリを用いて前記表示手段に表示処理することを特徴とする請求項17に記載の情報処理装置。
The information processing apparatus includes a communication unit and a display unit,
The information processing apparatus according to claim 17, wherein the application program displays the data expressed using the structured language received by the communication unit on the display unit using the physical memory.
メモリ確保要求を受けた際に物理メモリ領域の確保を行い、メモリ解放要求を受けた際に前記確保した物理メモリ領域の解放を行うオペレーティングシステムで動作する画像読取装置であって、
画像を読み取って画像データを出力する画像読取手段と、
前記画像読取手段から出力される画像データを前記物理メモリに格納して処理するアプリケーションと、
前記アプリケーションからの最初のメモリ確保要求に応じて、前記オペレーティングシステムに対して所定容量のメモリ確保要求を行って、前記所定容量のメモリ領域を確保する確保手段と、
前記アプリケーションからのメモリ確保要求に応じて、前記確保手段で確保したメモリ領域内の前記アプリケーションへ割り当てていない状態の領域を、前記アプリケーションに対して割り当てる割当手段と、
を有することを特徴とする画像読取装置。
An image reading apparatus that operates in an operating system that secures a physical memory area when receiving a memory securing request and releases the secured physical memory area when receiving a memory release request,
Image reading means for reading an image and outputting image data;
An application for storing and processing image data output from the image reading means in the physical memory;
In accordance with an initial memory securing request from the application, a securing unit that performs a memory securing request with a predetermined capacity to the operating system and secures the memory area with the predetermined capacity;
In response to a memory securing request from the application, an allocating unit that allocates, to the application, an area that has not been allocated to the application in the memory area secured by the securing unit;
An image reading apparatus comprising:
前記アプリケーションからのメモリ解放要求に応じて、前記アプリケーションから解放要求された領域に対する、前記アプリケーションへの割り当てを解除する割当解除処理を行う割当解除手段を有することを特徴とする請求項19に記載の画像読取装置。   20. The device according to claim 19, further comprising: deallocation means for performing deallocation processing for deallocating an area requested to be released from the application in response to a memory release request from the application. Image reading device. 通信手段と表示手段とを有し、メモリ確保要求を受けた際に物理メモリ領域の確保を行い、メモリ解放要求を受けた際に前記確保した物理メモリ領域の解放を行うオペレーティングシステムで動作し、前記通信手段により受信した構造化言語を用いて表現されたデータを前記物理メモリを用いて前記表示手段に表示処理するアプリケーションを実行可能な携帯端末であって、
前記アプリケーションからの最初のメモリ確保要求に応じて、前記オペレーティングシステムに対して所定容量のメモリ確保要求を行って、前記所定容量のメモリ領域を確保する確保手段と、
前記アプリケーションからのメモリ確保要求に応じて、前記確保手段で確保したメモリ領域内の前記アプリケーションへ割り当てていない状態の領域を、前記アプリケーションに対して割り当てる割当手段と、
を有することを特徴とする携帯端末。
Having a communication means and a display means, securing a physical memory area when receiving a memory securing request, and operating in an operating system for releasing the secured physical memory area when receiving a memory releasing request; A portable terminal capable of executing an application for displaying data expressed using a structured language received by the communication unit on the display unit using the physical memory,
In accordance with an initial memory securing request from the application, a securing unit that performs a memory securing request with a predetermined capacity to the operating system and secures the memory area with the predetermined capacity;
In response to a memory securing request from the application, an allocating unit that allocates, to the application, an area that has not been allocated to the application in the memory area secured by the securing unit;
A portable terminal characterized by comprising:
前記アプリケーションからのメモリ解放要求に応じて、前記アプリケーションから解放要求された領域に対する、前記アプリケーションへの割り当てを解除する割当解除処理を行う割当解除手段を有することを特徴とする請求項21に記載の携帯端末。   24. The method according to claim 21, further comprising: deallocation means for performing deallocation processing for deallocating an area requested to be released from the application in response to a memory release request from the application. Mobile device. メモリ確保要求を受けた際に物理メモリ領域の確保を行い、メモリ解放要求を受けた際に前記確保した物理メモリ領域の解放を行うオペレーティングシステムで動作する情報処理装置のメモリ制御方法であって、
前記情報処理装置に設けられたプロセッサが、アプリケーションからの最初のメモリ確保要求に応じて、前記オペレーティングシステムに対して所定容量のメモリ確保要求を行って、前記所定容量のメモリ領域を確保する確保ステップと、
前記プロセッサが、前記アプリケーションからのメモリ確保要求に応じて、前記確保ステップで確保したメモリ領域内の前記アプリケーションへ割り当てていない状態の領域を、前記アプリケーションに対して割り当てる割当ステップと、
を有することを特徴とする情報処理装置のメモリ制御方法。
A memory control method of an information processing apparatus operating in an operating system that secures a physical memory area when receiving a memory securing request and releases the secured physical memory area when receiving a memory release request,
A securing step in which a processor provided in the information processing apparatus makes a memory securing request with a predetermined capacity to the operating system in response to an initial memory securing request from an application, and secures the memory area with the predetermined capacity. When,
An allocation step in which the processor allocates, to the application, an area that is not allocated to the application in the memory area secured in the securing step in response to a memory securing request from the application;
A memory control method for an information processing apparatus.
前記プロセッサが、前記アプリケーションからのメモリ解放要求に応じて、前記アプリケーションから解放要求された領域に対する、前記アプリケーションへの割り当てを解除する割当解除処理を行う割当解除ステップを有することを特徴とする請求項23に記載の情報処理装置のメモリ制御方法。   The processor includes a deallocation step for performing deallocation processing for deallocating an area requested to be released from the application to the application in response to a memory release request from the application. 24. A memory control method for the information processing apparatus according to 23. メモリ確保要求を受けた際に物理メモリ領域の確保を行い、メモリ解放要求を受けた際に前記確保した物理メモリ領域の解放を行うオペレーティングシステムで動作するコンピュータを、請求項1乃至18に記載された情報処理装置の手段として機能させるためのプログラム。   19. A computer operating in an operating system that secures a physical memory area when receiving a memory securing request and releases the secured physical memory area when receiving a memory release request. A program for causing an information processing apparatus to function.
JP2010038154A 2010-02-24 2010-02-24 Information processor, image reading device, portable terminal, memory control method for information processor, and program Pending JP2011175395A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010038154A JP2011175395A (en) 2010-02-24 2010-02-24 Information processor, image reading device, portable terminal, memory control method for information processor, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010038154A JP2011175395A (en) 2010-02-24 2010-02-24 Information processor, image reading device, portable terminal, memory control method for information processor, and program

Publications (1)

Publication Number Publication Date
JP2011175395A true JP2011175395A (en) 2011-09-08

Family

ID=44688202

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010038154A Pending JP2011175395A (en) 2010-02-24 2010-02-24 Information processor, image reading device, portable terminal, memory control method for information processor, and program

Country Status (1)

Country Link
JP (1) JP2011175395A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681940A (en) * 2012-05-15 2012-09-19 兰雨晴 Method for carrying out performance test on memory management subsystem of Linux operation system
JP2015203990A (en) * 2014-04-14 2015-11-16 京セラドキュメントソリューションズ株式会社 Electronic device and memory management method
WO2015182122A1 (en) * 2014-05-28 2015-12-03 日本電気株式会社 Information-processing device, information-processing system, memory management method, and program-recording medium
JP2016178611A (en) * 2015-03-23 2016-10-06 富士ゼロックス株式会社 Image data transmitter, program for image data transmission, and system for image data communication
JP2018049511A (en) * 2016-09-23 2018-03-29 富士ゼロックス株式会社 Information processing device and program
WO2021087662A1 (en) * 2019-11-04 2021-05-14 深圳市欢太科技有限公司 Memory allocation method and apparatus, terminal, and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0644129A (en) * 1992-07-24 1994-02-18 Fuji Xerox Co Ltd Information processor
JP2006338503A (en) * 2005-06-03 2006-12-14 Fuji Xerox Co Ltd Image processing device, method, and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0644129A (en) * 1992-07-24 1994-02-18 Fuji Xerox Co Ltd Information processor
JP2006338503A (en) * 2005-06-03 2006-12-14 Fuji Xerox Co Ltd Image processing device, method, and program

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681940A (en) * 2012-05-15 2012-09-19 兰雨晴 Method for carrying out performance test on memory management subsystem of Linux operation system
JP2015203990A (en) * 2014-04-14 2015-11-16 京セラドキュメントソリューションズ株式会社 Electronic device and memory management method
WO2015182122A1 (en) * 2014-05-28 2015-12-03 日本電気株式会社 Information-processing device, information-processing system, memory management method, and program-recording medium
JPWO2015182122A1 (en) * 2014-05-28 2017-04-20 日本電気株式会社 Information processing apparatus, information processing system, memory management method, and memory management program
US9940053B2 (en) 2014-05-28 2018-04-10 Nec Corporation Information processing device, information processing system, memory management method, and program recording medium
JP2016178611A (en) * 2015-03-23 2016-10-06 富士ゼロックス株式会社 Image data transmitter, program for image data transmission, and system for image data communication
JP2018049511A (en) * 2016-09-23 2018-03-29 富士ゼロックス株式会社 Information processing device and program
WO2021087662A1 (en) * 2019-11-04 2021-05-14 深圳市欢太科技有限公司 Memory allocation method and apparatus, terminal, and computer readable storage medium

Similar Documents

Publication Publication Date Title
CA3104353C (en) Storage volume creation method and apparatus, server, and storage medium
WO2018059079A1 (en) Memory management method and apparatus
JP2011175395A (en) Information processor, image reading device, portable terminal, memory control method for information processor, and program
US9507584B2 (en) Electronic device including a memory technology device
JP5475307B2 (en) Memory management method, computer readable medium and apparatus for rasterization
US20100251255A1 (en) Server device, computer system, recording medium and virtual computer moving method
CN101847105A (en) Computer and internal memory sharing method of a plurality of operation systems
JP2014235501A (en) Control method of storage device, storage device and information processing device
CN109062826B (en) Data transmission method and system
WO2019233326A1 (en) Printing control method, device and system
JP2008009696A (en) Image processor and program
CN103218305A (en) Distribution method of memory space
JP5832556B2 (en) Image processing apparatus and image forming apparatus
US8225068B2 (en) Virtual real memory exportation for logical partitions
US9691010B2 (en) Information processing apparatus, distributed printing system, and method of controlling printing
US9183473B2 (en) Image forming apparatus having function of avoiding overflow of buffer and image forming method
JP2007323393A (en) Image processor and program
JP7158656B2 (en) Image forming apparatus, image forming method and image forming program
JP2011039790A (en) Virtual machine image transfer device, method and program
JP6763236B2 (en) Print control device, print control method, and program
JP5414305B2 (en) Information processing apparatus, virtual storage management method, and program
JP6398963B2 (en) Image forming apparatus and program executed by image forming apparatus
US20230168822A1 (en) Memory management method and semiconductor device adjusting size of contiguous memory allocation area
KR102543344B1 (en) Image processing apparatus, method for controlling the same, and computer-readable storage medium
JP2013178634A (en) Electronic device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130213

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131028

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131126

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140127

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20140624