JPH08314791A - Memory assignment processing method for application - Google Patents

Memory assignment processing method for application

Info

Publication number
JPH08314791A
JPH08314791A JP11463295A JP11463295A JPH08314791A JP H08314791 A JPH08314791 A JP H08314791A JP 11463295 A JP11463295 A JP 11463295A JP 11463295 A JP11463295 A JP 11463295A JP H08314791 A JPH08314791 A JP H08314791A
Authority
JP
Japan
Prior art keywords
memory
application
window
memory area
acquired
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
JP11463295A
Other languages
Japanese (ja)
Inventor
Katsumi Okuda
勝己 奥田
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.)
PFU Ltd
Original Assignee
PFU Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by PFU Ltd filed Critical PFU Ltd
Priority to JP11463295A priority Critical patent/JPH08314791A/en
Publication of JPH08314791A publication Critical patent/JPH08314791A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE: To provide a means which efficiently and quickly performs allocation processing of a memory area like a buffer used for window processing or input/ output processing of an application. CONSTITUTION: An application 11 corresponding to a multi-window system acquires and holds a memory 13 including a memory area 17a corresponding to one window from a system 12 at the time of the start of the application and allocates the held unused memory area at the time of an open request of the first window and additionally acquires and allocates a required memory area from the system 12 at the time of an open request of the second or following window and returns the memory area allocated to the window to be closed to the system 12 to release it at the time of a close request or the window other than the last window and holds the memory area allocated to the window to be closed as an unused memory area at the time of a close request of the last window.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、アプリケーションにお
いて、ウインドウの表示バッファや入出力バッファなど
の複数のメモリ領域についての割当処理方法に関するも
のであり、特にプログラムからの要求によりメモリ領域
の獲得と解放が繰り返される場合に、要求に対してメモ
リ領域を迅速、効率的に割り当てることを可能にするも
のである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an allocation processing method for a plurality of memory areas such as a window display buffer and an input / output buffer in an application, and in particular, acquisition and release of the memory area according to a request from a program. It is possible to quickly and efficiently allocate a memory area to a request when the above is repeated.

【0002】[0002]

【従来の技術】従来、複数のアプリケーションが動作で
きるWindows 等のOSでマルチウインドウ対応による複
数のウインドウ表示が可能なアプリケーションを動作さ
せていたとき、表示中のウインドウで獲得していたメモ
リ領域をウインドウのクローズなどのために解放した後
別のアプリケーションがそのメモリ領域を獲得し、他に
は空きのメモリ領域がなくなっている状態にあると、元
のアプリケーションに戻り再びウインドウをオープンし
ようとしてもメモリ不足で実行できない場合があった。
図10はこれを図示したものである。
2. Description of the Related Art Conventionally, when an application capable of displaying a plurality of windows with multi-window support is being operated by an OS such as Windows capable of operating a plurality of applications, the memory area acquired by the window being displayed is displayed as a window. If another application acquires that memory area after releasing it for closing, etc., and there is no other free memory area, the memory will be insufficient even if you return to the original application and open the window again. There was a case that could not be executed.
FIG. 10 illustrates this.

【0003】図10において、は、アプリ(アプリケ
ーションの略、以下同じ)1がウインドウ1をオープン
しており、ウインドウ1がメモリ1を獲得して使用して
いる状態を示す。は、次にアプリ1がウインドウ1を
クローズし、ウインドウ1用のメモリ1を解放した状態
を示す。は、次にアプリ2が起動されて、解放されて
いるウインドウ1用のメモリ1を獲得した状態を示す。
は、その後アプリ1でウインドウ1をオープンするた
めメモリの獲得要求を出すがメモリ不足となってウイン
ドウ1をオープンできない。このためアプリ2の処理を
終わらせてからアプリ1で再度ウインドウ1をオープン
する必要があり、アプリケーション処理が停滞するとい
う不都合が生じた。
In FIG. 10, an application (abbreviation of application, the same applies hereinafter) 1 has a window 1 open, and the window 1 has acquired a memory 1 for use. Indicates that application 1 then closes window 1 and releases memory 1 for window 1. Shows a state in which the application 2 is activated next time and the memory 1 for the released window 1 is acquired.
After that, the application 1 opens the window 1 to issue a memory acquisition request, but the memory is insufficient and the window 1 cannot be opened. For this reason, it is necessary to open the window 1 again with the application 1 after the processing of the application 2 is finished, which causes a problem that the application processing is stagnant.

【0004】またアプリケーションはウインドウをオー
プンする際あるいはウインドウでの処理中に必要となる
メモリの獲得をシステムに依頼し、システムからメモリ
の割り当てを受けているが、ウインドウが必要とするメ
モリのサイズは数バイトから数十Kバイトまで幅があ
り、数バイトや数百バイトのような小さいサイズのメモ
リまでいちいちシステムに獲得依頼したのでは時間がか
かるとともにシステムの負担が大きくなり、効率が悪く
なって処理速度が低下するという問題があった。この問
題を改善するには、各ウインドウがあらかじめ使用する
可能性のある大きめのサイズのメモリをシステムから獲
得しておき、各ウインドウがそのメモリを管理して必要
なだけ使用するという方法が考えられる。しかしこの方
法では各ウインドウでのメモリ管理負担が増加し、処理
が複雑となって異常動作を起こす可能性があり、またメ
モリに無駄が出て利用効率が低下する可能性もあった。
Further, the application requests the system to acquire the memory required for opening the window or during processing in the window, and receives the memory allocation from the system, but the size of the memory required by the window is It has a width of several bytes to several tens of kilobytes, and requesting each system to acquire a small-sized memory such as several bytes or hundreds of bytes will take time and increase the system load, resulting in poor efficiency. There is a problem that the processing speed is reduced. One way to improve this problem is to acquire a large amount of memory from the system that each window may use in advance, and manage each window to use that memory as needed. . However, with this method, the memory management load on each window increases, processing may become complicated, and abnormal operation may occur, and memory may be wasted and use efficiency may decrease.

