JPS63131247A - Garbage collection system - Google Patents

Garbage collection system

Info

Publication number
JPS63131247A
JPS63131247A JP61277729A JP27772986A JPS63131247A JP S63131247 A JPS63131247 A JP S63131247A JP 61277729 A JP61277729 A JP 61277729A JP 27772986 A JP27772986 A JP 27772986A JP S63131247 A JPS63131247 A JP S63131247A
Authority
JP
Japan
Prior art keywords
pages
page
waiting
real
garbage collection
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
JP61277729A
Other languages
Japanese (ja)
Inventor
Koji Hayashi
耕司 林
Toshihiro Ozawa
年弘 小沢
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP61277729A priority Critical patent/JPS63131247A/en
Publication of JPS63131247A publication Critical patent/JPS63131247A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE:To control paging in GC and to improve the collection efficiency of garbage by considering whether a GC objective page exists on a main storage or not, and whether it includes much garbage or not so as to execute GC. CONSTITUTION:A reference relation between pages on a real storage 1 is held in an interreference table 3, and the reference relation from inside the page on a virtual storage 2 to inside the page on the real storage 1 is held in a real storage indirect pointer table 4 in an indirect pointer shape. The reference relation of interpage on the virtual storage 2 is held in a virtual storage indirect pointer table 5. With referring to respective tables, garbage collection is executed in respective pages on plural pages which are recently used and which are on the real storage 1 among GC waiting pages showed in a GC waiting table 6.

Description

【発明の詳細な説明】 〔概 要〕 本発明は、記号処理言語を仮想記憶で実行する際、実記
憶上に存在する最近使用されたページを対象にガーベジ
コレクション(GC”)を行うことにより、GC中のペ
ージングを抑えてGC起動による処理停止時間を有限値
に納め、且つガーベジの回収効率を高めようとするもの
である。
[Detailed Description of the Invention] [Summary] The present invention is capable of performing garbage collection (GC) on recently used pages existing in real memory when a symbolic processing language is executed in virtual memory. , which attempts to suppress paging during GC, keep the processing stop time due to GC activation to a finite value, and increase garbage collection efficiency.

〔産業上の利用分野〕[Industrial application field]

本発明は、仮想記憶の環境で実行されるLISP。 The present invention is a LISP that is executed in a virtual memory environment.

Prolog等の記号処理言語の実時間ガーベジコレク
ション方式に関する。
This invention relates to a real-time garbage collection method for symbolic processing languages such as Prolog.

