JPH03204048A - Memory control method - Google Patents

Memory control method

Info

Publication number
JPH03204048A
JPH03204048A JP1344134A JP34413489A JPH03204048A JP H03204048 A JPH03204048 A JP H03204048A JP 1344134 A JP1344134 A JP 1344134A JP 34413489 A JP34413489 A JP 34413489A JP H03204048 A JPH03204048 A JP H03204048A
Authority
JP
Japan
Prior art keywords
area
unused
memory
areas
mcb
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
JP1344134A
Other languages
Japanese (ja)
Inventor
Masakazu Niro
丹路 雅一
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP1344134A priority Critical patent/JPH03204048A/en
Publication of JPH03204048A publication Critical patent/JPH03204048A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To vary the sizes of memory areas and to control these areas with a small number of tables by adding the information to the unused ones of those memory areas of a heap area to show positions of the front and rear unused areas respectively. CONSTITUTION:A heap area 1 includes (n + 1) pieces of busy areas and unused areas respectively. The information called MCB and showing the semantic (type) and the size of each area are stored in each head of the same semantic area. In addition, the information added with the previous and next free states is stored after the MCB in an unused area. This information is called free MCB. Thus the MCB and the free MCB are stored in the head of each busy area and each unused area of the area 1 respectively. Meanwhile a work area 2 stores only the address data showing the positions of the head and last unused areas.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、レーザプリンタのコントローラなど、マイ
クロコンピュータを用いた装置におけるメモリ管理方法
に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a memory management method in a device using a microcomputer, such as a controller for a laser printer.

〔従来の技術〕[Conventional technology]

例えばレーザプリンタのコントローラに搭載されるメモ
リ(RAM)は、コントローラが処理を進める上で必要
不可欠なデータを保持するワークエリアと、ダウンロー
ドフォント、フオームデータ、中間バッファなどの情報
を格納するヒープエリアとに分けて管理される。
For example, the memory (RAM) installed in the controller of a laser printer consists of a work area that holds essential data for the controller to proceed with processing, and a heap area that stores information such as downloaded fonts, form data, and intermediate buffers. It is managed separately.

ヒープエリアでは、フォントのダウンロードなどにより
メモリが必要になると、必要量のメモリ領域を確保して
そこにデータを蓄えて使用する。
In the heap area, when memory is required for downloading fonts, etc., the required amount of memory area is secured and data is stored there for use.

また、そのデータが不要になると、それに使用していた
メモリ領域が解放され、次にメモリが必要になった時に
またこのメモリ領域が使用される。
Furthermore, when the data is no longer needed, the memory area used for it is released, and this memory area is used again the next time the memory is needed.

このようなメモリの管理を行なう従来の方法としては、
例えば第9図に示すように、メモリのりヒープエリア1
を固定の大きさの複数のブロックに区切り、その各ブロ
ックの使用状態を示すテーブルをワークエリア2に持つ
ようにする方法がある(以下「従来例1」というう。
The traditional method of managing memory is as follows:
For example, as shown in Figure 9, memory heap area 1
There is a method of dividing the data into a plurality of blocks of fixed size and having a table in the work area 2 that shows the usage status of each block (hereinafter referred to as "prior art example 1").

この方法では、メモリが必要になるとワークエリア2内
のテーブルをチエツクして未使用のブロックを捜し、そ
のブロックを使用して必要なデータを記憶させる。
In this method, when memory is needed, the table in the work area 2 is checked to find an unused block, and that block is used to store the necessary data.

このとき、新たに使用するブロックに対応するテーブル
の内容を「使用中」に変更する。そのデータが不必要に
なって解放する場合は、解放するブロックに対応するテ
ーブルの内容をr未使用」に変更する。
At this time, the contents of the table corresponding to the newly used block are changed to "in use". If the data is no longer needed and is to be released, the contents of the table corresponding to the block to be released are changed to "runused".

また、第10図に示すように、ヒープエリア1内の未使
用領域の位置と大きさを管理するテーブルをワークエリ
ア2内に持つようにする方法もある(以下r従来例2」
という)。
Alternatively, as shown in FIG. 10, there is a method in which work area 2 has a table that manages the position and size of unused areas in heap area 1 (hereinafter referred to as conventional example 2).
).