【0005】同様な問題は、アプリケーションの入出力
処理や通信処理で使用するバッファの獲得時においても
生じている。
Similar problems also occur when acquiring buffers used in input / output processing and communication processing of applications.

【0006】[0006]

【発明が解決しようとする課題】本発明は、アプリケー
ションのウインドウ処理や入出力処理で使用されるバッ
ファのようなメモリ領域の割当処理を効率的かつ迅速に
行う手段を提供することを目的としている。
SUMMARY OF THE INVENTION It is an object of the present invention to provide means for efficiently and quickly allocating a memory area such as a buffer used in window processing and input / output processing of an application. .

【0007】[0007]

【課題を解決するための手段】本発明のメモリ割当処理
方法は、アプリケーションがシステムに対して行うメモ
リ獲得要求の回数を減らすとともにアプリケーションか
らのメモリ獲得要求に対して迅速なメモリ割り当てを可
能にするため、 (1) アプリケーション起動時にバッファ1枚分のメモリ
領域を含むメモリをシステムから獲得して保有し、バッ
ファの獲得要求があったとき、そのバッファが1枚目の
ものであった場合にはアプリケーションが保有する未使
用のメモリ領域を割り当て、他方そのバッファが2枚目
以降のものであった場合には必要なメモリ領域をシステ
ムから追加獲得して割り当て、バッファの解放要求があ
ったとき、そのバッファが最後の1枚目でない場合には
そのバッファに割り当てられていたメモリ領域をシステ
ムに返却して解放し、他方そのバッファが最後の1枚目
であった場合にはそのバッファに割り当てられていたメ
モリ領域を未使用としてアプリケーションが保有する、
ことを特徴とする。 (2) (1) において、バッファの獲得要求時のメモリ領域
の割り当ておよびバッファの解放要求時のメモリ領域の
解放と保有の各処理は、アプリケーション内に設けられ
たメモリ管理ルーチンで実行することを特徴とする。 (3) アプリケーション起動時にあらかじめ定められた複
数ブロック分のメモリ領域をシステムから獲得し、獲得
したメモリ領域はブロック単位に使用状態と未使用状態
とを管理し、バッファの獲得要求があったとき、上記シ
ステムから獲得したメモリ領域の未使用状態にあるブロ
ックを必要数割り当て、未使用状態のブロックがないか
不足している場合にはシステムから必要なメモリ領域の
ブロックを追加獲得して割り当て、バッファの解放要求
があったとき、そのバッファのブロックが上記アプリケ
ーションの起動時にシステムから獲得したものであった
場合にはシステムに返却せずにアプリケーションで未使
用状態のブロックとして保有し、他方上記解放要求され
たバッファのブロックがシステムから追加獲得したもの
であった場合にはシステムに返却して解放すること、を
特徴とする。 (4) (3) において、バッファの獲得要求および解放要求
に対応する処理は、アプリケーション内に設けられたメ
モリ管理ルーチンで実行し、アプリケーション起動時に
システムから獲得したメモリ領域のブロックの使用状態
および未使用状態の管理はフラグを用いて行うことを特
徴とする。
According to the memory allocation processing method of the present invention, the number of memory acquisition requests made by an application to the system is reduced, and quick memory allocation can be performed in response to a memory acquisition request from an application. Therefore, (1) When the application is started, the memory including the memory area for one buffer is acquired from the system and held, and when a buffer acquisition request is made and the buffer is the first one, When an unused memory area held by the application is allocated, and when the buffer is the second or later one, the necessary memory area is additionally acquired from the system and allocated, and when there is a buffer release request, If that buffer is not the last one, the system allocates the memory area allocated to that buffer. Return to releasing the application held by the unused memory area allocated to the buffer when the other the buffer was the last first sheet,
It is characterized by the following. (2) In (1), each process of allocating a memory area when requesting to acquire a buffer and releasing and holding the memory area when requesting to release a buffer is executed by the memory management routine provided in the application. Characterize. (3) A memory area for a plurality of predetermined blocks is acquired from the system when the application is started. The acquired memory area manages the used state and the unused state in block units, and when a buffer acquisition request is made, Allocate the required number of unused blocks in the memory area obtained from the above system, and if there are no unused blocks, allocate additional blocks of the required memory area from the system and allocate the buffers. When the block request of the buffer is acquired from the system when the application is started, the buffer block is not returned to the system and is retained as an unused block in the application. If the block of the created buffer is an additional one acquired from the system, The feature is that it is returned to the stem and released. (4) In (3), the processing corresponding to the buffer acquisition request and the buffer release request is executed by the memory management routine provided in the application, and the usage status of the memory area block acquired from the system when the application is started and the status The use state is managed by using a flag.

【0008】[0008]