(従来の技術〕 LISP、 Prolog等の記号処理言語を用いた人
工知能用のソフトウェアの実行中には多量のガーベジ(
ごみ)が発生し、そこでページ単位でガーベジを除いて
有効部分を集め、空きを作って再使用可能にする。この
処理はガーベジコレクタにより行なうが、このガーベジ
コレクタによる記号処理停止が、制御などの即答性力(
要求される分野で問題となっている。
(Prior art) A large amount of garbage (
Garbage) is generated, and the useful parts are collected by removing the garbage page by page to create space and make it reusable. This processing is performed by a garbage collector, and the stop of symbol processing by the garbage collector is important for immediate response functions such as control (
This is a problem in the field of demand.

従来よりガーベジコレクタ起動による処理停止時間を有
限に抑える事(実時間性、リアルタイム性から)を目的
として多(の方式が提案されているが、それらはいずれ
も実記憶上での実時間性を保障しているに過ぎず、仮想
記憶の環境におけるガーベジコレクション中のベージン
グの影習による処理中断を考慮していない。このため次
の様な問題が生ずる。
Many methods have been proposed in the past for the purpose of keeping the processing stoppage time due to garbage collector startup to a finite limit (from the viewpoint of real-time performance and real-time performance), but all of them are limited to real-time performance on real memory. However, it does not take into account the interruption of processing due to the effect of paging during garbage collection in a virtual memory environment.This causes the following problems.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来の実時間型のガーベジコレクションではGC処理の
ためのデータの参照が、当該データが実記1,2上にあ
るかどうかにかかわらず行なわれる。
In conventional real-time garbage collection, reference to data for GC processing is performed regardless of whether the data exists in the actual records 1 and 2.

従って、参照されたデータの多くが実記憶上にない場合
はページフォルトが多発す゛る。ページフォルトが発生
すると当該ページをディスクなどの外部記憶から主犯)
、αへ、不要ページを排出して空ぎを作ったりして取寄
せることになるが、このページングは1回当り数m秒〜
数十m秒程度の処理時間を要する作業であるので、これ
が多発すると記号処理が長時間中断することになる。従
って、従来のGC方式では仮想記憶の環境での実時間性
は保障されない。
Therefore, if much of the referenced data is not in real memory, page faults occur frequently. When a page fault occurs, the page is transferred from external storage such as a disk (main culprit)
, α, by ejecting unnecessary pages to create space, but this paging takes several milliseconds or more each time.
Since this is a task that requires a processing time of approximately several tens of milliseconds, if this occurs frequently, symbol processing will be interrupted for a long time. Therefore, the conventional GC method does not guarantee real-time performance in a virtual storage environment.

本発明は、GC対象ページが主記憶上に存在するか否か
、ガーベジを多量に含むものであるか否かを考慮してG
Cを行なうようにすることにより、GC中のベージング
を抑え且つガーベジの回収効率を高めようとするもので
ある。
The present invention takes into consideration whether or not the page to be GC exists on the main memory and whether or not it contains a large amount of garbage.
By performing C, it is intended to suppress paging during GC and increase garbage collection efficiency.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は、記号処理言語を実記憶(1)と仮想記憶(2
)を備える処理システムで実行する際のガーベジコレク
ション方式において、実記憶(1)上のページ相互間の
参照関係を保持する相互参照テーブル(3)と、仮想記
憶(2)上のページ内から実記ill上のページ内への
参照関係を間接ポインタの形態で保持する実記憶間接ポ
インタテーブル(4)と、仮想記憶(2)上のページ相
互間の参照関係を保持する仮想記憶間接ポインタテーブ
ル(5)と、ガーベジコレクション待ちページを使用順
に示すGC待ちページテーブル(6)と、所定の閾値以
上に領域が回収されているページを示す利用待ちページ
テーブル(7)とを設け、GC待ちページテーブル(6
)で示されるGC待ちページのうち、最近使用され且つ
実記憶(1)上にある複数ページを対象とし、前記各テ
ーブルを参照して各ページ毎にガーベジコレクションす
ることを特徴とするものである。
The present invention uses a symbol processing language in real memory (1) and virtual memory (2).
), a cross-reference table (3) that maintains the reference relationship between pages in the real memory (1), and a cross-reference table (3) that maintains the reference relationship between pages in the real memory (1), and a A real memory indirect pointer table (4) that maintains reference relationships within pages on ill in the form of indirect pointers, and a virtual memory indirect pointer table (5) that maintains reference relationships between pages on virtual memory (2). ), a GC waiting page table (6) showing pages waiting for garbage collection in order of use, and a waiting page table (7) showing pages whose area has been collected in excess of a predetermined threshold value, and a GC waiting page table ( 6
) among the pages waiting for GC, which have been used recently and are on the real memory (1), and are characterized in that garbage collection is performed for each page by referring to each of the tables. .

〔作用〕[Effect]

GC処理の対象を実記憶上のページに限ると、仮想記憶
との間のページングが抑えられるので、ガーベジコレク
タ起動による記号処理停止時間を短い時間に留めること
ができる。また記号処理言語では最近使用されたデータ
の多くがガーベジとなる確率が高い性質を有するので、
GC対象を最近使用されたページに限定するとガーベジ
の回収効率が高くなる。また、セル相互間の参照関係を
各種のテーブルで指示しておく、と、ガーベジである/
ないを容易に判定でき、他のページから参照されている
有効データをガーベジとして誤って処理することを防止
でき、これによりページ毎のGC処理を容易、正確に行
なうことが可能となる。
If the objects of GC processing are limited to pages on the real memory, paging to and from the virtual memory can be suppressed, so that the symbol processing stop time due to activation of the garbage collector can be kept short. Also, in symbolic processing languages, much of the recently used data has a high probability of becoming garbage, so
If the GC target is limited to recently used pages, garbage collection efficiency will be increased. Also, if you specify the reference relationships between cells in various tables, it will result in garbage/
It is possible to easily determine whether or not the page exists, and it is possible to prevent valid data referenced from other pages from being erroneously treated as garbage, thereby making it possible to easily and accurately perform GC processing for each page.

〔実施例〕〔Example〕

第1図は本発明方式の概念図である。先ずこれを参照し
ながら本発明方式を説明する。
FIG. 1 is a conceptual diagram of the system of the present invention. First, the method of the present invention will be explained with reference to this.

■フロクラムの進行に伴って新しいセル(一定サイズの
記憶領域で1ページ内に複数個あり、データはこのセル
に収容され、セル単位で参照される)が必要となった場
合は、実記憶上に有るページから記憶領域を使って行く
。使ったページには順番に1.2,3.・・・・・・と
いった番号を与える。
■If a new cell (storage area of a fixed size, there are multiple cells in one page, data is stored in this cell and referenced on a cell-by-cell basis) is required as the program progresses, the actual memory The storage area is used from the page located in . The pages I used are 1, 2, 3 in order. Give a number such as...

これを世代番号と呼ぶ。1つのページの全てのセルを使
い尽すと、そのページはGC待ち集合に加えられ、次の
新しいページが使われる。実記憶上のページが使われ尽
すと、次は仮想記憶上のべ一ジが使われる。
This is called the generation number. When all cells of a page are used up, the page is added to the GC queue and the next new page is used. When a page in real memory is used up, a page in virtual memory is used next.

■処理が進んで記憶領域(論理空間)がある程度使い尽
された時点でガーベジコレクタを起動する。その際、G
C待ち集合中にあるページのうちで実記憶上にあり、な
おかつ世代番号が大きいほうからnページを選んで、そ
れぞれのページ内で古典的な一括型のGCを行う。第1
図の例ではGC順は世代番号15,14,12.・・・
・・・の順である。世代番号の大きいものは最近使用の
ものであり、これは実記憶上にある確率が高い。
■Start the garbage collector when the processing progresses and the storage area (logical space) is used up to a certain extent. At that time, G
Among the pages in the C-wait collection, n pages are selected from those in real memory and have larger generation numbers, and classic batch-type GC is performed on each page. 1st
In the example shown in the figure, the GC order is generation numbers 15, 14, 12. ...
The order is... Those with larger generation numbers are those that have been used recently, and there is a high probability that they are in real memory.

■GCを行なった結果、ある域値以上の領域が回収され
たページ(有効セルと所定数以上の空きセルを含む)は
利用待ち集合に加える。そうでない(所定数以上の空き
セルが得られなかった)ページは世代番号をkだけ減ら
し、そのページをGC待ちの集合に留める。
(2) As a result of GC, a page (including valid cells and a predetermined number or more of empty cells) for which an area larger than a certain threshold value has been recovered is added to a waiting set for use. For pages that are not (for which a predetermined number or more of free cells could not be obtained), the generation number is decreased by k, and the pages are kept in the GC waiting group.

■C0N5 (LISPの基本関数)等で新たに領域が
必要となった場合は利用待ち集合中にあり、実記憶上に
あって、世代番号が1°番大きいページを使う。
- When a new area is required for C0N5 (a basic LISP function), etc., the page that is in the collection waiting to be used, is on the real memory, and has the 1° largest generation number is used.

その際、ページの世代番号を1増やす。図示の例では世
代番号16のページを使い、その世代番号を新たに17
とする。
At that time, the generation number of the page is increased by 1. In the example shown, the page with generation number 16 is used, and the generation number is newly changed to 17.
shall be.

■利用待ち集合中にページが存在する場合は■〜■の処
理が繰り返えされる。利用待ち集合中にページが無くな
った場合(総てのページがある量以上のアクティブセル
で満たされてGC待ち集合に加わった場合)には、■の
処理をGC待ち集合にあるページについて行う。つまり
、新たに領域が必要となったとき、世代番号が1番大き
いGC待ちページを使い(該ページ内の空きセルを使い
)、そのページの世代番号を1増やす。
■If a page exists in the collection waiting for use, the processes from ■ to ■ are repeated. If there are no more pages during the usage waiting set (if all the pages are filled with a certain amount or more of active cells and added to the GC waiting set), the process (2) is performed for the pages in the GC waiting set. That is, when a new area is required, the GC waiting page with the largest generation number is used (using empty cells within the page), and the generation number of that page is increased by 1.

以上のようなページ毎のGCが可能であるためには、ガ
ーベジコレクタを起動する時点でそのページ内で他のペ
ージのデータから指されているデータの存在が明らかで
ないといけない(それをガーベジだと思って回収してし
まってはいけないので)、そのために、第2図に示す如
く、以下のような処理を行う。
In order for page-by-page GC to be possible as described above, the existence of data pointed to by data on other pages within that page must be clear at the time the garbage collector is started. Therefore, as shown in FIG. 2, the following process is performed.

(alプログラム中でページへデータを書き込む際、そ
れが他のページにあるデータへの参照ポインタである場
合、例えばページBへ暑き込んだデータがページAへの
ポインタであった場合、即ち同じ実記憶上にあるページ
へのポインタであった場合は実記憶1上の相互参照テー
ブル3へA、Bのページ番号を組にして害き込んでおく
(When writing data to a page in an al program, if it is a reference pointer to data in another page, for example, if the data written to page B is a pointer to page A, then If it is a pointer to a page in memory, the page numbers A and B are stored as a pair in the mutual reference table 3 on the real memory 1.

ページBへ書き込んだデータが仮想記憶(ディスク装置
)2上にあるページDへのポインタであった場合は何も
しない。また相互参照テーブル3はページの対を書込ん
でおくだけであるからページ間の参照関係を示している
だけであり、セル間の参照関係は当該ページを走査して
知る。
If the data written to page B is a pointer to page D on virtual storage (disk device) 2, nothing is done. Further, since the cross-reference table 3 is simply written with pairs of pages, it only indicates the reference relationships between pages, and the reference relationships between cells are known by scanning the pages.

(bl利用したページをページアウトする必要が生じた
場合、たとえばページBをページアウトする必要が生じ
た場合は当該ページBを走査する。この時、実記憶l上
の他のページ、例えばページA内のデータへのポインタ
が見付かった場合は、そのポインタを実記憶間接ポイン
タテーブル(RIPT)4へ登録し、もともとのポイン
タ(ページB中の)はRIr’T4のこのエントリを措
すように修正する。
(If it is necessary to page out the page that used BL, for example, if it is necessary to page out page B, the page B is scanned. At this time, other pages on the real memory l, such as page A If a pointer to data in page B is found, register that pointer in the real memory indirect pointer table (RIPT) 4, and modify the original pointer (in page B) to point to this entry in RIr'T4. do.

また仮想記憶2上の他のページ、例えばページDへのポ
インタを見付けた場合は、同様に仮想記憶間接ポインタ
テーブル(VIPT)  5へ登録する。
If a pointer to another page on the virtual memory 2, for example page D, is found, it is similarly registered in the virtual memory indirect pointer table (VIPT) 5.

(C)仮想記憶2上のページをページインした場合はそ
れを走査し、例えばページDのようにVIPT5にエン
トリを持つ場合にはこれを取り除(。またページCのよ
うにページAへの参照をもちRIPT4にエントリを持
つ場合にはこれを取り除き、相互参照テーブル3へA、
Cのページ番号を組にして登録する。
(C) When a page on virtual memory 2 is paged in, it is scanned, and if it has an entry in VIPT5, such as page D, it is removed (.Also, when page D is paged in, it is removed). If there is a reference and an entry in RIPT4, remove it and write A to cross reference table 3.
Register the page numbers of C as a set.

以上のような処理により、スタックやインターンされた
シンボルといった古典的な処理系におけるルー) (G
Cを行う場合のアクティブセルの起点)に加えて、RI
PT4および、相互参照テーブル3経由で対応するペー
ジを走査する事で得られるポインタをルートとすること
で、ページ毎のGCが可能になる。
Through the above processing, the rules in classical processing systems such as stacks and interned symbols) (G
In addition to the starting point of the active cell when performing C), the RI
By using the pointer obtained by scanning the corresponding page via the PT4 and the cross-reference table 3 as the root, GC for each page becomes possible.

尚、GC待ちページテーブル6は第1図のGC待ち集合
を示すテーブルで、各GC待ちページにはページ名、記
憶場所(rは実記憶、■は仮想記憶を示す)、世代番号
が付されている。実記憶にある/ないはこのr、vを見
れば分る。利用待ちページテーブル7についても同様の
構成である。
The GC waiting page table 6 is a table showing the GC waiting set in FIG. 1, and each GC waiting page is given a page name, a storage location (r indicates real memory, ■ indicates virtual memory), and a generation number. ing. You can tell whether it is in your real memory or not by looking at these r and v. The waiting page table 7 has a similar configuration.

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

以上述べた本発明のガーベジコレクション方式には次の
利点がある。
The garbage collection method of the present invention described above has the following advantages.

(1)G C中のベージングが抑えられる。1回のGC
起動による処理は実記憶上にある高々nページに対する
読み書きに限定されるので、GCによる処理停止時間が
有限時間である事が保障される。
(1) Basing during GC can be suppressed. 1 GC
Since the processing upon startup is limited to reading and writing to at most n pages on the real memory, it is guaranteed that the processing stop time due to GC is a finite time.

(2)世代番号にもとすくページ管理により、GCの対
象となるのは、最近あらたに領域が取られたnページと
なる。記号処理言語においては、最近使われたデータは
どガーベジ(ゴミ)になる確率が高いという性質が確認
されている。従って、本方式はゴミをたくさん含む可能
性が高い領域を選択してGCを行うことになり、領域の
回収効率(GCの起動回数にたいする領域回収量)が高
くなることが期待できる。
(2) Due to page management based on the generation number, pages that are subject to GC are n pages for which space has recently been taken. It has been confirmed that in symbolic processing languages, recently used data has a high probability of becoming garbage. Therefore, in this method, GC is performed by selecting an area that is likely to contain a large amount of dust, and it can be expected that the area recovery efficiency (the amount of area recovery relative to the number of times GC is activated) will be high.

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

第1図は本発明の原理説明図、 第2図は本発明の実施例を示すブロック図である。 FIG. 1 is a diagram explaining the principle of the present invention, FIG. 2 is a block diagram showing an embodiment of the present invention.

Claims (1)

【特許請求の範囲】[Claims] 記号処理言語を実記憶(1)と仮想記憶(2)を備える
処理システムで実行する際のガーベジコレクション方式
において、実記憶(1)上のページ相互間の参照関係を
保持する相互参照テーブル(3)と、仮想記憶(2)上
のページ内から実記憶(1)上のページ内への参照関係
を間接ポインタの形態で保持する実記憶間接ポインタテ
ーブル(4)と、仮想記憶(2)上のページ相互間の参
照関係を保持する仮想記憶間接ポインタテーブル(5)
と、ガーベジコレクション待ちページを使用順に示すG
C待ちページテーブル(6)と、所定の閾値以上に領域
が回収されているページを示す利用待ちページテーブル
(7)とを設け、GC待ちページテーブル(6)で示さ
れるGC待ちページのうち、最近使用され且つ実記憶(
1)上にある複数ページを対象とし、前記各テーブルを
参照して各ページ毎にガーベジコレクションすることを
特徴とする実時間ガーベジコレクション方式。
In a garbage collection method when a symbolic processing language is executed in a processing system having a real memory (1) and a virtual memory (2), a cross reference table (3) that maintains reference relationships between pages in the real memory (1) is used. ), a real memory indirect pointer table (4) that maintains reference relationships from pages on virtual memory (2) to pages on real memory (1) in the form of indirect pointers, and Virtual memory indirect pointer table (5) that maintains reference relationships between pages of
and G which shows the pages waiting for garbage collection in the order of usage.
A C waiting page table (6) and a waiting page table (7) indicating pages whose area has been collected in excess of a predetermined threshold are provided, and among the GC waiting pages shown in the GC waiting page table (6), Recently used and real memory (
1) A real-time garbage collection method that targets a plurality of pages above and performs garbage collection for each page by referring to each of the tables.
JP61277729A 1986-11-20 1986-11-20 Garbage collection system Pending JPS63131247A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61277729A JPS63131247A (en) 1986-11-20 1986-11-20 Garbage collection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61277729A JPS63131247A (en) 1986-11-20 1986-11-20 Garbage collection system

Publications (1)

Publication Number Publication Date
JPS63131247A true JPS63131247A (en) 1988-06-03

Family

ID=17587508

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61277729A Pending JPS63131247A (en) 1986-11-20 1986-11-20 Garbage collection system

Country Status (1)

Country Link
JP (1) JPS63131247A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0417293A1 (en) * 1988-12-14 1991-03-20 Sony Corporation Data management system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0417293A1 (en) * 1988-12-14 1991-03-20 Sony Corporation Data management system
US6067607A (en) * 1988-12-14 2000-05-23 Sony Corporation Data control system for a computer's main memory for efficiently realizing virtualization of list structure data lying across a real memory space and a virtual memory space

Similar Documents

Publication Publication Date Title
US6581142B1 (en) Computer program product and method for partial paging and eviction of microprocessor instructions in an embedded computer
US4807120A (en) Temporal garbage collector with indirection cells
US6493730B1 (en) Efficient object faulting with generational garbage collection
JP2000114379A (en) Method for designing integrated circuits and apparatus for designing integrated circuits
CN103593298A (en) Memory recovery method and device
CN108959118B (en) Data writing method and device
CN111290881A (en) Data recovery method, device, equipment and storage medium
JPS63131247A (en) Garbage collection system
JPS5987566A (en) Memory access detecting system
CN105912404B (en) A method of finding strong continune component in the large-scale graph data based on disk
JPH0444140A (en) Virtual memory control method
JP2591212B2 (en) High-speed interrupt processing device
JPH0812643B2 (en) Page save / restore device
JPH05241936A (en) Garbage collection processing system and storage device for the system
JPS60204048A (en) Virtual storing system
JPH02205947A (en) Garbage collection system
JP2518390B2 (en) System performance monitoring method
CN117331855A (en) RLinux dynamic page cache writing method, device and medium
JPS621046A (en) Page control system
JPH0325645A (en) Swapping system for virtual space
JPH04281539A (en) Data management system
JPS6364142A (en) Memory management control system
Appel Simple garbage collection and fast allocation
JPS63223845A (en) Real time garbage collection processor
JPS63149743A (en) Real time garbage collection system