この方法では、メモリが必要になるとワークエリア2内
のテーブルをチエツクして、必要量のデータを格納でき
る大きさの未使用領域を捜し、それが見付かるとそこか
らメモリ領域を確保する。
In this method, when memory is needed, the table in the work area 2 is checked to find an unused area large enough to store the required amount of data, and when it is found, a memory area is secured from there.

この時、未使用領域の大きさが変わるのでテーブルの内
容も書きかえられる。また、未使用領域の先頭から確保
した場合には、未使用領域の位置も変わるため、テーブ
ル内の位置情報も書きかえられる。
At this time, since the size of the unused area changes, the contents of the table are also rewritten. Furthermore, if the unused area is secured from the beginning, the position of the unused area changes, so the position information in the table is also rewritten.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

しかしながら、従来例1のメモリ管理方法によると、ヒ
ープエリアをブロック単位で管理するため、格納するデ
ータがブロックの大きさより小さい場合でも1つのブロ
ックを全部使うことになり、メモリの使用効率が悪くな
るという欠点があった。
However, according to the memory management method of Conventional Example 1, the heap area is managed in blocks, so even if the data to be stored is smaller than the block size, one block is used entirely, resulting in poor memory usage efficiency. There was a drawback.

この欠点を回避するためにブロックの大きさを小さくす
ると、管理すべきブロックの数が増え、ワークエリア内
に持たなくてはならないテーブルの数が多くなるため、
柔軟な使い方ができるヒープエリアの大きさそのものを
減らす結果になるという問題が生ずる。
If you reduce the block size to avoid this drawback, the number of blocks to be managed will increase, and the number of tables that must be kept in the work area will increase.
A problem arises in that the size of the heap area itself, which can be used flexibly, is reduced.

また、従来例2のメモリ管理方法によると、上述の場合
のようにヒープエリアを固定の大きさのブロックで管理
せず、使用するメモリ領域の大きさを可変にできるため
、メモリの無駄がでることは少ない。
Furthermore, according to the memory management method of Conventional Example 2, the heap area is not managed in blocks of fixed size as in the case described above, but the size of the memory area used can be made variable, resulting in wasted memory. There aren't many.

しかしながらこの方法では、メモリの確保と解放がくり
返されて未使用領域が分割される場合、未使用領域の数
だけテーブルを持っていなければならない。そして未使
用領域が幾つまで分割されるか予想することは困難な場
合が多く、問題なく管理を行なうためには従来例1の場
合と同様に多くのテーブルをワークエリア内に持ってい
なければならないという問題があった。
However, with this method, if memory is allocated and released repeatedly and unused areas are divided, it is necessary to have as many tables as there are unused areas. In addition, it is often difficult to predict how many unused areas will be divided, and in order to manage them without problems, it is necessary to have as many tables in the work area as in Conventional Example 1. There was a problem.

この発明は上記の点に鑑みてなされたものであり、メモ
リのヒープエリアにおける使用するメモリ領域の大きさ
を可変とし、かつ、未使用領域が幾つもに分割されても
少ないテーブルで管理できるようにすることを目的とす
る。
This invention was made in view of the above points, and it is possible to make the size of the memory area used in the memory heap area variable, and to manage it with a small number of tables even if the unused area is divided into many parts. The purpose is to

〔課題を解決するための手段〕[Means to solve the problem]

この発明は上記の目的を達成するため、搭載されている
メモリを、予め定められた位置に定められた内容を記憶
するワークエリアと、必要になった時にメモリ領域を確
保してそこにデータを記憶させ、そのデータが不要にな
った時にそのメモリ領域を解放して次の使用に備えるヒ
ープエリアとに分けて管理するメモリ管理方法において
、ヒープエリアにおける使用中の各領域にはその使用目
的と領域の大きさを表わす情報を付加し、未使用の各領
域には未使用であることを表わす情報と前後の未使用領
域がどこにあるかを示す情報を付加すると共に、先頭の
未使用領域の位置と最後の未使用領域の位置を前記ワー
クエリアに記憶することによってメモリを管理するよう
にしたものである。
In order to achieve the above object, the present invention uses the on-board memory to create a work area for storing predetermined contents in a predetermined location, and a memory area to secure and store data when necessary. In a memory management method in which data is stored in a heap area and a heap area is released when the data is no longer needed and prepared for the next use, each area in use in the heap area is marked with its purpose. Information indicating the size of the area is added, and information indicating that it is unused is added to each unused area, information indicating where the previous and following unused areas are, and the first unused area is The memory is managed by storing the location and the location of the last unused area in the work area.