【作用】本発明では、マルチウインドウ対応のアプリケ
ーションの場合、アプリケーションで動作するのに最低
限必要なメモリをアプリケーションの起動時に獲得して
おき、ウインドウをクローズしても最低限必要なメモリ
は解放しないようにする。
According to the present invention, in the case of a multi-window compatible application, the minimum required memory for operating the application is acquired at the time of starting the application, and the minimum required memory is not released even when the window is closed. To do so.

【0009】但し、マルチウインドウ対応であるため、
2つ以上のウインドウをオープンして、クローズした時
にメモリを解放しないようにすると、オープン/クロー
ズを繰り返すほどメモリを取ってしまうため、2つ以上
のウインドウをオープン/クローズする場合は、メモリ
の獲得、解放を行い、アプリケーションの起動後は、最
低1つのウインドウは他のアプリケーションが起動して
もオープンできるようにする。
However, since it is compatible with multiple windows,
If you open two or more windows and do not release the memory when you close the windows, the memory will be taken enough to repeat the open / close. Therefore, if you open / close two or more windows, acquire the memory. After releasing the application, at least one window can be opened even if another application is activated.

【0010】また、第1のウインドウをオープンした時
に起動時に獲得済のメモリを使用し、第2のウインドウ
をオープンした時に新規にメモリ獲得を行った後、第1
のウインドウをクローズした時は第1のウインドウで使
用していたメモリを解放する。その後、第2のウインド
ウをクローズした時には、メモリを解放せず次にオープ
ンされるウインドウが使用するようにする。
Further, when the first window is opened, the memory already acquired at the time of starting is used, and when the second window is opened, a new memory is acquired, and then the first window is acquired.
When the window is closed, the memory used in the first window is released. After that, when the second window is closed, the memory is not released and the window opened next is used.

【0011】結局、複数のウインドウをオープンしてい
た時は、最後のウインドウが使用していたメモリのみ解
放せず残しておき、次にオープンされるウインドウが使
用できるようにする。
After all, when a plurality of windows are open, only the memory used by the last window is left unreleased so that the window opened next can be used.

【0012】また本発明では、数バイトのメモリを必要
が有るたびにシステムに対して要求していると処理速度
が悪くなるため、使用するであろうメモリをあらかじめ
獲得しておく方法を用いて、各ウインドウが処理を行う
のでなく、メモリの獲得、解放を擬似的に行う処理を追
加して、各ウインドウの処理を簡易化するとともに、処
理速度が速くなるようにしている。
Further, according to the present invention, the processing speed is deteriorated when the system is requested to have a memory of several bytes every time it is needed. Therefore, a method of previously acquiring the memory to be used is used. The process of pseudo acquisition and release of memory is added to each window instead of performing the process to simplify the process of each window and increase the processing speed.

【0013】[0013]

【実施例】図1は、請求項1、2、5、6に対応する本
発明の実施例の処理概要図であり、11はマルチウイン
ドウ対応のアプリケーション、12はマルチウインドウ
制御機能をもつシステム(OS)、13は主メモリ(M
S)、14はディスプレイ画面、15はアプリケーショ
ン11においてシステム12のサポートのもとでマルチ
ウインドウの画面出力を行う処理ルーチン、16はウイ
ンドウに対するメモリ領域の割当処理を行うメモリ管理
ルーチン、16aはメモリ領域割当管理テーブル、17
はアプリケーション11が起動時に獲得するメモリ領
域、17aはメモリ領域17に含まれる1枚分のウイン
ドウ用メモリ領域、17bは他のウインドウ用にシステ
ムから追加獲得されるウインドウ用メモリ領域を示す。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 is a processing outline diagram of an embodiment of the present invention corresponding to claims 1, 2, 5, and 6, 11 is an application compatible with multi-window, and 12 is a system having a multi-window control function ( OS), 13 is the main memory (M
S), 14 is a display screen, 15 is a processing routine for performing multi-window screen output in the application 11 under the support of the system 12, 16 is a memory management routine for allocating memory areas to windows, and 16a is a memory area. Allocation management table, 17
Is a memory area acquired by the application 11 at startup, 17a is a window memory area included in the memory area 17, and 17b is a window memory area additionally acquired from the system for another window.

【0014】図2は、図1の実施例の処理フローであ
る。以下、図1および図2を参照して動作を説明する。
まず図2の(a)のウインドウオープン時のフローにつ
いて説明すると、アプリケーション11は、起動時に必
要な動作環境の1つとして、システム12からメモリ領
域17を獲得する。メモリ領域17には1枚分のウイン
ドウをオープンするのに十分なメモリ領域17aを含
む。
FIG. 2 is a processing flow of the embodiment shown in FIG. The operation will be described below with reference to FIGS. 1 and 2.
First, the flow when the window shown in FIG. 2A is opened will be described. The application 11 acquires the memory area 17 from the system 12 as one of the operating environments required at the time of activation. The memory area 17 includes a memory area 17a sufficient to open one window.

【0015】アプリケーション11の処理ルーチン15
の動作時にウインドウのオープン要求が発生すると、オ
ープンに必要なメモリ領域の獲得依頼が出される。メモ
リ管理ルーチン16は、これに応答してメモリ割当処理
を行う。
The processing routine 15 of the application 11
When a window open request is generated during the operation of, a request for acquisition of the memory area required for opening is issued. In response to this, the memory management routine 16 performs memory allocation processing.

【0016】ここでオープン要求されたウインドウが1
枚目のものであれば、アプリケーション起動時に獲得済
みのメモリ領域17中でウインドウ用に確保してあるメ
モリ領域17aを割り当てる。これにより、たとえばデ
ィスプレイ画面14にウインドウ1がオープンされる。
他方、オープン要求されたウインドウが2枚目以降のも
のであった場合には、システム12にメモリ獲得要求を
出し、メモリ領域17bを追加獲得してウインドウに割
り当てる。これによりたとえばディスプレイ画面14に
ウインドウ2がオープンされる。
The window requested to be opened here is 1
If it is the first one, the memory area 17a reserved for the window is allocated in the memory area 17 already acquired when the application is started. Thereby, for example, the window 1 is opened on the display screen 14.
On the other hand, when the window requested to be opened is the second or later window, a memory acquisition request is issued to the system 12, and the memory area 17b is additionally acquired and allocated to the window. Thereby, for example, the window 2 is opened on the display screen 14.

【0017】次に、図2の(b)のウインドウクローズ
時のフローについて説明する。処理ルーチン15が、処
理によりウインドウのクローズ要求を出すと、メモリ管
理ルーチン16はそのウインドウが画面に表示された最
後の1枚でない限りそのメモリ領域に対応するメモリ領
域を解放(システムへ返却)する処理を行う。しかしク
ローズされるウインドウが画面に残る最後の1枚であっ
た場合には、それに対応するメモリ領域の解放を行わ
ず、そのまま未使用状態としてメモリ管理ルーチン16
が管理し、保有する。メモリ管理ルーチン16は、これ
らのメモリ割当処理のために、メモリ領域割当管理テー
ブル16aをもち、獲得した各メモリ領域を割当先ウイ
ンドウあるいは未使用状態とを対応づけて管理する。解
放されたメモリ領域はテーブルから削除される。図3な
いし図5に、メモリ割当処理の具体例を示す。
Next, the flow when the window shown in FIG. 2B is closed will be described. When the processing routine 15 issues a window close request by the processing, the memory management routine 16 releases (returns to the system) the memory area corresponding to the memory area unless the window is the last one displayed on the screen. Perform processing. However, if the window to be closed is the last one remaining on the screen, the memory area corresponding to it is not released, and the memory management routine 16 is left as it is.
Managed and owned. The memory management routine 16 has a memory area allocation management table 16a for these memory allocation processes, and manages each acquired memory area in association with an allocation destination window or an unused state. The released memory area is deleted from the table. 3 to 5 show specific examples of the memory allocation process.

【0018】図3は、オープンされるウインドウが1枚
の場合のメモリ割当処理の例である。では、アプリ1
の起動時にウインドウ1用のメモリ(メモリ領域)を獲
得する。では、ウインドウ1がオープンされる。この
とき獲得済みのウインドウ1用のメモリが使用される。
ではウインドウ1がクローズされるが、ウインドウ1
用のメモリはウインドウ1が画面上での最後の1枚であ
ったために解放されない。したがって、この後別のアプ
リ2(図示せず)が起動されたとしても、アプリ2がこ
のメモリを獲得することはない。ウインドウ1用のメモ
リが解放されるのは、アプリ1の終了時においてであ
る。
FIG. 3 shows an example of a memory allocation process when one window is opened. Then, app 1
The memory (memory area) for window 1 is acquired when is started. Then, window 1 is opened. At this time, the acquired memory for window 1 is used.
Then window 1 is closed, but window 1
The memory for is not released because window 1 was the last one on the screen. Therefore, even if another application 2 (not shown) is activated thereafter, the application 2 will not acquire this memory. The memory for the window 1 is released when the application 1 ends.

【0019】図4および図5は、複数枚のウインドウが
オープンされる場合のメモリ割当処理の例を示す。図4
のでは、最初のウインドウ1がオープンされ、このと
きアプリ1の起動時に獲得されているウインドウ1用の
メモリが使用される。図4のでは、アプリ1が2枚目
のウインドウ2をオープンする。このときはシステムか
らウインドウ2用のメモリを獲得して使用する。
4 and 5 show an example of the memory allocation process when a plurality of windows are opened. FIG.
In this case, the first window 1 is opened, and the memory for the window 1 acquired at the start of the application 1 at this time is used. In FIG. 4, the application 1 opens the second window 2. At this time, the memory for window 2 is acquired from the system and used.

【0020】図5のでは、図4のに続いてウインド
ウ1のクローズが行われる。これによりウインドウ1用
のメモリは解放される(システムへ返却)。図5ので
は、さらにウインドウ2のクローズが行われる。このた
めウインドウ2用のメモリは不要となるが、ウインドウ
2が画面上での最後の1枚であったために解放されず、
アプリ1で保有される。図5のでは、アプリ1が再度
ウインドウ1をオープンする。この場合、アプリ1が保
有中の以前にウインドウ2が使用していたウインドウ2
用のメモリをウインドウ1に割り当てる。なおでウイ
ンドウ1の代わりに他のウインドウがオープンされて
も、そのウインドウに対してウインドウ2用のメモリが
使用される。これらの処理は何度でも繰り返されること
ができる。
In FIG. 5, the window 1 is closed following that of FIG. As a result, the memory for window 1 is released (returned to the system). In FIG. 5, the window 2 is further closed. For this reason, the memory for window 2 is unnecessary, but it is not released because window 2 is the last one on the screen,
Owned by App 1. In FIG. 5, the application 1 opens the window 1 again. In this case, the window 2 that was previously used by the window 2 owned by the application 1
Memory for window 1 is allocated. Even if another window is opened instead of the window 1, the memory for the window 2 is used for that window. These processes can be repeated any number of times.