〔作 用〕[For production]

この発明によるメモリ管理方法によれば、ヒープエリア
のメモリ領域のうち未使用領域のにはそれぞれ前後の未
使用領域がどこにあるかを示す情報が付加されているの
で、各未使用領域はリンクされてフリーメモリチェーン
を構成することができる。
According to the memory management method according to the present invention, each unused area in the memory area of the heap area is attached with information indicating where the previous and following unused areas are located, so each unused area is linked. can be used to construct a free memory chain.

従って、ワークエリア内には先頭と最後の未使用領域の
位置のみを記憶しておけばよいから、ワークエリアを少
なくしてヒープエリアを多くでき、メモリ全体を有効に
使用できる。また未使用領域がいくつに分割されても管
理可能である。
Therefore, since it is only necessary to store the positions of the first and last unused areas in the work area, the work area can be reduced and the heap area can be increased, and the entire memory can be used effectively. Furthermore, the unused area can be managed no matter how many parts it is divided into.

さらに、使用領域には使用目的と領域の大きさを表わす
情報が付加されているので、各使用領域が移動可能であ
るか否かを判断することができ、移動可能であれば移動
して複数の未使用領域をまとめて、大きなメモリ領域を
確保することが可能になる。
Furthermore, since information indicating the purpose of use and the size of the area is added to the usage area, it is possible to judge whether each usage area is movable or not, and if it is movable, it can be moved and It becomes possible to secure a large memory area by combining the unused areas of .

〔実施例〕〔Example〕

以下、この発明の実施例を図面を参照して説明する。 Embodiments of the present invention will be described below with reference to the drawings.

第1A図はこの発明を実施した場合のメモリ内のワーク
エリアとヒープエリアの管理状態の一例を示す。
FIG. 1A shows an example of the management state of the work area and heap area in the memory when the present invention is implemented.