【0021】図6は、請求項3、4、7、8に対応する
実施例の処理概要図である。なお図1と共通の要素には
同じ参照番号が用いられている。図6では、アプリケー
ション11の起動時にあらかじめウインドウ複数枚分の
ブロックからなるメモリ領域17cを獲得し、それぞれ
のブロックの使用/未使用状態をフラグ16bで管理す
る。
FIG. 6 is a process outline diagram of an embodiment corresponding to claims 3, 4, 7, and 8. Note that the same reference numerals are used for the elements common to FIG. In FIG. 6, when the application 11 is started, a memory area 17c including blocks for a plurality of windows is acquired in advance, and the used / unused state of each block is managed by a flag 16b.

【0022】図7は、図6の実施例におけるメモリ管理
ルーチン16の処理フローを示す。以下、図7のフロー
にしたがって図6の実施例の動作を説明する。図7の
(a)はメモリ獲得時のフローであり、アプリケーショ
ン11のマルチウインドウ対応の処理ルーチン15から
のウインドウオープンにともなうメモリ獲得依頼がある
と、フラグ16bを参照し、未使用状態にあるメモリ領
域17cのブロックを見付けて割り当てる。未使用のブ
ロックがない場合にはシステム12からメモリ領域を追
加獲得して割り当てる。この追加獲得されたメモリ領域
はフラグ16bによる使用/未使用状態の管理はされな
い。
FIG. 7 shows a processing flow of the memory management routine 16 in the embodiment of FIG. The operation of the embodiment of FIG. 6 will be described below according to the flow of FIG. FIG. 7A is a flow at the time of memory acquisition. When a memory acquisition request is issued from the multi-window processing routine 15 of the application 11, a memory acquisition request is made by referring to the flag 16b. A block in the area 17c is found and assigned. If there is no unused block, an additional memory area is acquired from the system 12 and allocated. The additional / acquired memory area is not managed by the flag 16b for the used / unused state.

【0023】図7の(b)はメモリ解放処理のフローで
あり、処理ルーチン15からのウインドウクローズにと
もなうメモリ解放依頼があると、指定されたメモリ領域
がフラグ16bで管理されているかどうかをチェック
し、フラグ16bで管理されていれば対応するフラグを
未使用状態に設定し、システム12へは返却しない。し
かし指定されたメモリ領域がフラグ16bで管理されて
いない場合には、システム12へ返却し、解放する。
FIG. 7B is a flow of the memory release process. When a memory release request is issued from the processing routine 15 with the window close, it is checked whether the designated memory area is managed by the flag 16b. However, if managed by the flag 16b, the corresponding flag is set to an unused state and is not returned to the system 12. However, if the designated memory area is not managed by the flag 16b, it is returned to the system 12 and released.

【0024】図8は、図6の実施例におけるメモリ管理
ルーチン16の処理の具体例を示す。図8の(a)はメ
モリ獲得時の処理であり、でウインドウがメモリ管理
ルーチンへメモリの獲得依頼をすると、でメモリ管理
ルーチンはメモリの使用/未使用フラグを検索し、未使
用のメモリ領域(ブロック)を捜し出す。未使用のメ
モリ領域を見付けた場合はウインドウへその領域を通知
し、未使用のメモリ領域がない場合はシステムから獲
得し、でシステムから獲得したメモリ領域をウインド
ウへ通知する。
FIG. 8 shows a concrete example of the processing of the memory management routine 16 in the embodiment of FIG. FIG. 8A shows a process when a memory is acquired. When the window requests the memory management routine to acquire the memory, the memory management routine searches for the used / unused flag of the memory, and the unused memory area is searched. Find (block). When an unused memory area is found, the window is notified of the area. When there is no unused memory area, the area is acquired from the system, and the memory area acquired from the system is notified to the window.

【0025】図8の(b)はメモリ解放時の処理であ
り、でウインドウからメモリ解放依頼があると、メモ
リ管理ルーチンはで依頼されたメモリ領域(ブロッ
ク)が起動時に獲得したメモリ領域かどうかをフラグに
よりチェックする。依頼されたメモリ領域が起動時に
獲得されたメモリ領域であることを示している場合に
は、そのフラグ(使用状態を表示している)を未使用状
態に変更し、依頼されたメモリ領域が起動時に獲得さ
れたメモリ領域でない場合にはそのメモリ領域をシステ
ムへ返却し、解放する。
FIG. 8B shows the processing at the time of memory release. When there is a memory release request from the window, the memory management routine determines whether the memory area (block) requested by is the memory area acquired at the time of startup. Is checked by the flag. If it indicates that the requested memory area is the memory area that was acquired at startup, change the flag (displaying the usage status) to the unused status and the requested memory area is started. If it is not the acquired memory area, the memory area is returned to the system and released.