ヒープエリア1内にはそれぞれn+1個の使用中の領域
と未使用領域とがあり、同一の意味領域(未使用である
か、使用中であれば同一の目的で使用されている領域)
の各先頭には、この領域の意味(Type)と大きさ(
Size)を表わす情報(データ)を格納し、そのデー
タブロックをMCB (Me+++ory Contr
ol Block)と呼ぶ。
Each heap area 1 has n+1 used areas and unused areas, which have the same meaning (areas that are unused or used for the same purpose if they are in use).
At the beginning of each field, the meaning (Type) and size (
The data block is stored as MCB (Me+++ory Contr
ol Block).

さらに、未使用領域の場合にはこのMOHに続いてこの
領域の前後で最も近い未使用領域の位置を示す情報であ
るプレピアスフリー(Previous−free)と
ネクストフリー(Next−free)を付加した情報
を格納するが、このデータブロックをフリーMCBと呼
ぶ。
Furthermore, in the case of an unused area, following this MOH, Previous-free and Next-free, which are information indicating the position of the nearest unused area before and after this area, are added. This data block, which stores information, is called a free MCB.

第1B図に、このMCBとフリーMCBの構造を示す。FIG. 1B shows the structure of this MCB and free MCB.

MCBのit Ty p e ”は8ビツトでその領域
の意味を示し、II O71の場合は未使用である。使
用中の場合は、その使用目的によって予め決められた値
が入れられる。この“’Type”は後述するガベツジ
コレクションの際にも参照される。
"It Type" of MCB indicates the meaning of the area with 8 bits, and in the case of II O71, it is unused. If it is in use, a value predetermined according to the purpose of use is entered. "Type" is also referenced during garbage collection, which will be described later.

また、EI S x z e ”は24ビツトでその領
域の大きさを示す。
Further, EI S x ze ” is 24 bits and indicates the size of the area.

フリーMCBの”Next−free”は32ビツトで
、次の未使用領域がどこにあるかを示すリンク情報であ
り、最後の未使用領域の場合にはこの値はIt O”と
する。
"Next-free" of the free MCB is 32 bits and is link information indicating where the next unused area is, and in the case of the last unused area, this value is "It_O".

“Previous−free”も32ビツトで、前の
未使用領域がどこにあるかを示すリンク情報であり、先
頭の未使用領域の場合にはこの値は0”とする。
"Previous-free" is also 32 bits and is link information indicating where the previous unused area is, and in the case of the first unused area, this value is 0''.

このように、ヒープエリア1の各使用領域の先頭にはM
CBを未使用領域の先頭にはフリーMCBを格納し、ワ
ークエリア2には第1A図に示すように、先頭と最後の
未使用領域の位置を示すアドレスデータだけを記憶させ
ておく。
In this way, at the beginning of each used area of heap area 1, M
A free MCB is stored at the beginning of an unused CB area, and only address data indicating the positions of the beginning and end unused areas are stored in the work area 2, as shown in FIG. 1A.

このようにすることによって、ヒープエリア1内の未使
用領域はリンク情報(Previous−freeと〜
ext−free)によって接続され、フリーメモリチ
ェーンを構成する。
By doing this, the unused area in heap area 1 can be used for link information (previous-free and ~
ext-free) to form a free memory chain.

従って、ワークエリア2内には先頭と最後の未使用領域
の位置のみを記憶しておけばよく、また未使用領域が幾
つに分割されても管理ができなくなることはない。
Therefore, it is only necessary to store the positions of the first and last unused areas in the work area 2, and no matter how many parts the unused area is divided into, it will not become unmanageable.

ところで前述したように、レーザプリンタのコントロー
ラに設けられたメモリのヒープエリアには、フォントデ
ータ、フオームデータ、中間バッファのデータなどが格
納される。
By the way, as mentioned above, font data, form data, intermediate buffer data, etc. are stored in the heap area of the memory provided in the controller of the laser printer.

このうち、フォントデータやフオームデータは複数の頁
にわたって使用され、中間バッファは頁単位で作成され
るためその頁の印字が終了すると解放される。
Of these, font data and form data are used over multiple pages, and intermediate buffers are created for each page, so they are released when printing for that page is completed.

このような比較的固定的に使用される領域と、頻繁に確
保・解放がくり返される領域とが混在すると未使用領域
が分割され、管理上の問題が発生するばかりでなく、大
きな領域が確保できなくなるという問題が発生する。
If such a relatively fixed area is mixed with an area that is frequently allocated and released, the unused area will be divided, which will not only cause management problems but also cause large areas to be allocated. The problem arises that it cannot be done.

そこで、この問題を低減するために、固定的に使用され
るデータと頻繁に確保・解放が行なわれるデータとは、
ヒープエリアの異なる方向から確保するのが望ましい。
Therefore, in order to reduce this problem, data that is used permanently and data that is frequently secured and released are
It is desirable to secure from different directions of the heap area.

例えば、フォントデータやフオームデータをアドレスの
小さい領域の方から確保し、中間バッファをアドレスの
大きい領域の方から確保するなどの方法がとられる。
For example, a method is used in which font data and form data are secured from areas with smaller addresses, and intermediate buffers are allocated from areas with larger addresses.

そこで、この実施例によってもメモリが必要になった場
合、その使用目的によりヒープエリアの先頭もしくは最
後の未使用領域から順にリンク情報をたどりながらメモ
リを確保することができる未使用領域を捜し、その領域
にメモリを確保する。
Therefore, if memory is required according to this embodiment, an unused area where memory can be secured is searched for by tracing link information from the beginning or the last unused area of the heap area depending on the purpose of use. Allocate memory in the area.

先頭から捜した場合には未使用領域の先頭の方から、逆
に最後から捜した場合には未使用領域の最後からメモリ
領域を確保する。
When searching from the beginning, memory areas are secured from the beginning of the unused area, and conversely, when searching from the end, the memory area is secured from the end of the unused area.

メモリ領域が確保されると、そのメモリ領域の先頭にM
CBが作られ、使用目的と確保した領域の大きさがそれ
ぞれII Typ e”と’5izeに書き込まれる。
When a memory area is secured, M is placed at the beginning of the memory area.
A CB is created, and the purpose of use and the size of the reserved area are written in II Type e'' and '5ize, respectively.

また、この時に未使用領域のフリーMCBも書き換えら
れる。なお、先頭もしくは最後の未使用領域の先頭が変
わった場合には、ワークエリア2内にあるデータも書き
かえられる。
Also, at this time, the free MCB in the unused area is also rewritten. Note that if the beginning or the beginning of the last unused area is changed, the data in the work area 2 is also rewritten.

第2図にヒープエリアのメモリ領域を確保する前の状態
を、第3図に使用するメモリ領域を先頭から確保した状
態を、第4図に使用するメモリ領域を最後から確保した
状態をそれぞれ示す。
Figure 2 shows the state before securing the memory area of the heap area, Figure 3 shows the state in which the memory area to be used is secured from the beginning, and Figure 4 shows the state in which the memory area to be used is secured from the end. .

次に、使用していたメモリ領域を解放する場合について
説明する。
Next, the case of releasing the used memory area will be explained.

使用中のメモリ領域を解放する場合は、解放する領域の
アドレスとフリーMCBのデータとを比較しながら、フ
リーメモリチェーンをたどり、解放するメモリがフリー
メモリチェーンのどの位置に入るべきかを決める。この
位置が決まると、前後の使用中の領域のフリーMCBの
リンクを一度切り離し、解放されたメモリ領域の先頭に
フリーMCBを作り、前後のフリーMCBとのリンクを
作りなおす。
When releasing a memory area in use, the free memory chain is traced while comparing the address of the area to be released with the data of the free MCB, and it is determined in which position in the free memory chain the memory to be released should be placed. Once this position is determined, the links between the free MCBs in the used areas before and after are once disconnected, a free MCB is created at the beginning of the freed memory area, and the links with the free MCBs before and after are re-created.

このようにして、使用していたメモリ領域をフリーメモ
リチェーンに組み入れることによりメモリは解放され、
未使用領域が形成されて、次にメモリが必要になったと
きにこの領域が使用できるようになる。
In this way, memory is freed by incorporating the used memory area into the free memory chain,
An unused area is created that can be used the next time memory is needed.

第5図に第2図における使用中の領域3を解放した状態
を示す。
FIG. 5 shows a state in which the area 3 in use in FIG. 2 is released.

この解放を行なう作業において、解放されるメモリ領域
が前もしくは後又は前後の未使用領域に隣接している場
合には、未使用領域が結合されてひとつの未使用領域と
してフリーメモリチェーンに組み入れられる。
During this release process, if the memory area to be released is adjacent to the previous, subsequent, or previous and subsequent unused areas, the unused areas are combined and incorporated into the free memory chain as one unused area. .

第6図に第5図の状態からさらに使用領域2を解放した
状態を示す。
FIG. 6 shows a state in which the usage area 2 is further released from the state shown in FIG.

このような解放作業においても、先頭または最後の未使
用領域の先頭アドレスが変った場合には、ワークエリア
2内のデータが書き換えられることは言うまでもない。
Needless to say, even in such a release operation, if the start address of the first or last unused area changes, the data in the work area 2 will be rewritten.

この実施例によれば、ワークエリア2内に持たなければ
ならない固定のテーブルが極めて小さくてすみ、しかも
メモリの無駄が発生せず、メモリが管理できない状態に
なることもないため、効果的なヒープエリアのメモリ管
理を行なうことができる。
According to this embodiment, the fixed table that must be kept in the work area 2 is extremely small, and there is no wastage of memory and no memory becomes unmanageable. Area memory management can be performed.

次に、この管理方法を実施した場合のガベツジコレクシ
ョンの方法について説明する。
Next, a garbage collection method when this management method is implemented will be explained.

ガベツジコレクションは、未使用領域が細かく分割され
て大きなメモリ領域が確保できなくなってきた時に、使
用中のメモリ領域を移動することにより、未使用領域を
結合して、より大きなメモリ領域の確保を可能にするこ
とである。
Garbage collection is used to combine unused areas and secure a larger memory area by moving the memory area in use when the unused area is divided into smaller pieces and it becomes impossible to allocate a large memory area. It is to make it possible.

ところで、例えばレーザプリンタのコントローラにおい
ては、処理速度を上げるために中間バッファの中で直接
アドレスを使用するものがある。
By the way, for example, some laser printer controllers use direct addresses in an intermediate buffer to increase processing speed.

このような使い方をする場合には、移動できない使用領
域がヒープエリア内に発生し、完全なガベツジコレクシ
ョンができないことがある。このような場合でもガベツ
ジコレクションによって、未使用領域が結合される可能
性はあるので、移動できない使用領域を避けながらガベ
ツジコレクションを行なわなければならない。
When used in this way, a used area that cannot be moved may occur in the heap area, making complete garbage collection impossible. Even in such a case, there is a possibility that unused areas may be combined due to garbage collection, so garbage collection must be performed while avoiding used areas that cannot be moved.

前述した従来例1においてガベツジコレクションを行な
う場合には、あくまでブロック単位であり、ブロック内
にある無駄な領域をなくすことはできない。
When garbage collection is performed in the prior art example 1 described above, it is performed on a block-by-block basis, and it is not possible to eliminate wasted areas within a block.

また、従来例2の場合には使用中のメモリ領域は管理さ
れないので、使用中のメモリ領域を移動すること自体不
可能である・ 上述したこの発明の実施例では、MCBのII T y
pe IIに使用中の領域の使用目的が書き込まれてい
るので、これを利用して使用中の領域の移動が可能であ
るか否かを判断することができる。
In addition, in the case of Conventional Example 2, since the memory area in use is not managed, it is impossible to move the memory area in use.
Since the purpose of use of the area in use is written in pe II, it is possible to use this to determine whether or not the area in use can be moved.

まず、・先頭の未使用領域の後にある使用中の領域のM
CBをチエツクする。その結果その使用中の領域が移動
可能であれば、移動させて前にある未使用領域とスワッ
プする。
First, M of the used area after the first unused area
Check CB. As a result, if the area in use can be moved, it is moved and swapped with the previous unused area.

これを順次繰り返し、未使用領域の後の領域も未使用領
域となった時、二つの領域を結合して一つの領域とする
。この処理を最後の未使用領域にたどりつくまで繰り返
せば、未使用領域は一つにまとめられるはずである。
This is repeated in sequence, and when the area after the unused area also becomes an unused area, the two areas are combined into one area. If this process is repeated until the last unused area is reached, the unused areas should be combined into one.

” T y p e ”は、スワップによって変更しな
ければならないデータを知るために参照される。例えば
、その領域がフォントデータを格納するために使用され
ていれば、フォントデータがどこにあるかを記憶してい
るデータを書き換える。
"T y p e" is referenced to know the data that must be changed by swapping. For example, if the area is used to store font data, the data storing where the font data is located is rewritten.

第7図(a)〜(d)にガベツジコレクションが進めら
れていく様子を示す。
Figures 7(a) to 7(d) show how garbage collection is progressing.

この処理の途中で、未使用領域の後が移動できない領域
になった場合は、その未使用領域に対する処理を断念し
、次の未使用領域について同じ処理を行なう。
During this process, if an area after the unused area becomes an area that cannot be moved, the process for that unused area is abandoned, and the same process is performed for the next unused area.

第8図は第7図(C)の状態で、使用中4の領域が移動
できない場合にガベツジコレクションを行なった結果を
示す。
FIG. 8 shows the result of garbage collection performed when the currently used area 4 cannot be moved in the state shown in FIG. 7(C).

このように、MCBの“Type″を利用することによ
り、移動できないメモリ領域を避けながらガベツジコレ
クションを行なうことができる。
In this way, by using "Type" of the MCB, garbage collection can be performed while avoiding memory areas that cannot be moved.

〔発明の効果〕〔Effect of the invention〕

以上説明してきたように、この発明によれば、ヒープエ
リアとワークエリアとを用いてメモリを管理するメモリ
管理方法において、ヒープエリアのメモリ領域の大きさ
を可変とし、かつ未使用領域が細かく分割されても、ワ
ークエリアの極めて少ないテーブルで管理することがで
きる。
As explained above, according to the present invention, in a memory management method that manages memory using a heap area and a work area, the size of the memory area of the heap area is made variable, and the unused area is divided into small pieces. However, it can be managed with a table with very little work area.

また、ガベツジコレクションも容易に無駄なく行なうこ
とができる。
Furthermore, garbage collection can be easily performed without waste.

したがって、メモリ全体を有効に利用することができる
Therefore, the entire memory can be used effectively.

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

第1A図はこの発明を実施した場合のメモリ内のワーク
エリアとヒープエリアの管理状態の一例を示す説明図。 第2図乃至第4図は同じくそのヒープエリアに使用する
メモリ領域を確保する手順の説明図、第5図及び第6図
は同じく使用中のメモリ領域を解放する手順の説明図、 第7図及び第8図は同じくガベツジコレクションの手順
の説明図、 第9図及び第10図はそれぞれ従来のメモリ管理方法の
異なる例を示す説明図である。 1 ヒープエリア    2・・・ワークエリア(α) 処理開始前 第9図 図 (b) 未使用lと2を結合 未便用1と2と3を結合 全未使用を結合 第10図 手続補正帯動式) 平成2年4月26日
FIG. 1A is an explanatory diagram showing an example of a management state of a work area and a heap area in a memory when the present invention is implemented. Figures 2 to 4 are explanatory diagrams of the procedure for securing a memory area to be used in the heap area, Figures 5 and 6 are explanatory diagrams of the procedure for releasing the memory area in use, and Figure 7 and FIG. 8 are explanatory diagrams of the garbage collection procedure, and FIGS. 9 and 10 are explanatory diagrams showing different examples of conventional memory management methods, respectively. 1 Heap area 2... Work area (α) Before processing starts Figure 9 (b) Combine unused 1 and 2 Combine unused 1, 2 and 3 Combine all unused Figure 10 Procedure correction band (Moving ceremony) April 26, 1990

Claims (1)

【特許請求の範囲】 1 搭載されているメモリを、予め定められた位置に定
められた内容を記憶するワークエリアと、必要になつた
時にメモリ領域を確保してそこにデータを記憶させ、そ
のデータが不要になつた時にそのメモリ領域を解放して
次の使用に備えるヒープエリアとに分けて管理するメモ
リ管理方法において、 前記ヒープエリアにおける使用中の各領域にはその使用
目的と領域の大きさを表わす情報を付加し、未使用の各
領域には未使用であることを表わす情報と前後の未使用
領域がどこにあるかを示す情報を付加すると共に、 先頭の未使用領域の位置と最後の未使用領域の位置を前
記ワークエリアに記憶することを特徴とするメモリ管理
方法。
[Scope of Claims] 1. The installed memory has a work area for storing predetermined contents at a predetermined position, and a memory area is secured and data is stored there when needed. In a memory management method that separates the memory area into a heap area and a heap area to prepare for the next use by releasing the memory area when data is no longer needed, each area in use in the heap area is marked with its purpose of use and the size of the area. For each unused area, information indicating that it is unused and information indicating where the preceding and succeeding unused areas are are added, as well as the position of the first unused area and the end. A memory management method, comprising: storing a position of an unused area in the work area.
JP1344134A 1989-12-30 1989-12-30 Memory control method Pending JPH03204048A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1344134A JPH03204048A (en) 1989-12-30 1989-12-30 Memory control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1344134A JPH03204048A (en) 1989-12-30 1989-12-30 Memory control method