【0026】図9は、メモリ管理ルーチンのメモリ管理
機能ツリーを示す。大きくは(1)アプリケーション起
動時のメモリ獲得機能と、(2)ウインドウからの依頼
によるメモリ獲得機能と、(3)ウインドウからの依頼
によるメモリ解放機能と、(4)アプリケーション終了
時のメモリ解放機能とがあり、さらに(2)は(2−
1)システムから追加獲得して割り当てる機能と、(2
−2)起動時に獲得したメモリを割り当てる機能とに分
かれ、(3)は(3−1)追加獲得したメモリをシステ
ムへ返却して解放する機能と、(3−2)獲得済みのメ
モリとしてそのまま保有する機能とに分かれる。
FIG. 9 shows a memory management function tree of the memory management routine. Broadly speaking, (1) memory acquisition function at application startup, (2) memory acquisition function by request from window, (3) memory release function by request from window, and (4) memory release function at application termination And (2) is (2-
1) A function to additionally acquire and allocate from the system, and (2
-2) Divided into the function of allocating the memory acquired at startup, (3) is (3-1) the function of returning the additionally acquired memory to the system and releasing it, and (3-2) As the acquired memory as it is. It is divided into functions that it possesses.

【0027】以上述べた実施例はマルチウインドウ処理
にかかわるものであったが、本発明はI/Oバッファや
通信バッファのように処理要求に応じてバッファ数やバ
ッファサイズを増減する場合にも適用できることは自明
である。
Although the embodiment described above is concerned with the multi-window processing, the present invention is also applied to the case where the number of buffers or the buffer size is increased or decreased according to the processing request such as the I / O buffer or the communication buffer. What you can do is self-evident.

【0028】[0028]

【発明の効果】本発明により以下のような効果が得られ
る。 ・複数のプログラムが動作できるOS(Windows等)で起
動後のメモリ不足による動作不可能状態になることを防
ぐことができる。
According to the present invention, the following effects can be obtained. -It is possible to prevent the OS from becoming inoperable due to lack of memory after booting in an OS (such as Windows) that can run multiple programs.

【0029】(特に、Windows で動作するアプリケーシ
ョンでは、ウインドウが主に使われるため効果がある) ・ウインドウで使用するメモリだけでなく同じ種類のメ
モリを複数使用する時にも同じ論理でメモリ不足発生を
防ぎ、メモリを使い回すことができる。
(Especially for applications running on Windows, this is effective because windows are mainly used.) ・ When not only the memory used for windows but also a plurality of the same type of memory, the same logic causes a memory shortage. You can prevent and reuse memory.

【0030】・このアプリケーションを運用時(起動
後)は、メモリ不足により、システムが停止することが
なくなる。 ・OSには依存しない構造となっているため、移植性に
優れている。
When operating this application (after starting), the system will not stop due to lack of memory. -Excellent portability because the structure does not depend on the OS.

【0031】・各ウインドウの処理は、通常のメモリ獲
得/解放処理を行うだけで、わずらわしいメモリ管理を
行う必要がなくなり簡易化される。 ・少ないメモリ領域に対して常にシステムからメモリを
獲得しないため処理性能が速くなる。
The processing of each window is simplified by only performing normal memory acquisition / release processing, and eliminating the need for troublesome memory management. -Processing performance is faster because memory is not always acquired from the system for a small memory area.

【0032】・一種類のメモリだけでなく、同じ種類の
少ないメモリを複数使用する時にも同じ論理でメモリの
獲得/解放を簡易化することができる。
When not only one type of memory but a plurality of memories of the same type are used, it is possible to simplify the acquisition / release of memory with the same logic.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の第1の実施例の処理概要図である。FIG. 1 is a process schematic diagram of a first embodiment of the present invention.

【図2】第1の実施例の処理フローである。FIG. 2 is a processing flow of the first embodiment.

【図3】第1の実施例によるメモリ割当処理の具体例の
説明図(その1)である。
FIG. 3 is an explanatory diagram (part 1) of a specific example of the memory allocation processing according to the first embodiment.

【図4】第1の実施例によるメモリ割当処理の具体例の
説明図(その2)である。
FIG. 4 is an explanatory diagram (part 2) of the specific example of the memory allocation process according to the first embodiment.

【図5】第1の実施例によるメモリ割当処理の具体例の
説明図(その3)である。
FIG. 5 is an explanatory diagram (part 3) of the specific example of the memory allocation processing according to the first embodiment.

【図6】本発明の第2の実施例の処理概要図である。FIG. 6 is a process schematic diagram of the second embodiment of the present invention.

【図7】第2の実施例におけるメモリ管理ルーチンの処
理フローである。
FIG. 7 is a processing flow of a memory management routine in the second embodiment.

【図8】第2の実施例におけるメモリ管理ルーチンの処
理の具体例を示す説明図である。
FIG. 8 is an explanatory diagram showing a specific example of processing of a memory management routine in the second embodiment.

【図9】メモリ管理ルーチンのメモリ管理機能ツリー図
である。
FIG. 9 is a memory management function tree diagram of a memory management routine.

【図10】従来のアプリケーションのメモリ割当処理の
説明図である。
FIG. 10 is an explanatory diagram of a memory allocation process of a conventional application.

【符号の説明】[Explanation of symbols]