Publications (1)

Publication Number Publication Date
JPH03204048A true JPH03204048A (en) 1991-09-05

Family

ID=18366904

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1344134A Pending JPH03204048A (en) 1989-12-30 1989-12-30 Memory control method

Country Status (1)

Country Link
JP (1) JPH03204048A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006021325A (en) * 2004-07-05 2006-01-26 Noritsu Koki Co Ltd Memory management system for printing data processing
JP2011100230A (en) * 2009-11-04 2011-05-19 Fujitsu Ltd Program and device having memory management function

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006021325A (en) * 2004-07-05 2006-01-26 Noritsu Koki Co Ltd Memory management system for printing data processing
JP2011100230A (en) * 2009-11-04 2011-05-19 Fujitsu Ltd Program and device having memory management function

Similar Documents

Publication Publication Date Title
DE2317870A1 (en) PROGRAM-CONTROLLED INTERRUPTION SYSTEM FOR INPUT AND OUTPUT IN A DIGITAL CALCULATOR
JPS6095679A (en) Control structure for document processing system
JPH02227763A (en) Data transfer control system
JPS60125885A (en) Movement of cursor
JPH0214330A (en) Information processing unit
JPH03204048A (en) Memory control method
DE10107102B4 (en) Method and arrangement for instruction word generation in the control of functional units in a processor
JPS63139751A (en) Printing method in printing system
EP0360900B1 (en) Method for treating work calls to one of the processes from the single processes of a data processing system
JPH0221326A (en) Data sorting system
JPH03152659A (en) Word processor
JPS621048A (en) Virtual storage system
JP2002358102A (en) Programming device for programmable logic controller
JPS6381526A (en) Sort input/output buffer management system
JPS63103368A (en) Document compiling device
JPH04148247A (en) Automatic file optimization processing system for random-accessible storage device
JPH0644257B2 (en) Buffering method for unspecified length continuous area
JPH0650483B2 (en) Secondary storage control method
JPH03189747A (en) Memory control processing system
JPS59180755A (en) Tracing system
JPH02181852A (en) Control table rearrangement processing system
JPS626344A (en) Program debug system
JPS6359654A (en) Picture processor
JPS631598A (en) Data output controller to xy plotter
JPH02138645A (en) Processing system for input order file