11:アプリケーション 12:システム(OS) 13:主メモリ(MS) 14:ディスプレイ画面 15:処理ルーチン 16:メモリ管理ルーチン 16a:メモリ領域割当管理テーブル 16b:フラグ 17,17a,17b,17c:メモリ領域 11: Application 12: System (OS) 13: Main memory (MS) 14: Display screen 15: Processing routine 16: Memory management routine 16a: Memory area allocation management table 16b: Flags 17, 17a, 17b, 17c: Memory area

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 アプリケーションにおけるメモリ割当処
理方法において、 アプリケーション起動時にバッファ1枚分のメモリ領域
を含むメモリをシステムから獲得して保有し、 バッファの獲得要求があったとき、そのバッファが1枚
目のものであった場合にはアプリケーションが保有する
未使用のメモリ領域を割り当て、他方そのバッファが2
枚目以降のものであった場合には必要なメモリ領域をシ
ステムから追加獲得して割り当て、 バッファの解放要求があったとき、そのバッファが最後
の1枚目でない場合にはそのバッファに割り当てられて
いたメモリ領域をシステムに返却して解放し、他方その
バッファが最後の1枚目であった場合にはそのバッファ
に割り当てられていたメモリ領域を未使用としてアプリ
ケーションが保有する、ことを特徴とするアプリケーシ
ョンにおけるメモリ割当処理方法。
1. In a memory allocation processing method for an application, a memory including a memory area for one buffer is acquired from the system at the time of starting the application, and is retained, and when a buffer acquisition request is made, the first buffer is acquired. If it is, the unused memory area held by the application is allocated, while the buffer has 2
If it is the first or subsequent one, the necessary memory area is additionally acquired from the system and allocated. When a buffer release request is made, if that buffer is not the last one, it is allocated to that buffer. The memory area used to be returned to the system is released, and on the other hand, if the buffer is the last one, the application holds the memory area allocated to the buffer as unused. Allocation processing method in the application to be used.
【請求項2】 請求項1において、バッファの獲得要求
時のメモリ領域の割り当ておよびバッファの解放要求時
のメモリ領域の解放と保有の各処理は、アプリケーショ
ン内に設けられたメモリ管理ルーチンで実行することを
特徴とするアプリケーションにおけるメモリ割当処理方
法。
2. The memory management routine according to claim 1, wherein each process of allocating a memory area when a buffer acquisition request is made and releasing and holding a memory area when a buffer release request is made is executed by a memory management routine provided in an application. A memory allocation processing method in an application characterized by the above.
【請求項3】 アプリケーションにおけるメモリ割当処
理方法において、 アプリケーション起動時にあらかじめ定められた複数ブ
ロック分のメモリ領域をシステムから獲得し、獲得した
メモリ領域はブロック単位に使用状態と未使用状態とを
管理し、 バッファの獲得要求があったとき、上記システムから獲
得したメモリ領域の未使用状態にあるブロックを必要数
割り当て、未使用状態のブロックがないか不足している
場合にはシステムから必要なメモリ領域のブロックを追
加獲得して割り当て、 バッファの解放要求があったとき、そのバッファのブロ
ックが上記アプリケーションの起動時にシステムから獲
得したものであった場合にはシステムに返却せずにアプ
リケーションで未使用状態のブロックとして保有し、他
方上記解放要求されたバッファのブロックがシステムか
ら追加獲得したものであった場合にはシステムに返却し
て解放すること、を特徴とするアプリケーションにおけ
るメモリ割当処理方法。
3. A memory allocation processing method for an application, wherein a memory area for a plurality of predetermined blocks is acquired from the system when the application is started, and the acquired memory area manages a used state and an unused state in block units. , When a buffer acquisition request is made, the required number of unused blocks in the memory area obtained from the system above are allocated. If there are no unused blocks or there are insufficient blocks, the memory area required by the system. Block is additionally acquired and allocated, and when there is a buffer release request, if the block of the buffer was acquired from the system when the above application was started, it is not returned to the system and is unused by the application. As a block of the A method for allocating memory in an application, wherein if the block of the buffer is additionally acquired from the system, it is returned to the system and released.
【請求項4】 請求項3において、バッファの獲得要求
および解放要求に対応する処理は、アプリケーション内
に設けられたメモリ管理ルーチンで実行し、アプリケー
ション起動時にシステムから獲得したメモリ領域のブロ
ックの使用状態および未使用状態の管理はフラグを用い
て行うことを特徴とするアプリケーションにおけるメモ
リ割当処理方法。
4. The use state of a block of a memory area acquired from the system at the time of starting an application, wherein a process corresponding to a buffer acquisition request and a buffer release request is executed by a memory management routine provided in the application. A method for processing memory allocation in an application, characterized in that management of unused states is performed using flags.
【請求項5】 マルチウインドウ対応のアプリケーショ
ンにおけるメモリ割当処理方法において、 アプリケーション起動時にウインドウ1枚分のメモリ領
域を含むメモリをシステムから獲得して保有し、 ウインドウのオープン要求があったとき、そのウインド
ウが1枚目のものであった場合にはアプリケーションが
保有する未使用のメモリ領域を割り当て、他方そのウイ
ンドウが2枚目以降のものであった場合には必要なメモ
リ領域をシステムから追加獲得して割り当て、 ウインドウのクローズ要求があったとき、そのウインド
ウが最後の1枚目でない場合にはそのウインドウに割り
当てられていたメモリ領域をシステムに返却して解放
し、他方そのウインドウが最後の1枚目であった場合に
はそのウインドウに割り当てられていたメモリ領域を未
使用としてアプリケーションが保有する、ことを特徴と
するアプリケーションにおけるメモリ割当処理方法。
5. A memory allocation processing method for a multi-window application, wherein a memory including a memory area for one window is acquired from the system and held when the application is started, and when a window open request is issued, the window is opened. If the window is the first one, the unused memory area held by the application is allocated, while if the window is the second or later one, the necessary memory area is additionally acquired from the system. When a window close request is made and the window is not the last one, the memory area allocated to that window is returned to the system and released, while that window is the last one. If it is an eye, the memory area allocated to the window A memory allocation processing method in an application, characterized in that the application holds the area as unused.
【請求項6】 請求項5において、アプリケーションに
おけるウインドウのオープン要求時のメモリ領域の割り
当ておよびウインドウのクローズ要求時のメモリ領域の
解放と保有の各処理は、アプリケーション内に設けられ
たメモリ管理ルーチンで実行することを特徴とするアプ
リケーションにおけるメモリ割当処理方法。
6. The memory management routine according to claim 5, wherein each process of allocating a memory area when a window open request is issued by an application and releasing and holding the memory area when a window close request is issued are performed by a memory management routine provided in the application. A memory allocation processing method in an application characterized by executing.
【請求項7】 マルチウインドウ対応のアプリケーショ
ンにおけるメモリ割当処理方法において、 アプリケーション起動時にあらかじめ定められた複数ブ
ロック分のメモリ領域をシステムから獲得し、獲得した
メモリ領域はブロック単位に使用状態と未使用状態とを
管理し、 ウインドウからメモリ領域の獲得を要求されたとき上記
システムから獲得したメモリ領域の未使用状態にあるブ
ロックを必要数割り当て、未使用状態のブロックがない
か不足している場合にはシステムから必要なメモリ領域
のブロックを追加獲得して割り当て、 ウインドウからメモリ領域のブロックの解放を要求され
たとき、そのメモリ領域のブロックが上記アプリケーシ
ョンの起動時にシステムから獲得したものであった場合
にはシステムに返却せずにアプリケーションで未使用状
態のブロックとして保有し、他方上記解放を要求された
メモリ領域のブロックがシステムから追加獲得したもの
であった場合にはシステムに返却して解放すること、を
特徴とするアプリケーションにおけるメモリ割当処理方
法。
7. A method for allocating memory in a multi-window compatible application, wherein a memory area for a plurality of predetermined blocks is acquired from the system when the application is activated, and the acquired memory area is used and unused in block units. When the window requests the acquisition of the memory area, the required number of blocks in the unused area of the memory area obtained from the above system is allocated. If there are no unused blocks or there are insufficient blocks, When a block of the memory area is acquired from the system when the window is requested to release the block of the memory area and the block of the memory area is additionally acquired and allocated from the system, Application without returning it to the system Application, which holds it as an unused block on the other hand, and returns it to the system and releases it if the block of the memory area requested to be released is additionally acquired from the system. Memory allocation processing method in.
【請求項8】 請求項7において、ウインドウからのメ
モリ領域の獲得要求および解放要求に対応する処理は、
アプリケーション内に設けられたメモリ管理ルーチンで
実行し、アプリケーション起動時にシステムから獲得し
たメモリ領域のブロックの使用状態および未使用状態の
管理はフラグを用いて行うことを特徴とするアプリケー
ションにおけるメモリ割当処理方法。
8. The process according to claim 7, wherein the process corresponding to the acquisition request and the release request of the memory area from the window is
A memory allocation processing method for an application, which is executed by a memory management routine provided in the application, and flags are used to manage the use status and unused status of blocks of the memory area acquired from the system when the application is started. .
JP11463295A 1995-05-12 1995-05-12 Memory assignment processing method for application Pending JPH08314791A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11463295A JPH08314791A (en) 1995-05-12 1995-05-12 Memory assignment processing method for application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11463295A JPH08314791A (en) 1995-05-12 1995-05-12 Memory assignment processing method for application

Publications (1)

Publication Number Publication Date
JPH08314791A true JPH08314791A (en) 1996-11-29

Family

ID=14642701

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11463295A Pending JPH08314791A (en) 1995-05-12 1995-05-12 Memory assignment processing method for application

Country Status (1)

Country Link
JP (1) JPH08314791A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008065638A (en) * 2006-09-07 2008-03-21 Nec Corp Memory management method, memory management device, and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008065638A (en) * 2006-09-07 2008-03-21 Nec Corp Memory management method, memory management device, and program

Similar Documents

Publication Publication Date Title
JP5475553B2 (en) Method for performing calculation based on graph, computer-readable storage medium storing instructions for executing the method, and system for executing the method
US5826082A (en) Method for reserving resources
US7765552B2 (en) System and method for allocating computing resources for a grid virtual system
US5842226A (en) Virtual memory management for a microkernel system with multiple operating systems
EP2485146A1 (en) System and method for providing hardware virtualization in a virtual machine environment
JPH07121373A (en) Data processing system and its operating method
JPH05204656A (en) Method for holding data inherent in thread
JP2003167737A (en) Stack use method
KR101085763B1 (en) Memory allocation in a multi-processor system
JPH08314791A (en) Memory assignment processing method for application
JPH10293695A (en) Dynamic reconfiguration system of logic computer system
KR100401560B1 (en) Kernel Stack Dynamic Allocation Method In Operating System
JPH1049397A (en) Control method for test program execution
AU2007202782B2 (en) Startup and control of graph-based computation
JP2003076562A (en) Method, device for quantitatively controlling memory, computer program and recording medium
JP2002259201A (en) Method for starting computer system
CN114968183A (en) Novel operating system kernel
JPH0344742A (en) Task assignment control system for multiprocessor
JP3251764B2 (en) I / O buffer controller
JPH04107640A (en) Computer system
JPH076045A (en) Memory managing method of multi-processing system
JP2002373114A (en) Information processor
JPH0348950A (en) Memory control system
JPH1049433A (en) Memory storage system
JPH0431937A (en) Area control processing system