JP2007213252A - Garbage collection processing program and method - Google Patents

Garbage collection processing program and method Download PDF

Info

Publication number
JP2007213252A
JP2007213252A JP2006031552A JP2006031552A JP2007213252A JP 2007213252 A JP2007213252 A JP 2007213252A JP 2006031552 A JP2006031552 A JP 2006031552A JP 2006031552 A JP2006031552 A JP 2006031552A JP 2007213252 A JP2007213252 A JP 2007213252A
Authority
JP
Japan
Prior art keywords
generation area
garbage collection
area
young
garbage
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
JP2006031552A
Other languages
Japanese (ja)
Inventor
Hirokazu Kobayashi
広和 小林
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2006031552A priority Critical patent/JP2007213252A/en
Publication of JP2007213252A publication Critical patent/JP2007213252A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To prevent system failure or system performance deterioration as much as possible by executing the garbage collection of the old generation area in exact timing for the young generation region in a memory. <P>SOLUTION: A computer 10 executing the garbage collection processing program is provided with: a garbage collection execution part 21 for executing the garbage collection of the young generations and the garbage collection of the old generations for transferring all active objects of a young generation area 42 to an old generation area 43; a predicted quantity calculation part 24 for predicting quantity ES of the active objects of the young generation area 42; a memory monitoring part 22 for measuring free space OF of the old generation area 43; and a garbage collection control part 23 for comparing the predicted active object quantity ES of the young generation area 42 with the measured free space OF of the old generation area 43, and for making a garbage collection execution part 21 execute the garbage collection of the young generation area 42 when the free space OF is large, and for making a garbage collection execution part 21 execute the garbage collection of the old generation area 43, and then execute the garbage collection of the young generation area 42 when the free space OF is small. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、メモリのヒープ領域を複数の世代別の領域に分け、各世代別の領域のゴミ集めを行うゴミ集め処理プログラム及びゴミ集め処理方法に関する。   The present invention relates to a garbage collection processing program and a garbage collection processing method for dividing a heap area of a memory into a plurality of generation areas and collecting the garbage of each generation area.

ゴミ集め処理(Garbage Collection)は、メモリ領域内で不用なオブジェクト、より正確には、システムからアクセス不可能なオブジェクトをゴミとして回収し、メモリ領域内に空き領域を確保する処理である。なお、本出願において、オブジェクトとは、構造体、レコード型、Lispのconsセルなど、メモリ上の連続領域に割り当てられるデータ構造のことである。このゴミ集め処理は、プログラムのスコープに縛られずに、動的に利用されるメモリの領域を自動管理するために実行される。動的に利用されるメモリ領域とは、メモリ領域の生存期間がプログラムの生存期間と異なるメモリ領域である。このような動的メモリは、スタック領域とヒープ領域に割り付けられる。プログラムのスコープによってメモリ領域の生存期間が決まるメモリ領域は、通常スタック領域に割り付けられる。プログラムのスコープとは関係なく生存期間が決まるメモリ領域はヒープ領域に割り付けられる。   The garbage collection process (Garbage Collection) is a process for collecting unused objects in the memory area, more precisely, objects that are inaccessible from the system as garbage, and securing a free area in the memory area. In the present application, an object is a data structure assigned to a continuous area on a memory, such as a structure, a record type, or a Lisp cons cell. This garbage collection processing is executed to automatically manage the memory area that is dynamically used without being bound by the scope of the program. A dynamically used memory area is a memory area in which the lifetime of the memory area is different from the lifetime of the program. Such dynamic memory is allocated to the stack area and the heap area. The memory area whose lifetime is determined by the program scope is normally allocated to the stack area. A memory area whose lifetime is determined regardless of the program scope is allocated to the heap area.

このヒープ領域は、多くの場合、複数の世代別の領域に分けられている。若い世代領域に対して古い世代領域は、オブジェクトが割り付けられてからの時間が相対的に長い領域である。作成されたオブジェクトは、まず、オブジェクトの割付処理により、最も若い世代領域に割り付けられる。割付処理では、若い世代領域に十分な空きがなくなると、ゴミ集め処理が呼び出される。ゴミ集め処理では、若い世代領域に属するオブジェクトのうち、システムからアクセス可能なオブジェクト、つまり生存中のオブジェクトが古い世代領域に移される。これを、一般的に、「殿堂入り」と呼ぶ。このゴミ集め処理の結果、若い世代領域には不要なオブジェクトのみが残り、若い世代領域に新たなオブジェクトが割り付けられるようになる。若い世代領域からゴミ集め処理で生き残ったオブジェクトが移されてくると、古い世代領域の空き領域が次第に少なくなる。このため、従来技術では、古い世代領域の空き領域が十分に確保できなると想定される条件を、ユーザが予め定め、このユーザが定めた条件を満たしたときに、古い世代領域のゴミ集め処理が実行される。   This heap area is often divided into a plurality of generational areas. An old generation area is an area that has a relatively long time since an object is allocated to a young generation area. The created object is first allocated to the youngest generation area by object allocation processing. In the allocation process, the garbage collection process is called when there is not enough free space in the young generation area. In the garbage collection process, among the objects belonging to the young generation area, the objects accessible from the system, that is, the surviving objects are moved to the old generation area. This is generally referred to as “inducting the Hall of Fame”. As a result of this garbage collection process, only unnecessary objects remain in the young generation area, and new objects are allocated to the young generation area. When objects that survive the garbage collection process are transferred from the young generation area, the free area of the old generation area gradually decreases. For this reason, in the prior art, when the user predetermines the conditions for which it is possible to secure a sufficient space for the old generation area, and when the conditions set by the user are satisfied, the garbage collection processing for the old generation area is performed. Executed.

以上のような世代別のゴミ集めや、ゴミ集めの基本的手法に関しては、以下の非特許文献1,2等に詳細に記載されている。   Non-patent literatures 1 and 2 below describe in detail the collection of garbage by generation and the basic method of collecting garbage.

「ゴミ集めの基礎と最近の動向」、情報処理学会会誌、Vol. 35、1994年、p.991-1032"Basics of Garbage Collection and Recent Trends", Journal of Information Processing Society of Japan, Vol. 35, 1994, p.991-1032 「Garbage Collection: Algorithms for Automatic Dynamic Memory Management」、Richard Jones, Rafael Lins、1999年、John Wiley & Sons Ltd.(ISBN 0-471-94148-4)`` Garbage Collection: Algorithms for Automatic Dynamic Memory Management '', Richard Jones, Rafael Lins, 1999, John Wiley & Sons Ltd. (ISBN 0-471-94148-4)

しかしながら、従来技術では、前述したように、ユーザが定めた条件を満たしたときに、古い世代領域のゴミ集め処理が実行されるため、以下のような問題点がある。つまり、ユーザが古い世代領域のゴミ集め処理をあまり実行しない方向にこの条件を設定した場合、実際には古い世代領域の空き領域が十分に確保されていない状態になっているにも関わらず、この条件を満たさないことがあり、若い世代領域のゴミ集めを実行しようとしても、この若い世代領域のゴミ集めを実行できず、システム障害を招く虞があるという問題点がある。また、逆に、ユーザが古い世代領域のゴミ集め処理を頻繁に実行する方向にこの条件を設定した場合、実際には古い世代領域の空き領域が十分に確保されている状態になっているにも関わらず、この条件を満たしてしまい、頻繁に古い世代領域のゴミ集めが実行され、システムの性能低下を招くという問題点がある。   However, in the prior art, as described above, the garbage collection processing of the old generation area is executed when the conditions determined by the user are satisfied, and thus there are the following problems. In other words, if this condition is set so that the user does not perform much garbage collection processing for the old generation area, the empty area of the old generation area is actually not sufficiently secured, In some cases, this condition may not be satisfied, and even if an attempt is made to collect garbage in a young generation area, the collection of garbage in the young generation area cannot be executed, which may cause a system failure. Conversely, if this condition is set so that the user frequently performs garbage collection processing for the old generation area, the old generation area is actually sufficiently reserved. Nevertheless, this condition is satisfied, and there is a problem that garbage collection in the old generation area is frequently executed, resulting in a decrease in system performance.

そこで、本発明は、以上のような従来技術の問題点に着目し、若い世代領域のゴミ集めに対して古い世代領域のゴミ集めを的確なタイミングで実行し、システム障害やシステムの性能低下をできる限り回避することができるゴミ集め処理プログラム及びゴミ集め処理方法を提供することを目的とする。   Therefore, the present invention pays attention to the problems of the conventional technology as described above, and performs collection of garbage in the old generation area at an appropriate timing with respect to collection of garbage in the young generation area, thereby reducing system failure and system performance degradation. An object of the present invention is to provide a garbage collection processing program and a garbage collection processing method that can be avoided as much as possible.

前記目的を達成するためのゴミ集め処理プログラムは、
メモリのヒープ領域を複数の世代別の領域に分け、各世代別の領域のゴミ集めを行うゴミ集め処理プログラムにおいて、
複数の世代の領域のゴミ集めを行うゴミ集め実行ステップと、
複数の世代の領域のうちの一つの世代の領域(以下、若い世代領域とする)に対するゴミ集め実行で、該若い世代領域に存在している1以上のオブジェクトのうちから生存中のオブジェクトを該若い世代領域よりも一つ古い世代の領域(以下、古い世代領域とする)へ移すオブジェクトの量を、過去のゴミ集め実績から予測する移動量予測ステップと、
前記古い世代領域の空き容量を計測する空き容量計測ステップと、
前記移動量予測ステップで予測された前記若い世代領域のオブジェクトの移動量が、前記空き容量計測ステップで計測された前記古い世代領域の空き容量より小さければ、該若い世代領域のゴミ集めを前記ゴミ集め実行ステップで実行させ、該若い世代領域のオブジェクトの移動量が該古い世代領域の空き容量以上であれば、該古い世代領域を含む領域のゴミ集めを該ゴミ集め実行ステップで実行させるゴミ集め制御ステップと、
を前記メモリを備えているコンピュータに実行させることを特徴とする。
A garbage collection processing program for achieving the above object is as follows:
In the garbage collection processing program that divides the memory heap area into multiple generation areas and collects garbage in each generation area,
Garbage collection execution step for collecting garbage from multiple generation areas,
By performing garbage collection for one generation area (hereinafter referred to as a young generation area) of a plurality of generation areas, a living object is selected from one or more objects existing in the young generation area. A movement amount prediction step for predicting the amount of an object to be moved to a generation area one older than a young generation area (hereinafter referred to as an old generation area) from past garbage collection results;
A free capacity measuring step for measuring the free capacity of the old generation area;
If the movement amount of the object in the young generation area predicted in the movement amount prediction step is smaller than the free space in the old generation area measured in the free capacity measurement step, the garbage collection in the young generation area is collected. If the movement amount of the object in the young generation area is greater than or equal to the free capacity of the old generation area, the garbage collection causes the area including the old generation area to be collected in the garbage collection execution step. Control steps;
Is executed by a computer having the memory.

ここで、前記ゴミ集め処理プログラムは、
前記若い世代領域のゴミ集め実行中に、前記空き容量計測ステップにより前記古い世代領域の空き容量が該若い世代領域のゴミ集めに十分な量でなくなったことが計測されると、前記ゴミ集め制御ステップでは、前記ゴミ集め実行ステップに対して、前記若い世代領域のゴミ集めの実行を中断又は中止させ、前記古い世代領域を含む領域のゴミ集めを実行させるものであることが好ましい。
Here, the garbage collection processing program is:
When it is measured during the collection of garbage in the young generation area that the free capacity of the old generation area is not sufficient for collecting garbage in the young generation area, the garbage collection control is performed. In the step, it is preferable that the garbage collection execution step interrupts or cancels the garbage collection of the young generation area and causes the area including the old generation area to collect garbage.

また、前記目的を達成するためのゴミ集め処理方法は、
メモリのヒープ領域を複数の世代別の領域に分け、各世代別の領域のゴミ集めを行うゴミ集め処理方法において、
複数の世代の領域のゴミ集めを行うゴミ集め実行工程と、
複数の世代の領域のうちの一つの世代の領域(以下、若い世代領域とする)に対するゴミ集め実行で、該若い世代領域に存在している1以上のオブジェクトのうちから生存中のオブジェクトを該若い世代領域よりも一つ古い世代の領域(以下、古い世代領域とする)へ移すオブジェクトの量を、過去のゴミ集め実績から予測する移動量予測工程と、
前記古い世代領域の空き容量を計測する空き容量計測工程と、
前記移動量予測工程で予測された前記若い世代領域のオブジェクトの移動量が、前記空き容量把握工程で計測された前記古い世代領域の空き容量より小さければ、該若い世代領域のゴミ集めを前記ゴミ集め実行工程で実行させ、該若い世代領域のオブジェクトの移動量が該古い世代領域の空き容量以上であれば、該古い世代領域を含む領域のゴミ集めを該ゴミ集め実行工程で実行させるゴミ集め制御工程と、
を含むことを特徴とする。
In addition, a garbage collection processing method for achieving the above-mentioned object is as follows:
In the garbage collection processing method that divides the memory heap area into multiple generation areas and collects garbage in each generation area,
Garbage collection execution process to collect trash from multiple generation areas,
By performing garbage collection for one generation area (hereinafter referred to as a young generation area) of a plurality of generation areas, a living object is selected from one or more objects existing in the young generation area. A movement amount prediction step for predicting the amount of objects to be moved to a generation area one older than the young generation area (hereinafter referred to as an old generation area) from past garbage collection results;
A free capacity measuring step of measuring the free capacity of the old generation area;
If the movement amount of the object in the young generation area predicted in the movement amount prediction step is smaller than the free space in the old generation area measured in the free space grasping step, the garbage collection in the young generation region is collected. If the amount of movement of the object in the young generation area is greater than or equal to the free capacity of the old generation area, the garbage collection causes the area including the old generation area to be collected in the garbage collection execution process. Control process;
It is characterized by including.

本発明によれば、若い世代領域に格納されている1以上のオブジェクトのうちから古い世代領域へ移すオブジェクトの量を、過去のゴミ集め実績から予測し、この移動量と古い世代領域の空き容量と比較し、その結果に応じて、古い世代領域のごみ集めを実行するので、古い世代領域のゴミ集めのタイミングが比較的的確になり、システム障害の可能性を低くすると共に、システムの性能低下を抑えることができる。   According to the present invention, the amount of objects to be moved to the old generation area from one or more objects stored in the young generation area is predicted from the past garbage collection results, and this movement amount and the free space of the old generation area Compared with the above, garbage collection of the old generation area is executed according to the result, so the timing of garbage collection of the old generation area becomes relatively accurate, reducing the possibility of system failure and reducing system performance Can be suppressed.

以下、本発明に係るゴミ集め処理の各種実施形態について、図面を用いて説明する。   Hereinafter, various embodiments of dust collection processing according to the present invention will be described with reference to the drawings.

[第一の実施形態]
第一の実施形態について、図1〜図18を用いて説明する。
[First embodiment]
A first embodiment will be described with reference to FIGS.

図1に示すように、本実施形態のゴミ集め処理プログラム32を実行するコンピュータ10は、各種処理を実行するプロセッサ11と、プロセッサ11が実行するプログラムが記憶されているプログラムメモリ30と、各種データが記憶されるデータメモリ40とを備えている。なお、図1には示していないが、このコンピュータ10は、処理結果等を表示するディスプレイ、データや指示等を入力するための入力装置、外部記憶装置、外部の通信網を介して他のコンピュータ等と通信するための通信処理装置等も備えている。   As shown in FIG. 1, the computer 10 that executes the garbage collection processing program 32 of the present embodiment includes a processor 11 that executes various processes, a program memory 30 that stores programs executed by the processor 11, and various data. Is stored in the data memory 40. Although not shown in FIG. 1, the computer 10 is a display for displaying processing results, an input device for inputting data and instructions, an external storage device, and another computer via an external communication network. And a communication processing device for communicating with the device.

この実施形態のコンピュータ10は、Java言語(Javaは米国Sun Microsystems, Inc.及びその他の国における商標または登録商標)で記述されたプログラムを実行する。このため、コンピュータ10は、内部に、このJava言語で記述されたプログラムを実行するために仮想マシン12を形成する。この仮想マシン12をコンピュータ10内に形成するための仮想マシンプログラム31は、プログラムメモリ30内に格納されている。仮想マシンプログラム31には、ゴミ集め処理(Garbage Collection)プログラム32が含まれている。また、このプログラムメモリ30内には、仮想マシン12で実行する実行プログラム33が格納されている。この実行プログラム33は、Java言語から中間言語に変換した状態で、プログラムメモリ33に格納されている。   The computer 10 of this embodiment executes a program described in a Java language (Java is a trademark or registered trademark in the US Sun Microsystems, Inc. and other countries). For this reason, the computer 10 forms a virtual machine 12 in order to execute a program written in the Java language. A virtual machine program 31 for forming the virtual machine 12 in the computer 10 is stored in the program memory 30. The virtual machine program 31 includes a garbage collection process (Garbage Collection) program 32. The program memory 30 also stores an execution program 33 that is executed by the virtual machine 12. The execution program 33 is stored in the program memory 33 in a state converted from the Java language to an intermediate language.

データメモリ40のヒープ領域41は、若い世代領域42と古い世代領域43とに分けられている。   The heap area 41 of the data memory 40 is divided into a young generation area 42 and an old generation area 43.

プロセッサ11は、前述したように、仮想マシンプログラム31を実行することで仮想マシン12を形成する。この仮想マシン12は、機能的に、実行プログラム33を解読する命令解読部13と、命令解読部13で解読された命令を実行する命令実行部14と、命令実行部14での命令実行過程でオブジェクトを記憶する必要性が生じたときにデータメモリ40に対する記憶割当を管理・実行する記憶割当部15と、データメモリ40内の不要なオブジェクトを回収するゴミ集め処理部20とを有している。このゴミ集め処理部20の機能は、前述のゴミ集め処理プログラム32の実行で実現する。   As described above, the processor 11 forms the virtual machine 12 by executing the virtual machine program 31. The virtual machine 12 functionally includes an instruction decoding unit 13 that decodes the execution program 33, an instruction execution unit 14 that executes an instruction decoded by the instruction decoding unit 13, and an instruction execution process in the instruction execution unit 14. It has a storage allocation unit 15 that manages and executes storage allocation to the data memory 40 when it becomes necessary to store objects, and a garbage collection processing unit 20 that collects unnecessary objects in the data memory 40. . The function of the dust collection processing unit 20 is realized by executing the dust collection processing program 32 described above.

ゴミ集め処理部20は、データメモリ40の若い世代領域42及び古い世代領域43のぞれぞれのゴミ集めを実行するゴミ集め実行部21と、各領域42,43の使用量及び空き容量を計測するメモリ監視部22と、メモリ監視部22での計測結果等に基づいて若い世代領域42のオブジェクト生存量ESを予測する予測生存量算出部24と、これらの各部21,22,24を制御するゴミ集め制御部23とを有している。予測生存量算出部24は、ゴミ集め前のオブジェクトの領域使用量YUに対するゴミ集め後のオブジェクトの生存量Sの割合である生存率SR(=S/YU)を計測し、過去の生存率SRの実績から現在の生存率ESRを予測する生存率予測部25と、予測された若い世代領域42の現在の生存率ESRと現在の若い世代領域42の使用量YUとから、若い世代領域42のオブジェクトの生存量ES(=YU・ESR)を予測する生存量予測部26とを有する。   The garbage collection processing unit 20 is configured to collect the garbage collection execution unit 21 that collects each of the young generation area 42 and the old generation area 43 of the data memory 40, and the usage amount and free space of each area 42, 43. The memory monitoring unit 22 to measure, the predicted survival amount calculation unit 24 that predicts the object survival amount ES of the young generation area 42 based on the measurement result in the memory monitoring unit 22, and the respective units 21, 22, and 24 are controlled. And a dust collection control unit 23. The predicted survival amount calculation unit 24 measures a survival rate SR (= S / YU) which is a ratio of the survival amount S of the object after collecting the dust to the area usage amount YU of the object before collecting the dust, and the past survival rate SR. The survival rate prediction unit 25 that predicts the current survival rate ESR from the actual results, the current survival rate ESR of the predicted young generation region 42, and the current usage amount YU of the young generation region 42, A survival amount predicting unit 26 that predicts the survival amount ES (= YU · ESR) of the object.

記憶割当部15は、命令実行部14からオブジェクトのメモリ割当命令を受けると、若い世代領域42に格納領域を確保し、この格納領域の先頭アドレスを命令実行部14に返す。記憶割当部15は、仮に、若い世代領域42に十分な格納領域を確保できないと認識した場合、ゴミ集め処理部20に対してゴミ集め実行命令を出力し、データメモリ40内のゴミ集めを実行させる。ゴミ集め処理部20は、データメモリ40内のゴミ集めが終了すると、ゴミ集め終了の旨を記憶割当部15に返す。すると、この記憶割当部15は、ゴミ集め後の若い世代領域42にオブジェクトの格納領域を確保し、この格納領域の先頭アドレスを命令実行部14に返す。記憶割当部15は、ゴミ集め後であっても、若い世代領域42に十分な格納領域を確保できないと認識した場合、メモリ不足の旨をディスプレイ等に出力させる。   When the memory allocation unit 15 receives an object memory allocation command from the instruction execution unit 14, the storage allocation unit 15 secures a storage area in the young generation area 42 and returns the top address of this storage area to the instruction execution unit 14. If the storage allocation unit 15 recognizes that a sufficient storage area cannot be secured in the young generation area 42, the storage allocation unit 15 outputs a garbage collection execution command to the garbage collection processing unit 20 and executes the garbage collection in the data memory 40. Let When the collection of garbage in the data memory 40 is completed, the garbage collection processing unit 20 returns to the storage allocation unit 15 that the collection of garbage has been completed. Then, the storage allocation unit 15 secures an object storage area in the young generation area 42 after collecting the garbage, and returns the head address of the storage area to the instruction execution unit 14. If the storage allocation unit 15 recognizes that a sufficient storage area cannot be secured in the young generation area 42 even after collecting trash, the storage allocation unit 15 outputs a memory shortage message to a display or the like.

次に、ゴミ集め処理部20の動作内容、言い換えると、ゴミ集め処理プログラム32の実行による処理内容について、図3に示すフローチャートに従って説明する。   Next, the operation content of the dust collection processing unit 20, in other words, the processing content by the execution of the dust collection processing program 32 will be described with reference to the flowchart shown in FIG.

ゴミ集め処理部20のゴミ集め制御部23は、前述の記憶割当部15からゴミ集め実行命令を受けると、生存率予測部25が生存量予測部26に、若い世代領域42の予測生存率をESRとして渡す(S1)。この際、ゴミ集め実行命令の受信が例えば5回目以降である場合には、生存率予測部25は、ここで予測した予測生存率をESRとして生存量予測部26に渡し、ゴミ集め実行命令の受信が例えば5回目未満である場合には、生存率予測部25は、予め設定された予測生存率をESRとして生存量予測部26に渡す。   When the garbage collection control unit 23 of the garbage collection processing unit 20 receives the garbage collection execution command from the storage allocation unit 15, the survival rate prediction unit 25 sends the estimated survival rate of the young generation area 42 to the survival amount prediction unit 26. It is passed as ESR (S1). At this time, if the garbage collection execution command is received for the fifth time or later, for example, the survival rate prediction unit 25 passes the predicted survival rate predicted here as the ESR to the survival amount prediction unit 26, and receives the garbage collection execution command. For example, when the reception is less than the fifth time, the survival rate prediction unit 25 passes the preset prediction survival rate to the survival amount prediction unit 26 as ESR.

続いて、メモリ監視部22が若い世代領域42の使用量YU及び古い世代領域43の空き量OFを計測し、若い世代領域42の使用量YUを生存率予測部25及び生存量予測部26に渡すと共に、古い世代領域43の空き量OFをゴミ集め制御部23に渡す(S2)。   Subsequently, the memory monitoring unit 22 measures the usage amount YU of the young generation area 42 and the free amount OF of the old generation area 43, and uses the usage amount YU of the young generation area 42 to the survival rate prediction unit 25 and the survival amount prediction unit 26. At the same time, the empty amount OF in the old generation area 43 is transferred to the dust collection control unit 23 (S2).

生存量予測部26は、若い世代領域42の使用量YUを受け取ると、この使用量YUと先に受け取った若い世代領域42の予測生存率ESRとから、若い世代領域42の予測生存量ES(=YU×ESR)を求め、この予測生存量ESをゴミ集め制御部23に渡す(S3)。   When the survival amount prediction unit 26 receives the usage amount YU of the young generation region 42, the survival amount prediction unit 26 uses the usage amount YU and the predicted survival rate ESR of the young generation region 42 previously received to predict the predicted survival amount ES ( = YU × ESR), and the predicted survival amount ES is transferred to the dust collection control unit 23 (S3).

ゴミ集め制御部23は、若い世代領域42の予測生存量ESを受け取ると、先に受け取った古い世代領域43の空き量OFと若い世代領域42の予測生存量ESとの大小関係を比較し(S4)、古い世代領域43の空き量OFに対して若い世代領域42の予測生存量ESが大きければ、ゴミ集め実行部21に古い世代領域43のゴミ集めを実行させた後(S5)、若い世代領域42のゴミ集めを実行させる(S6)。一方、古い世代領域43の空き量OFに対して若い世代領域42の予測生存量ESが大きくなければ、ゴミ集め実行部21に若い世代領域42のゴミ集めを開始させる(S7)。   When the garbage collection control unit 23 receives the predicted survival amount ES of the young generation region 42, the garbage collection control unit 23 compares the magnitude relationship between the previously received free amount OF of the old generation region 43 and the predicted survival amount ES of the young generation region 42 ( S4) If the predicted survival amount ES of the young generation area 42 is larger than the free capacity OF of the old generation area 43, the garbage collection execution unit 21 collects garbage of the old generation area 43 (S5) Garbage collection in the generation area 42 is executed (S6). On the other hand, if the predicted survival amount ES of the young generation area 42 is not larger than the free capacity OF of the old generation area 43, the garbage collection execution unit 21 starts collecting the garbage of the young generation area 42 (S7).

ここで、図16を用いて、古い世代領域43の空き量OFと若い世代領域42の予測生存量ESとの大小関係の比較理由、及びこの比較結果でゴミ集めの実行対象領域が異なる理由について説明する。   Here, with reference to FIG. 16, the reason for comparing the size relationship between the free space OF in the old generation area 43 and the predicted survival amount ES in the young generation area 42, and the reason why the garbage collection execution target area differs depending on the comparison result. explain.

記憶割当部15からゴミ集め実行命令を受けて行うゴミ集めは、基本的に若い世代領域42に属するオブジェクトのうち、システムから到達可能なオブジェクト、つまり生存中のオブジェクトを古い世代領域43に移し、若い世代領域42中にシステムが必要とするオブジェクトを残さないようにすることである。このため、若い世代領域42の使用量YUと予測生存率ESRとから、予測生存量ESを求め、この予測生存量ES分のオブジェクトを古い世代領域43の空き領域に移せるか否かを把握するために、古い世代領域43の空き量OFと若い世代領域42の予測生存量ESとの大小関係を比較する。   Garbage collection performed in response to a garbage collection execution command from the storage allocation unit 15 basically moves objects that are reachable from the system among objects belonging to the young generation area 42, that is, live objects to the old generation area 43, The object is to not leave an object required by the system in the young generation area 42. For this reason, a predicted survival amount ES is obtained from the usage amount YU and the predicted survival rate ESR of the young generation area 42, and it is grasped whether or not objects corresponding to the predicted survival amount ES can be moved to a free area of the old generation area 43. Therefore, the magnitude relationship between the free space OF of the old generation area 43 and the predicted survival amount ES of the young generation area 42 is compared.

古い世代領域43の空き量OFに対して若い世代領域42の予測生存量ESが大きければ、若い世代領域42の予測生存量ES分のオブジェクトを古い世代領域43の空き領域に移せないので、まず、古い世代領域43のゴミ集めを実行させ(S5)、その後、若い世代領域42のゴミ集めを実行させる(S6)。一方、古い世代領域43の空き量OFに対して若い世代領域42の予測生存量ESが大きくなければ、若い世代領域42の予測生存量ES分のオブジェクトを古い世代領域43の空き領域に移せるので、若い世代領域42のゴミ集めを開始させる(S7)。   If the predicted survival amount ES of the young generation region 42 is larger than the free amount OF of the old generation region 43, the objects corresponding to the predicted survival amount ES of the young generation region 42 cannot be moved to the free region of the old generation region 43. Then, the garbage collection of the old generation area 43 is executed (S5), and then the garbage collection of the young generation area 42 is executed (S6). On the other hand, if the predicted survival amount ES of the young generation area 42 is not large relative to the free capacity OF of the old generation area 43, the objects corresponding to the predicted survival amount ES of the young generation area 42 can be moved to the free area of the old generation area 43. Then, garbage collection in the young generation area 42 is started (S7).

若い世代領域42のゴミ集めが開始されると、若い世代領域42から古い世代領域43にオブジェクトが移動してくる、つまり、若い世代のオブジェクトが古い世代領域43に殿堂入りする。このため、メモリ監視部22は、若い世代領域42のゴミ集め実行中、古い世代領域43の空き量が十分に確保されているか否かを確認する(S8)。メモリ監視部22は、古い世代領域43の空き量が十分に確保されなくなったことを検知すると、ゴミ集め制御部23は、ゴミ集め実行部21に若い世代領域42のゴミ集めを一時中断させ(S9)、古い世代領域43のゴミ集めを実行させる(S10)。そして、この古い世代領域43のゴミ集めが終了すると、若い世代領域42のゴミ集めを再開させる(S11)。   When the collection of garbage in the young generation area 42 is started, the object moves from the young generation area 42 to the old generation area 43, that is, the young generation object enters the old generation area 43. Therefore, the memory monitoring unit 22 confirms whether or not the free space of the old generation area 43 is sufficiently secured during the collection of garbage in the young generation area 42 (S8). When the memory monitoring unit 22 detects that the free space in the old generation area 43 is not sufficiently secured, the garbage collection control unit 23 causes the garbage collection execution unit 21 to temporarily suspend collection of garbage in the young generation area 42 ( S9) The garbage collection of the old generation area 43 is executed (S10). When the collection of garbage in the old generation area 43 is completed, the collection of garbage in the young generation area 42 is resumed (S11).

若い世代領域42のゴミ集めが終了すると(S6,S11,S12)、ゴミ集め実行部21は、若い世代領域42から古い世代領域43へ実際に移したオブジェクトの量、つまり若い世代領域42のオブジェクトの生存量をSとして、生存率予測部25に渡す(S13)。   When the collection of garbage in the young generation area 42 is completed (S6, S11, S12), the garbage collection execution unit 21 determines the amount of objects actually transferred from the young generation area 42 to the old generation area 43, that is, the objects in the young generation area 42. The survival amount of S is passed to the survival rate prediction unit 25 (S13).

生存率予測部25は、この生存量Sを受け取ると、先のステップ2でメモリ監視部22から受け取ったゴミ集め前の若い世代領域42の使用量YUとこの生存量Sとから、ゴミ集め直前における若い世代領域42のオブジェクト生存率SR(=S/YU)を求め、これを記憶しておく(S14)。そして、今回求めたオブジェクト生存率SRと、過去4回のゴミ集めで求めたオブジェクト生存率SRとを統計処理して、次回のゴミ集め直前の若い世代領域42の生存率ESRを予測する(S15)。この予測生存率ESRは、次回のゴミ集め処理のステップ1で用いられる。   When the survival rate predicting unit 25 receives the survival amount S, the survival rate predicting unit 25 immediately before collecting the garbage from the usage amount YU of the young generation area 42 before the garbage collection received from the memory monitoring unit 22 in step 2 and the survival amount S. The object survival rate SR (= S / YU) of the young generation area 42 is obtained and stored (S14). The object survival rate SR obtained this time and the object survival rate SR obtained in the past four times of garbage collection are statistically processed to predict the survival rate ESR of the young generation area 42 immediately before the next dust collection (S15). ). This predicted survival rate ESR is used in Step 1 of the next dust collection process.

過去の生存率SRから予測生存率ESRを求める方法としては、過去5回分の生存率SRの平均値を予測生存率とする方法や、過去5回分の生存率SRのうちの最大のものを予測生存率とする方法や、過去5回分の生存率の分布を正規分布とみなし、その80%に相当する生存率を予測生存率とする方法等、各種方法が考えられる。なお、ここでは、合計で過去5回分の生存率から予測生存率を求めているが、例えば、過去1回分、つまり直前に行ったゴミ集めで取得した生存率に重み付けをして、これを予測生存率としてもよいし、また、2回〜4回分、さらには6回分以上の生存率から予測生存率を求めるようにしてもよい。   As a method for obtaining the predicted survival rate ESR from the past survival rate SR, a method of setting the average value of the survival rates SR for the past five times as a predicted survival rate, or the maximum of the survival rates SR for the past five times is predicted. Various methods such as a method of setting the survival rate, a method of regarding the distribution of the survival rate for the past five times as a normal distribution, and setting the survival rate corresponding to 80% as the predicted survival rate are conceivable. Here, the predicted survival rate is calculated from the survival rate for the past 5 times in total, but for example, the survival rate for the past 1 time, that is, the survival rate obtained by the garbage collection performed immediately before is weighted and predicted. It is good also as a survival rate, and you may make it obtain | require an estimated survival rate from the survival rate for 2 times-4 times, and also 6 times or more.

また、ここでは、説明の簡単のため、データメモリ40のヒープ領域41を若い世代領域42と古い世代領域43との二つに分けたが、さらに古い世代領域を設定し、つまり、ヒープ領域41を3以上に分けてもよい。仮に、ヒープ領域41を3つに分け、若い順に、第一世代領域、第二世代領域、第三世代領域とした場合、ゴミ集め処理部20は、記憶割当部15からゴミ集め実行命令を受けると、まず、第一世代領域の予測生存量を求め(S3)、この予測生存量と第二世代領域の空き量との大小関係を比較(S4)して、この比較結果に応じて第一世代領域か第二世代領域のゴミ集め(S8orS5)を行う。第二世代領域のゴミ集めを行うことになった場合には、第二世代領域の予測生存量を求め(S3)、この予測生存量と第三世代領域の空き量との大小関係を比較(S4)して、この比較結果に応じて第二世代領域か第三世代領域のゴミ集め(S8orS5)を行うことになる。   Further, here, for simplicity of explanation, the heap area 41 of the data memory 40 is divided into two, a young generation area 42 and an old generation area 43, but an older generation area is set, that is, the heap area 41 May be divided into three or more. If the heap area 41 is divided into three, and the first generation area, the second generation area, and the third generation area are set in ascending order, the garbage collection processing unit 20 receives a garbage collection execution command from the storage allocation unit 15. First, the predicted survival amount of the first generation area is obtained (S3), the magnitude relationship between the predicted survival amount and the free space of the second generation area is compared (S4), and the first Garbage collection (S8 or S5) of the generation area or the second generation area is performed. When garbage collection of the second generation area is to be performed, the predicted survival amount of the second generation area is obtained (S3), and the magnitude relationship between the predicted survival amount and the free space of the third generation area is compared ( In step S4, garbage collection (S8 or S5) in the second generation area or the third generation area is performed according to the comparison result.

次に、オブジェクトのデータ構成について、図2を用いて説明する。   Next, the data structure of the object will be described with reference to FIG.

オブジェクトは、ヘッダ50とペイロード55とを有する。ヘッダ50は、オブジェクトを処理系のシステムが管理するために必要なデータを格納する部分で、基本的にユーザプログラムから直接操作することはできない。それに対して、ペイロード55は、ユーザプログラムが処理の実行に利用するためのデータを保存し、ユーザプログラムから直接操作できる。ヘッダ50には、ルートから当該オブジェクトに到達可能であるか否かを示すマークが格納される到達可能性フィールド51と、当該オブジェクトがコピー処理により実体移動が済んでいるか否かのマークが格納される移動済みフィールド52と、当該オブジェクトの移動先のアドレスが格納される移動先フィールド53と、当該オブジェクトのサイズが格納されるサイズフィールド54とがある。到達可能性フィールド51にマークが格納されているオブジェクトは、前述したように、ルートから到達可能なオブジェクトであり、ゴミ集めによって古い世代領域にコピーされるオブジェクトであるから、マークフェーズの終了後に到達可能性フィールド51にマークが付されていないオブジェクトはゴミである。到達可能性フィールド51に付されたマークは、ゴミ集め終了後に全て消去される。   The object has a header 50 and a payload 55. The header 50 is a part for storing data necessary for the processing system to manage the object, and basically cannot be directly operated from the user program. On the other hand, the payload 55 stores data used by the user program for execution of processing, and can be directly operated from the user program. The header 50 stores a reachability field 51 for storing a mark indicating whether or not the object can be reached from the root, and a mark for determining whether or not the object has been moved by copying. A moved field 52, a destination field 53 in which the destination address of the object is stored, and a size field 54 in which the size of the object is stored. As described above, the object in which the mark is stored in the reachability field 51 is an object that can be reached from the root, and is an object that is copied to the old generation area by garbage collection. Objects that are not marked in the possibility field 51 are garbage. All marks attached to the reachability field 51 are erased after the collection of garbage.

到達可能性フィールド51、移動済みフィールド52、移動先フィールド53等がヘッダ50のどの部分にとられるかはシステムによる。これらのフィールドは、ゴミ集め実行中以外には利用しないので、通常使用時にのみ必要となる他のフィールドと兼用することも多い。例えば、移動先フィールド53として32bit分の領域が確保されている場合、この移動先フィールド53の下位2bitは常に0となるので、下位2bitの部分に到達可能性フィールドや移動済みフィールドを配置し、移動先を取得するときは下位2bitを0に戻して取得し、移動先を書き込むときは下位2bitの値はそのまま残して書き込むという方法を用いることもある。   It depends on the system which part of the header 50 the reachability field 51, the moved field 52, the destination field 53, etc. are taken. Since these fields are not used except during garbage collection, they are often used in combination with other fields that are required only during normal use. For example, when an area for 32 bits is secured as the movement destination field 53, the lower 2 bits of the movement destination field 53 are always 0, so the reachability field and the moved field are arranged in the lower 2 bits, When acquiring the destination, the lower 2 bits may be returned to 0 and acquired, and when the destination is written, the lower 2 bits may be left as they are.

ペイロード55には、ポインタフィールド56,57,59とデータフィールド58とがある。ポインタフィールド56,57,59には、当該オブジェクトと参照関係にある他のオブジェクトの先頭アドレスが格納される。ゴミ集めのときは、このポインタフィールド58に格納されているアドレスのオブジェクトをたどることになる。データフィールド58には、整数や、動小数点数などのポインタ以外の値が格納される。   The payload 55 includes pointer fields 56, 57 and 59 and a data field 58. The pointer fields 56, 57, and 59 store the start addresses of other objects that have a reference relationship with the object. When collecting garbage, the object at the address stored in the pointer field 58 is traced. The data field 58 stores values other than pointers, such as integers and moving decimal numbers.

ここで、以下の説明の都合上、ポインタpがオブジェクトを指示する変数のとき、「オブジェクトP」は、「ポインタpの示すオブジェクト」である。また、Xをオブジェクトのフィールドとすると、「PのX」は「オブジェクトPのフィールドX」を意味する。ポインタフィールドXに書き込まれている値のことを「Xの値」と呼ぶ。   Here, for convenience of the following explanation, when the pointer p is a variable indicating an object, the “object P” is “an object indicated by the pointer p”. Further, if X is a field of an object, “X of P” means “field X of object P”. The value written in the pointer field X is called “X value”.

次に、若い世代領域42のゴミ集め処理(S6,7)の処理内容について説明する。   Next, the contents of the dust collection process (S6, 7) in the young generation area 42 will be described.

ゴミ集め処理の基本的方式としては、「背景技術」の欄で示した非特許文献1,2に記載されているように、マークスイープ方式、コピー方式、マークコンパクト方式等があるが、ここでは、コピー方式を採用する。なお、若い世代領域42のゴミ集めの方式に、コピー方式以外の方式を採用してもよいことは言うまでもない。   As a basic method of garbage collection processing, there are a mark sweep method, a copy method, a mark compact method, etc. as described in Non-Patent Documents 1 and 2 shown in the “Background Technology” column. Adopt a copy method. Needless to say, a method other than the copy method may be adopted as a method for collecting dust in the young generation area 42.

若い世代のゴミ集め処理(S6,7)では、図4のフローチャートに示すように、ゴミ集め実行部21が、まず、初期化処理(S100)を行う。この初期化処理では、図17(a)に示すように、大域変数のscan及びfreeを古い世代の空き領域OFの先頭アドレスとする。若い世代領域42をコピー方式でゴミ集めする場合、このコピー方式において、Fromに当たるものは、図16に示すように、若い世代領域42の使用中領域YOであり、Toに当たるものが古い世代領域43の空き領域OFである。つまり、若い世代領域のゴミ集めを実行することで、若い世代領域42の使用中領域YO中に生存するオブジェクトをすべて古い世代領域の空き領域OFへ移動する。この処理に必要な大域変数が上述のscanとfreeである。   In the young generation garbage collection process (S6, 7), as shown in the flowchart of FIG. 4, the garbage collection execution unit 21 first performs an initialization process (S100). In this initialization process, as shown in FIG. 17A, the global variables scan and free are used as the head addresses of the old generation free area OF. When collecting the garbage in the young generation area 42 by the copy method, in this copy system, as shown in FIG. 16, the area corresponding to “From” is the busy area YO of the young generation area 42, and the area corresponding to “To” is the old generation area 43. Free area OF. That is, by collecting garbage in the young generation area, all the objects that survive in the in-use area YO of the young generation area 42 are moved to the empty area OF in the old generation area. The global variables necessary for this processing are the above-mentioned scan and free.

ゴミ集め実行部21は、初期化処理(S100)が終了するとルート処理(S200)を行う。ルートとは、オブジェクトにアクセスするときの起点となる位置(アドレス)のことである。このルート値は、CPUのレジスタ等に記憶されている。このルート処理は、ルートが示すオブジェクトを古い世代領域43にコピー処理することである。   When the initialization process (S100) ends, the garbage collection execution unit 21 performs the route process (S200). The root is a position (address) that is a starting point when accessing an object. This route value is stored in a CPU register or the like. This route processing is to copy the object indicated by the route to the old generation area 43.

ゴミ集め実行部21は、ルート処理(S200)が終了すると、スキャン処理(S300)を行う。このスキャン処理は、前述のルート処理でコピーされたオブジェクトと参照関係にあるオブジェクトを古い世代領域43にコピー処理することである。従って、前述のルート処理とこのスキャン処理で、ルートから到達可能な全てのオブジェクト、言い換えると、全ての生存中のオブジェクトを古い世代領域43にコピーすることになる。   When the route collection (S200) ends, the dust collection execution unit 21 performs a scan process (S300). This scan processing is to copy an object that has a reference relationship with the object copied in the above-described root processing to the old generation area 43. Therefore, in the above-described route processing and this scan processing, all the objects that can be reached from the route, in other words, all the living objects are copied to the old generation area 43.

次に、図5に示すフローチャートに従って、前述のルート処理200の詳細処理について説明する。このルート処理では、すべてのルートが示す各オブジェクトに対しコピー処理を行い、その結果で各ルートの値を書き換える。ゴミ処理実行部21は、まず、未だ処理を行っていないルートがあるか調べる(S201)。この結果、未処理のルートがあった場合、未処理のルートを一つ取り出し、その値をRとし(S202)、このRを引数としてコピー処理を呼び出す(S203)。続いて、このコピー処理の戻り値にRを書き換える。その後、再び、ステップ201の判断処理に戻り、未処理のルートが無かった場合、ルート処理を終了する。   Next, detailed processing of the route processing 200 will be described with reference to the flowchart shown in FIG. In this route processing, copy processing is performed on each object indicated by all routes, and the value of each route is rewritten with the result. The dust processing execution unit 21 first checks whether there is a route that has not yet been processed (S201). As a result, when there is an unprocessed route, one unprocessed route is taken out, the value is set as R (S202), and the copy process is called with this R as an argument (S203). Subsequently, R is rewritten to the return value of this copy process. Thereafter, the process returns to the determination process in step 201 again. If there is no unprocessed route, the route process is terminated.

次に、先のルート処理200のステップ203で呼び出されるコピー処理(S400)について、図6のフローチャートに従って説明する。   Next, the copy process (S400) called in step 203 of the previous route process 200 will be described with reference to the flowchart of FIG.

ゴミ集め実行部21は、まず、コピー処理の引数Rとして受け取った値を変数Pに代入する(S401)。そして、このPを先頭アドレスとするオブジェクトの移動済みフィールド52にマークが付されているか、つまり既にコピー処理が終了して当該オブジェクトが移動してしまったかを調べる(S402)。   The garbage collection execution unit 21 first substitutes the value received as the argument R of the copy process into the variable P (S401). Then, it is checked whether or not the moved field 52 of the object having P as the start address is marked, that is, whether the object has been moved after the copy process has been completed (S402).

Pを先頭アドレスとするオブジェクトの移動済みフィールド52にマークが付されている場合には、Pを先頭アドレスとするオブジェクトの移動先フィールド53に格納されている値をコピー処理の戻り値として返して(S408)、コピー処理を終了する。   If the moved field 52 of the object having P as the head address is marked, the value stored in the destination field 53 of the object having P as the head address is returned as the return value of the copy process. (S408), the copy process is terminated.

また、Pを先頭アドレスとするオブジェクトの移動済みフィールド52にマークが付されていない場合、変数addrに、初期化処理(S100)で設定したfreeの値を代入し(S403)、Pを先頭アドレスとするオブジェクトをfreeが指すアドレスを先頭とする領域にコピーする(S404)。次に、freeの値をコピーしたオブジェクトのサイズ分だけ大きくする(S405)。この結果、freeは古い世代領域の未使用領域の先頭アドレスを指すようになる。つまり、freeはコピー処理により移動したオブジェクトの後尾アドレスを示す変数である。続いて、コピー元のオブジェクトの移動済みフィールド52にマークをつけると共に、このコピー元のオブジェクトの移動先フィールド53にaddrの値を書き込む。(S406)。そして、addrの値をコピー処理の戻り値として返し(S407)、コピー処理を終了する。   If the moved field 52 of the object having P as the head address is not marked, the free value set in the initialization process (S100) is substituted into the variable addr (S403), and P is the head address. Is copied to an area starting from the address pointed to by free (S404). Next, the free value is increased by the size of the copied object (S405). As a result, free points to the start address of the unused area of the old generation area. That is, free is a variable indicating the tail address of the object moved by the copy process. Subsequently, the moved field 52 of the copy source object is marked, and the value of addr is written in the destination field 53 of the copy source object. (S406). Then, the value of addr is returned as the return value of the copy process (S407), and the copy process is terminated.

例えば、図17(a)に示すように、ヒープ領域の若い世代領域42にオブジェクトa,b,cが格納され、古い世代領域43にオブジェクトd,e,fが格納されており、ルートフィールド61,62に「1」「4」が格納されているとする。また、各オブジェクトa,b,〜,fの先頭アドレス、及び古い世代領域43の空き領域の先頭アドレスをそれぞれ、1,2,3,4,5,6,7とする。そして、若い世代領域42のゴミ集め処理の初期化処理(S100)で、古い世代領域43の空き領域の先頭アドレス「7」にscan及びfreeが設定されているとする。なお、ここでは、便宜上、ポインタフィールド56が一つしかないが、図2を用いて説明したように、複数のポインタフィールドがあってもよい。また、ここでは、以下の説明を簡単にするために、オブジェクトのサイズを全て同一にしているが、各オブジェクト毎にサイズが異なっていてもよい。   For example, as shown in FIG. 17A, objects a, b, and c are stored in the young generation area 42 of the heap area, and objects d, e, and f are stored in the old generation area 43, and the root field 61 , 62 stores “1” and “4”. Also, the start addresses of the objects a, b,..., And f and the start addresses of the empty areas of the old generation area 43 are 1, 2, 3, 4, 5, 6, and 7, respectively. Then, it is assumed that scan and free are set in the start address “7” of the empty area of the old generation area 43 in the initialization process (S100) of the dust collection process of the young generation area 42. Here, for convenience, there is only one pointer field 56, but there may be a plurality of pointer fields as described with reference to FIG. Here, in order to simplify the following description, the object sizes are all the same, but the size may be different for each object.

前述のルート処理200のステップ202で、ルートフィールド61,62からルート「1」が抽出され、これが引数Rになり、この引数R(=1)でコピー処理が呼び出された場合、コピー処理400のステップ401では引数R(=1)が変数Pに代入され、ステップ402ではこの変数P(=1)を先頭アドレスとするオブジェクトaの移動済みフィールド52にマークが付されているか否かが調べられる。この場合、オブジェクトaの移動済みフィールド52にマークが付されていないので、ステップ403に進んで、変数addrにfreeの値(=7)を代入され(S403)、図17(b)に示すように、P(=1)を先頭アドレスとするオブジェクトaをfreeが指すアドレス「7」を先頭とする領域にコピーされる(S404)。次に、freeの値がコピーしたオブジェクトのサイズ分だけ大きくされる(S405)。そして、コピー元のオブジェクトaの移動済みフィールド52にマークを付けられると共に、このコピー元のオブジェクトaの移動先フィールド53にaddr(=7)の値が書き込まれ、さらに、ルートフィールド61のルート値「1」がオブジェクトaのコピー先のアドレスである「7」に書き換えられる(S406)。そして、addr(=7)の値がコピー処理の戻り値として返されて(S407)、コピー処理が終了する。   When the route “1” is extracted from the route fields 61 and 62 in step 202 of the route processing 200 described above and becomes the argument R, and the copy processing is called with the argument R (= 1), the copy processing 400 In step 401, the argument R (= 1) is assigned to the variable P. In step 402, it is checked whether or not the moved field 52 of the object a having the variable P (= 1) as the start address is marked. . In this case, since the moved field 52 of the object a is not marked, the process proceeds to step 403, and the free value (= 7) is substituted for the variable addr (S403), as shown in FIG. Then, the object a having P (= 1) as the head address is copied to the area starting with the address “7” pointed to by free (S404). Next, the value of free is increased by the size of the copied object (S405). Then, the moved field 52 of the copy source object a is marked, the value of addr (= 7) is written to the movement destination field 53 of the copy source object a, and the route value of the route field 61 is further written. “1” is rewritten to “7” which is the address of the copy destination of the object a (S406). Then, the value of addr (= 7) is returned as the return value of the copy process (S407), and the copy process ends.

次に、図7に示すフローチャートに従って、スキャン処理(S300)の詳細処理について説明する。   Next, detailed processing of the scan processing (S300) will be described according to the flowchart shown in FIG.

このスキャン処理(S300)では、全てのコピー先オブジェクトのポインタフィールドに格納されているポインタに対し、図6を用いて前述したコピー処理(S400)が順に実行され、コピー処理の戻り値でポインタ値が更新される。具体的には、ゴミ集め実行部21は、まず、scanの示すアドレスがfreeの示すアドレス値より小さいかを調べる(S301)。小さい場合は、scanの指すアドレスを先頭アドレスとするオブジェクト内にまだ処理の行われていないポインタフィールドが存在するかを調べる(S302)。未処理のポインタフィールドが見つかった場合、この未処理のポインタフィールドの値pを一つ取り出し(S303)、このpの値を引数として、図6に示すコピー処理(S400)を呼び出す(S304)。つまり、このスキャン処理(300)でのコピー処理(S400)では、ルート処理(S200)で古い世代領域にコピーされたオブジェクトのポインタフィールドを調べ、このポインタフィールドに格納されたポインタ値を先頭アドレスとするオブジェクトをfreeの示すアドレスのところにコピー処理する。コピー処理が終了すると、このコピー処理の戻り値をpの値として書き込む(S305)。そして、ステップ302の判断処理に戻る。   In this scan process (S300), the copy process (S400) described above with reference to FIG. 6 is sequentially executed on the pointers stored in the pointer fields of all copy destination objects, and the pointer value is the return value of the copy process. Is updated. Specifically, the dust collection execution unit 21 first checks whether the address indicated by scan is smaller than the address value indicated by free (S301). If it is smaller, it is checked whether there is a pointer field that has not yet been processed in the object having the start address as the address pointed to by scan (S302). When an unprocessed pointer field is found, one value p of this unprocessed pointer field is extracted (S303), and the copy process (S400) shown in FIG. 6 is called using this p value as an argument (S304). That is, in the copy process (S400) in the scan process (300), the pointer field of the object copied to the old generation area in the root process (S200) is examined, and the pointer value stored in this pointer field is used as the start address. The object to be copied is copied to the address indicated by free. When the copy process ends, the return value of this copy process is written as the value of p (S305). Then, the process returns to the determination process in step 302.

このステップ302で、未処理のポインタフィールドがないと判断した場合、scanの値にscanの指すオブジェクトのサイズを加えた値を、scanの示す新たなアドレスとする。つまり、scanの指すアドレスを次のオブジェクトの先頭アドレスにする(S306)。従って、この変数scanは、スキャン処理が終了した箇所のアドレスを示す変数と言える。この処理(S306)が終了すると、再び、ステップ301に戻り、scanの示すアドレスがfreeの示すアドレス値より小さいかを調べ、scanの示すアドレスがfreeの示すアドレス値より小さくないと判断すると、スキャン処理を終了する。   If it is determined in step 302 that there is no unprocessed pointer field, a value obtained by adding the size of the object indicated by scan to the value of scan is set as a new address indicated by scan. That is, the address pointed to by scan is set to the head address of the next object (S306). Therefore, this variable scan can be said to be a variable indicating the address of the location where the scanning process is completed. When this processing (S306) is completed, the process returns to step 301 again to check whether the address indicated by scan is smaller than the address value indicated by free. If it is determined that the address indicated by scan is not smaller than the address value indicated by free, scan is performed. End the process.

前述のルート処理(S200)に続く、このスキャン処理(S300)で、若い世代のゴミ集めが終了する。   In this scan process (S300) following the above-described route process (S200), the collection of garbage of the younger generation is completed.

ここで、具体的なスキャン処理(S300)の例について、図18(g)(h)を用いて説明する。   Here, a specific example of the scanning process (S300) will be described with reference to FIGS.

図18(g)は、後に詳細に説明するが、図3のフローチャート中で、若い世代のゴミ集めを開始し(S7)、スキャン処理過程の途中で古い世代領域の空きが無くなったために(S8)、若い世代のゴミ集めを中断し(S9)、古い世代のゴミ集め(S10)が終了した段階のヒープ領域を示している。古い世代のゴミ集め(S10)が終了すると、若い世代のゴミ集めが再開される(S11)。この場合、途中で中断したスキャン処理が再開される。このスキャン処理が再開される段階で、scanの示すアドレス、freeの示すアドは、図18(g)に示すように、それぞれ、「6」「7」である。   FIG. 18 (g) will be described in detail later. In the flowchart of FIG. 3, the collection of young generation garbage is started (S7), and there is no space in the old generation area during the scanning process (S8). ), The collection of young generation garbage is interrupted (S9), and the heap area at the stage where the collection of old generation garbage (S10) is completed is shown. When the old generation garbage collection (S10) is completed, the young generation garbage collection is resumed (S11). In this case, the scanning process interrupted in the middle is resumed. At the stage when this scanning process is resumed, the address indicated by scan and the address indicated by free are “6” and “7”, respectively, as shown in FIG.

このスキャン処理(S300)では、ゴミ集め実行部21は、まず、scanの示すアドレス(=6)がfreeの示すアドレス(=7)より小さいかを調べる(S301)。この場合、scanの方が小さいので、scanの指すアドレスを先頭アドレスとするオブジェクトaにまだ処理の行われていないポインタフィールド56が存在するかを調べる(S302)。この場合、未処理のポインタフィールド56があるので、この未処理のポインタフィールド56の値(=3)を取り出し(S303)、この値を引数として、コピー処理(S400)を呼び出す(S304)。このコピー処理(S400)では、引数(=3)を先頭アドレスとするオブジェクトcがfree(=7)の位置にコピーされ(S404)、freeの示すアドレスが「8」に換えられ(S405)、移動元にあるオブジェクトcの移動済みフィールドにマークが付けられると共に、移動先フィールドに移動先のアドレスの値(=7)が書き込まれる(S406)。コピー処理(S400)が終了すると、再び、ステップ302に戻り、ここでは、scanの指すアドレスを先頭アドレスとするオブジェクトaにまだ処理の行われていないポインタフィールド56が存在しないと判断される。   In this scan process (S300), the dust collection execution unit 21 first checks whether the address (= 6) indicated by scan is smaller than the address (= 7) indicated by free (S301). In this case, since scan is smaller, it is checked whether or not there is a pointer field 56 that has not yet been processed in the object a having the start address as the address pointed to by scan (S302). In this case, since there is an unprocessed pointer field 56, the value (= 3) of this unprocessed pointer field 56 is extracted (S303), and the copy process (S400) is called using this value as an argument (S304). In this copy process (S400), the object c having the argument (= 3) as the head address is copied to the position of free (= 7) (S404), the address indicated by free is changed to “8” (S405), A mark is put on the moved field of the object c at the movement source, and the value (= 7) of the movement destination address is written in the movement destination field (S406). When the copy process (S400) ends, the process returns again to step 302, where it is determined that there is no pointer field 56 that has not yet been processed in the object a having the address pointed to by scan as the head address.

そして、scanの値が新たな値(=7)に更新され(S306)、ステップ301に戻り、ここで、scanの示すアドレス(=7)がfreeの示すアドレス(=7)より小さくないと判断され、スキャン処理が終了する。この結果、若い世代のゴミ集めが終了する。   Then, the value of scan is updated to a new value (= 7) (S306), and the process returns to step 301, where it is determined that the address (= 7) indicated by scan is not smaller than the address (= 7) indicated by free. Then, the scanning process ends. As a result, the collection of garbage for the young generation is completed.

次に、古い世代のゴミ集め処理(S5,10)について、図8に示すフローチャートに従って説明する。   Next, the old generation garbage collection processing (S5, 10) will be described with reference to the flowchart shown in FIG.

この古い世代のゴミ集めでは、「背景技術」の欄で示した非特許文献1,2に記載されているLisp2方式のアルゴリズムを用いたマークコンパクト方式を採用する。なお、古い世代のゴミ集めの方式に、マークコンパクト方式以外の方式を採用してもよいことは言うまでもない。   In this old generation garbage collection, the mark compact method using the Lisp2 algorithm described in Non-Patent Documents 1 and 2 shown in the “Background Technology” column is adopted. Needless to say, a method other than the mark compact method may be adopted as an old generation garbage collection method.

古い世代のゴミ集め処理(S5,10)では、ゴミ集め実行部21が、まず、マーク処理(S500)を行う。このマーク処理では、古い世代領域に存在するオブジェクトで、ルートから到達可能な全てのオブジェクの到達可能性フィールドにマークを付ける。このとき、若い世代領域に存在するオブジェクトのポインタもルートとみなして処理を行う。   In the old generation dust collection process (S5, 10), the dust collection execution unit 21 first performs a mark process (S500). In this mark processing, the reachability fields of all objects that are reachable from the root among the objects existing in the old generation area are marked. At this time, the processing is performed by regarding the pointer of the object existing in the young generation area as the root.

具体的なマーク処理の例について、図17(b)(c)を用いて説明する。   A specific example of the mark processing will be described with reference to FIGS.

図17(b)は、前述したように、若い世代のゴミ集めにおけるルート処理が終了した段階のヒープ領域を示している。ルート処理が終了すると、前述したように、このルート処理で移動したオブジェクトaをスキャンして、このオブジェクトaのポインタフィールドに格納されたポインタ値を先頭アドレスとするオブジェクトをfreeの示すアドレスのところにコピー処理しようとする。しかしながら、この場合、古い世代領域には空きがないため、図3に示すフローチャートにおいて、若い世代のゴミ集め中(S7)に、古い世代領域の空きがなく無くなったと判断され(S8)、この若い世代のゴミ集めが中断されて(S9)、古い世代のゴミ集めが開始される(S10)。この古い世代のゴミ集め(S10)のマーク処理(S500)では、前述したように、古い世代領域に存在するオブジェクトで、ルートから到達可能な全てのオブジェクの到達可能性フィールドにマークが付けられる。この場合、ルートフィールド61,62には、ルート値として「7」「4」が格納されているので、「7」を先頭アドレスとする移動後のオブジェクトa、「4」を先頭アドレスとするオブジェクトdのそれぞれの到達可能性フィールド51にマークが付される。さらに、マークが付されたオブジェクトaのポインタフィールド56に格納されている「3」を先頭アドレスとするオブジェクトc、マークが付されたオブジェクトdのポインタフィールド56に格納されている「6」を先頭アドレスとするオブジェクトfのそれぞれの到達可能性フィールド51にマークが付される。   FIG. 17B shows the heap area at the stage where the route processing in the young generation garbage collection has been completed, as described above. When the route processing is completed, as described above, the object a moved by the route processing is scanned, and the object having the pointer value stored in the pointer field of the object a as the head address is located at the address indicated by free. Try to copy. However, in this case, since there is no space in the old generation area, in the flowchart shown in FIG. 3, it is determined that there is no space in the old generation area (S8) during the collection of garbage of the young generation (S7). The generational garbage collection is interrupted (S9), and the old generation garbage collection is started (S10). In the mark process (S500) of the old generation garbage collection (S10), as described above, the reachability fields of all objects that can be reached from the root are marked in the objects in the old generation area. In this case, since “7” and “4” are stored as route values in the route fields 61 and 62, the moved object a having “7” as the head address, and the object having “4” as the head address Each reachability field 51 of d is marked. Further, the object “c” having “3” stored in the pointer field 56 of the marked object “a” as the head address, and “6” stored in the pointer field 56 of the marked object “d” are headed. A mark is attached to each reachability field 51 of the object f as an address.

再び、図8のフローチャートの説明に戻る。   Returning to the description of the flowchart of FIG.

ゴミ集め実行部21は、マーク処理(S500)が終了すると、古い世代領域に存在する全ての生存中のオブジェクトの移動先を決定し(S600)、メモリ内容の修正を行う(S700)。このメモリ内容修正処理は、各オブジェクトの移動に伴うオブジェクトのヘッダの内容を修正する処理である。ゴミ集め実行部21は、その後、移動先決定処理(S600)で決定した移動先に、古い世代領域に存在する生存中のオブジェクトを移動させて(S800)、古い世代のゴミ集めを終了する。なお、ステップ800でのオブジェクト移動処理での「移動」は、前述のコピー処理での移動のように移動元にオブジェクトが残る場合を含まない狭義の意味での移動である。   When the mark processing (S500) ends, the garbage collection execution unit 21 determines the destinations of all the live objects existing in the old generation area (S600), and corrects the memory contents (S700). This memory content correction process is a process for correcting the contents of the header of an object accompanying the movement of each object. Thereafter, the garbage collection execution unit 21 moves the surviving objects existing in the old generation area to the movement destination determined in the movement destination determination process (S600) (S800), and ends the old generation garbage collection. Note that “move” in the object move process in step 800 is a move in a narrow sense that does not include a case where an object remains at the move source as in the above-described copy process.

次に、図9に示すフローチャートに従って、移動先決定処理(S600)について説明する。   Next, the destination determination process (S600) will be described with reference to the flowchart shown in FIG.

この移動先決定処理(S600)では、前述したように、古い世代領域に存在する全ての生存中のオブジェクトの移動先のアドレスが決定され、さらに、当該オブジェクトの移動先フィールドに決定した移動先のアドレスが書き込まれる。具体的に、ゴミ集め実行部21は、まず、freeとPを古い世代領域の先頭アドレスを指すように設定する(S601)。Pは現在移動先決定処理の対象となっているオブジェクトを指し、freeはオブジェクトを移動する場合の移動先を指す。続いて、Pが古い世代領域の使用中領域の後尾アドレス未満であるかを調べる(S602)。Pが古い世代領域の使用中領域の後尾アドレス未満である場合、Pを先頭アドレスとするオブジェクトの到達可能性フィールドにマークが付いているか否かを調べる(S603)。マークが付いている場合は、このオブジェクトは生存していることを意味するので、このオブジェクトの移動先フィールドにfreeの値を書き込み、freeの値にこのオブジェクトのサイズの値を加え、これを新しいfreeの値とし(S604)、ステップ605に進む。一方、ステップ603の判断でマークが付いていないと判断した場合には、このオブジェクトは生存していないことを意味するので、移動対象にはならず、直ちに、ステップ605に進む。ステップ605では、Pの値に、Pの値を先頭アドレスとするオブジェクトのサイズを加えて、これを新しいPの値とする(S604)。次に、再び、ステップ602の判断処理に戻り、Pが古い世代領域の使用中領域の後尾アドレス以下でないと判断すると、移動先決定処理が終了する。なお、以上では説明していないが、次のフェーズ以降の処理を早くするために、到達可能性フィールドにマークが付いていないオブジェクトが連続する場合、それらをまとめて一つのオブジェクトとみなす処理を行うことも可能である。   In this movement destination determination process (S600), as described above, the movement destination addresses of all the living objects existing in the old generation area are determined, and further, the movement destination fields determined in the movement destination field of the object are determined. The address is written. Specifically, the garbage collection execution unit 21 first sets free and P to point to the start address of the old generation area (S601). P indicates an object that is currently the target of the movement destination determination process, and free indicates a movement destination when the object is moved. Subsequently, it is checked whether P is less than the tail address of the in-use area of the old generation area (S602). If P is less than the tail address of the used area of the old generation area, it is checked whether or not the reachability field of the object having P as the head address is marked (S603). If it is marked, it means that this object is alive, so write the free value in the destination field of this object, add the size value of this object to the free value, The value is set to free (S604), and the process proceeds to step 605. On the other hand, if it is determined in step 603 that the mark is not attached, this means that the object is not alive, so that the object is not moved and the process immediately proceeds to step 605. In step 605, the size of the object having the P value as the start address is added to the P value, and this is used as the new P value (S604). Next, returning to the determination process of step 602 again, if it is determined that P is not less than or equal to the tail address of the used area of the old generation area, the movement destination determination process ends. Although not described above, in order to speed up the processing after the next phase, when objects that are not marked in the reachability field continue, processing is performed in which they are considered as one object. It is also possible.

具体的な移動先決定処理(S600)の例について、図17(c)(d)を用いて説明する。   A specific example of the destination determination process (S600) will be described with reference to FIGS.

図17(c)は、前述したように、古い世代のゴミ集めにおけるマーク処理(S500)が終了した段階のヒープ領域を示している。このマーク処理が終了すると、移動先決定処理(S600)が開始され、freeとPが共に古い世代領域43の先頭アドレス(=4)を指すように設定される(S601)。Pが古い世代領域43の使用中領域の後尾アドレス未満であれば(S602)、P(=4)を先頭アドレスとするオブジェクトdの到達可能性フィールド51にマークが付いているか否かを調べる(S603)。この場合、オブジェクトdの到達可能性フィールド51にマークが付いているが、古い世代領域43の先頭に格納されているので、移動対象とはしない。そして、freeの値にこのオブジェクトdのサイズの値を加え、これを新しいfree(=5)の値とし(S604)、Pの値に、Pの値を先頭アドレスとするオブジェクトdのサイズを加えて、これを新しいP(=5)の値とする(S604)。つまり、free及Pがそれぞれアドレス5を指すように設定する。再び、ステップ602に戻ってからステップ603に進み、ここで、P(=5)を先頭アドレスとするオブジェクトeの到達可能性フィールド51にマークが付いているか否かを調べる。このオブジェクトeの到達可能性フィールド51にはマークが付いておらず、このオブジェクトeが生存していないことを意味するので、移動対象にはならないで、直ちに、ステップ605に進む。ステップ605では、Pの値に、Pの値を先頭アドレスとするオブジェクトeのサイズを加えて、これを新しいPの値(=6)とする。   FIG. 17C shows the heap area at the stage where the mark processing (S500) in the collection of old generation garbage has been completed, as described above. When this mark process is completed, a move destination determination process (S600) is started, and both free and P are set to point to the top address (= 4) of the old generation area 43 (S601). If P is less than the tail address of the used area of the old generation area 43 (S602), it is checked whether or not the reachability field 51 of the object d having P (= 4) as the head address is marked ( S603). In this case, the reachability field 51 of the object d is marked, but since it is stored at the beginning of the old generation area 43, it is not set as a movement target. Then, the value of the size of the object d is added to the value of free, and this is set as a new value of free (= 5) (S604), and the size of the object d having the value of P as the start address is added to the value of P. This is the new value of P (= 5) (S604). That is, free and P are set so as to point to address 5, respectively. Again, after returning to step 602, the process proceeds to step 603, where it is checked whether or not the reachability field 51 of the object e having P (= 5) as the head address is marked. Since the reachability field 51 of this object e is not marked, which means that the object e is not alive, it does not become a movement target, and immediately proceeds to step 605. In step 605, the size of the object e having the P value as the start address is added to the P value, and this is set as a new P value (= 6).

その後、再び、ステップ602に戻ってからステップ603に進み、ここで、P(=6)を先頭アドレスとするオブジェクトfの到達可能性フィールド51にマークが付いているか否かを調べる。このオブジェクトfの到達可能性フィールド51にはマークが付いているので、このオブジェクトfの移動先フィールド53の値をfreeの値(=5)にした後、freeの値を6に更新する(S604)。そして、Pの値を7に更新した後(S605)、再び、ステップ602に戻ってからステップ603に進む。この場合も、P(=7)を先頭アドレスとするオブジェクトaの到達可能性フィールド51にマークが付いているか否かを調べる。このオブジェクトaの到達可能性フィールド51にもマークが付いているので、このオブジェクトaの移動先フィールド53の値をfreeの値(=6)にした後、freeの値を7に更新する(S604)。そして、Pの値を8に更新した後(S605)、再び、ステップ602に戻る。このステップ602では、Pの値(=8)が古い世代領域43の使用中の後尾アドレス(=8)になっているので、移動先決定処理を終了する。すなわち、ここでは、オブジェクトfの移動先をアドレス5に決定し、オブジェクトaの移動先をアドレス6に決定する。   Thereafter, the process returns to step 602 and then proceeds to step 603, where it is checked whether or not the reachability field 51 of the object f having P (= 6) as the head address is marked. Since the reachability field 51 of this object f is marked, after the value of the destination field 53 of this object f is set to the free value (= 5), the free value is updated to 6 (S604). ). Then, after updating the value of P to 7 (S605), the process returns to step 602 and then proceeds to step 603. Also in this case, it is checked whether or not the reachability field 51 of the object a having P (= 7) as the head address is marked. Since the reachability field 51 of this object a is also marked, after the value of the destination field 53 of this object a is set to the free value (= 6), the free value is updated to 7 (S604). ). Then, after updating the value of P to 8 (S605), the process returns to step 602 again. In this step 602, since the value of P (= 8) is the tail address (= 8) in use of the old generation area 43, the movement destination determination process is terminated. That is, here, the destination of the object f is determined as the address 5 and the destination of the object a is determined as the address 6.

次に、図10に示すフローチャートに従って、メモリ内容修正処理(S700)について説明する。   Next, the memory content correction process (S700) will be described with reference to the flowchart shown in FIG.

ゴミ集め実行部21は、メモリ内容修正処理として、まず、若い世代のメモリ内容修正処理(S710)を行い、その後、ルートフィールドのメモリ内容修正処理(S740)、古い世代のメモリ内容修正処理1(S750)を順に行う。   As the memory content correction processing, the garbage collection execution unit 21 first performs the young generation memory content correction processing (S710), and then performs the root field memory content correction processing (S740) and the old generation memory content correction processing 1 ( S750) is performed in order.

次に、図11に示すフローチャートに従って、若い世代のメモリ内容修正処理(S710)の詳細について説明する。   Next, according to the flowchart shown in FIG. 11, the details of the memory content modification processing (S710) of the young generation will be described.

若い世代のメモリ内容修正処理(S710)では、若い世代のすべてのオブジェクトに対し、移動済みフィールドにマークが付いていない場合には、オブジェクト内のポインタフィールドの値を、ポインタの指すオブジェクトの移動先フィールドの値に修正する。移動済みフィールドにマークが付いている場合は、オブジェクトの移動先フィールドをその移動先が指すオブジェクトの実体の移動先フィールドの値に更新し、オブジェクトの到達可能性フィールドにマークを付ける。若い世代のオブジェクトの到達可能性フィールドのマークは、オブジェクトの移動先フィールドが実体の移動先で既に更新されていることを表す。オブジェクトの移動済みフィールドにマークが付いているのは、若い世代領域の中断中(図3中のS9)だけなので、図3中のS10で古い世代領域のゴミ集め処理が呼び出されたときだけである。   In the memory generation modification process (S710) of the young generation, when the moved field is not marked for all the objects of the young generation, the value of the pointer field in the object is set to the movement destination of the object indicated by the pointer. Correct to the value of the field. When the moved field is marked, the object's destination field is updated to the value of the destination field of the object entity pointed to by the destination, and the object reachability field is marked. The mark in the reachability field of the young generation object indicates that the object destination field has already been updated with the entity destination. Since the moved field of the object is marked only when the young generation area is suspended (S9 in FIG. 3), only when the old generation area garbage collection processing is called in S10 of FIG. is there.

ゴミ集め実行部21は、この若い世代のメモリ内容修正処理で(S710)、まず、若い世代領域の先頭アドレスをSに代入する(S711)。Sは、現在メモリ内容修正中のオブジェクトを指すポインタである。次に、Sの示すアドレスが若い世代領域の使用中領域の後尾アドレス未満であるかを調べる(S712)。Sの示すアドレスが若い世代領域の使用中領域の後尾アドレス未満である場合には、Sの示すアドレスを先頭アドレスとするオブジェクトの移動済みフィールドにマークが付いているか否かを調べる(S713)。マークが付いている場合、ステップ714又はステップ718に進む。ステップ714からステップ717までの処理は、若い世代領域のゴミ集めを中断したとき(図3中のS9)のみに実行し、若い世代領域のゴミ集めを中断してない場合には、直ちに、ステップ718に進む。ステップ714では、Sの示すアドレスを先頭アドレスとするオブジェクトの移動先フィールドに格納されている値をQとする。次に、このQを引数として後述の移動先取得処理(S730)を呼び出し(S715)、移動先取得処理の戻り値をQとする、つまり移動先フィールドに戻り値Qを書き込む(S716)。移動先取得処理の戻り値は、Sの示すアドレスを先頭アドレスとするオブジェクトの実体の移動先である。次に、Sの示すアドレスを先頭アドレスとするオブジェクトの到達可能性フィールドにマークを付ける(S717)。ここでマークを付けるのは、当該オブジェクトの移動先フィールドの値が実体の移動先となったことを区別するためである。   In this young generation memory content correction process (S710), the garbage collection execution unit 21 first substitutes the start address of the young generation area for S (S711). S is a pointer pointing to the object whose memory contents are currently being modified. Next, it is checked whether the address indicated by S is less than the tail address of the in-use area of the young generation area (S712). If the address indicated by S is less than the tail address of the in-use area of the young generation area, it is checked whether or not the moved field of the object having the address indicated by S as the head address is marked (S713). If it is marked, go to Step 714 or Step 718. The processing from step 714 to step 717 is executed only when garbage collection of the young generation area is interrupted (S9 in FIG. 3). Proceed to 718. In step 714, Q is a value stored in the destination field of the object whose head address is the address indicated by S. Next, a destination acquisition process (S730) described later is called with this Q as an argument (S715), and the return value of the destination acquisition process is set to Q, that is, the return value Q is written in the destination field (S716). The return value of the movement destination acquisition process is the movement destination of the entity of the object whose head address is the address indicated by S. Next, the reachability field of the object having the address indicated by S as the head address is marked (S717). The reason why the mark is added here is to distinguish that the value of the movement destination field of the object is the movement destination of the entity.

到達可能性フィールドにマークを付けると(S717)、Sの値に、Sの示すアドレスを先頭アドレスとするオブジェクトのサイズを加え、これを新しいSの値とする(S718)。これは、処理するオブジェクトを次のオブジェクトに進める処理である。この処理が終わると、ステップ712の判断処理に戻る。このステップ712で、Sの示すアドレスが若い世代領域の使用中領域の後尾アドレス未満ではないと判断すると、若い世代のメモリ内容修正処理を終了する。   When the reachability field is marked (S717), the size of the object having the address indicated by S as the head address is added to the value of S, and this is set as the new value of S (S718). This is a process of moving the object to be processed to the next object. When this process ends, the process returns to the determination process of step 712. If it is determined in step 712 that the address indicated by S is not less than the trailing address of the in-use area of the young generation area, the memory content correction process for the young generation is terminated.

ステップ713で、Sの示すアドレスを先頭アドレスとするオブジェクトの移動済みフィールドにマークが付いていないと判断した場合には、このオブジェクトに未処理のポインタフィールドが存在するか否かを調べる(S719)。未処理のポインタフィールドが無い場合には、前述のステップ718に進む。また、未処理のポインタフィールドが存在する場合には、この未処理のポインタフィールドの値を取出し(S720)、このポインタフィールドの値pを引数として、後述の移動先取得処理を呼び出した後(S721)、この移動先取得処理の戻り値をポインタフィールドに書き込み(S722)、ステップ719に戻る。   If it is determined in step 713 that the moved field of the object having the address indicated by S as the head address is not marked, it is checked whether an unprocessed pointer field exists in this object (S719). . If there is no unprocessed pointer field, the process proceeds to step 718 described above. If there is an unprocessed pointer field, the value of this unprocessed pointer field is fetched (S720), and a later-described destination acquisition process is called using the pointer field value p as an argument (S721). ), The return value of the destination acquisition process is written in the pointer field (S722), and the process returns to step 719.

次に、移動先取得処理(S730)について、図12に示すフローチャートに従って説明する。   Next, the destination acquisition process (S730) will be described with reference to the flowchart shown in FIG.

この移動先取得処理(S730)は、図11中のステップ715及びステップ721の処理で呼び出される。移動先取得処理では、引数の指すオブジェクトをコンパクション処理で移動するなら移動先フィールドの値を返し、そうでないなら引数をそのまま返す。ただし、オブジェクトに移動済みフィールドにマークが付いている場合は、若い世代のゴミ集めにより、このオブジェクトの実体がすでに別の場所に移動されているので、このオブジェクトの移動先フィールドの値で示されているオブジェクトの移動先フィールドの値を返す。また、オブジェクトの移動済みフィールドと到達可能性フィールドの両方にマークが付いている場合は、このオブジェクトの移動先はすでに実体の移動先に書き換えられているので、その値を返す。   This destination acquisition process (S730) is called in the processes of step 715 and step 721 in FIG. In the move destination acquisition process, if the object pointed to by the argument is moved by the compaction process, the value of the move destination field is returned; otherwise, the argument is returned as it is. However, if the object has a moved field marked, it is indicated by the value of the destination field of this object because the entity of this object has already been moved to a different location due to garbage collection of the younger generation. Returns the value of the destination field of the current object. If both the moved field and reachability field of the object are marked, the object's destination has already been rewritten to the entity's destination, so that value is returned.

ゴミ集め実行部21は、この移動先取得処理で(S730)、まず、Pに引数を代入する(S731)。次に、このPを先頭アドレスとするオブジェクトの到達可能性フィールドにマークが付いているか否かを調べる(S732)。マークが付いている場合は、このオブジェクトの移動先フィールドの値を戻り値とし(S733)、処理を終了する。また、マークが付いていない場合、このオブジェクトの移動先フィールドにマークが付いているか否かを調べる(S734)。マークが付いていない場合、Pの値を戻り値とし(S737)、処理を終了する。つまり、この場合は、引数として与えられた値がそのまま戻り値になる。また、マークが付いている場合、このオブジェクトの移動先フィールドの値を引数として、この処理自身を呼び出し(S735)、呼び出した処理からの戻り値を、この移動先取得処理での戻り値とし(S736)、処理を終了する。   In this movement destination acquisition process (S730), the garbage collection execution unit 21 first substitutes an argument for P (S731). Next, it is checked whether or not the reachability field of the object having P as the head address is marked (S732). If there is a mark, the value of the destination field of this object is set as a return value (S733), and the process ends. If there is no mark, it is checked whether or not this object's destination field is marked (S734). If there is no mark, the value of P is set as a return value (S737), and the process ends. That is, in this case, the value given as an argument becomes the return value as it is. If the mark is attached, the process itself is called with the value of the destination field of this object as an argument (S735), and the return value from the called process is the return value in this destination acquisition process ( S736), the process is terminated.

具体的な若い世代のメモリ内容修正処理(S710)及びこの処理で実行される移動先取得処理(S730)の例について、図17(d)、図18(e)を用いて説明する。   A specific example of the memory content modification process (S710) of the young generation and the migration destination acquisition process (S730) executed in this process will be described with reference to FIGS. 17 (d) and 18 (e).

図17(d)は、前述したように、移動先決定処理(S600)が終了した段階のヒープ領域を示している。この移動先決定処理が終了すると、若い世代のメモリ修正処理(S710)が開始され、若い世代領域42の先頭アドレスをS(=1)に代入する(S711)。次に、S(=1)の示すアドレスが若い世代領域42の使用中領域の後尾アドレス未満であるかを調べる(S712)。この場合、Sの示すアドレスが若い世代領域の使用中領域の後尾アドレス未満であるので、Sの示すアドレスを先頭アドレスとするオブジェクトaの移動済みフィールド52にマークが付いているか否かを調べる(S713)。この場合、マークが付いているので、Sの示すアドレスを先頭アドレスとするオブジェクトaの移動先フィールドに格納されている値をQ(=7)に代入する(S714)。次に、このQを引数として移動先取得処理(S730)を呼び出す(S715)。   FIG. 17D shows the heap area at the stage where the movement destination determination process (S600) is completed as described above. When this move destination determination process ends, the young generation memory correction process (S710) is started, and the head address of the young generation area 42 is substituted into S (= 1) (S711). Next, it is checked whether the address indicated by S (= 1) is less than the tail address of the in-use area of the young generation area 42 (S712). In this case, since the address indicated by S is less than the tail address of the in-use area of the young generation area, it is checked whether or not the moved field 52 of the object a having the address indicated by S as the head address is marked ( S713). In this case, since there is a mark, the value stored in the movement destination field of the object a having the address indicated by S as the head address is substituted for Q (= 7) (S714). Next, the destination acquisition process (S730) is called using this Q as an argument (S715).

呼び出された移動先取得処理(S730)では、まず、Pに引数Q(=7)を代入する(S731)。次に、このP(=7)を先頭アドレスとするオブジェクトaの到達可能性フィールド51にマークが付いているか否かを調べる(S732)。この場合、マークが付いているので、このオブジェクトaの移動先フィールドの値(=6)を戻り値とし(S753)、移動先取得処理を終了する。   In the called destination acquisition process (S730), first, an argument Q (= 7) is substituted for P (S731). Next, it is checked whether or not the reachability field 51 of the object a having P (= 7) as the head address is marked (S732). In this case, since there is a mark, the value (= 6) of the destination field of this object a is set as a return value (S753), and the destination acquisition process is terminated.

ステップ715での移動先取得処理の呼び出し後、この移動先取得処理から戻り値(=6)をQとする、つまり、図18(e)に示すように、戻り値(=6)をオブジェクトaの移動先フィールド53に書き込む(S716)。次に、S(=1)のアドレスを先頭アドレスとするオブジェクトaの到達可能性フィールド51にマークを付ける(S717)。そして、Sの値(=1)に、Sのアドレスを先頭アドレスとするオブジェクトaのサイズを加え、これを新しいSの値(=2)とし(S718)、つまり、メモリ内容の修正処理の対象をSの値を先頭アドレスとするオブジェクトbにして、ステップ712の判断処理に戻る。そして、ステップ713,719を経て、ステップ718で、Sの値を新しい値(=3)に更新して、再び、ステップ712に戻る。   After calling the movement destination acquisition process in step 715, the return value (= 6) from this movement destination acquisition process is set to Q. That is, as shown in FIG. 18 (e), the return value (= 6) is set to the object a. Is written in the destination field 53 of the destination (S716). Next, the reachability field 51 of the object a having the address of S (= 1) as the head address is marked (S717). Then, the size of the object a having the address of S as the head address is added to the value of S (= 1), and this is set as a new value of S (= 2) (S718), that is, the memory content correction processing target To the object b having the value of S as the head address, and the process returns to the determination processing in step 712. Then, after steps 713 and 719, the value of S is updated to a new value (= 3) in step 718, and the process returns to step 712 again.

再び戻ったステップ712を経て、ステップ713に至ると、ここでは、S(=3)の示すアドレスを先頭アドレスとするオブジェクトcの移動済みフィールド53にマークが付いていないので、ステップ719,720に進む。そして、ステップ720で、S(=3)のアドレスを先頭アドレスとするオブジェクトcのポインタフィールド56の値p(=1)を取出し、pの値(=1)を引数として、移動先取得処理(S730)を呼び出す(S721)。   After returning to step 712 and reaching step 713, since the moved field 53 of the object c having the address indicated by S (= 3) as the head address is not marked here, the steps 719 and 720 are performed. move on. In step 720, the value p (= 1) of the pointer field 56 of the object c having the address of S (= 3) as the head address is extracted, and the destination acquisition process ( S730) is called (S721).

呼び出された移動先取得処理(S730)では、まず、Pに引数p(=1)を代入する(S731)。次に、このP(=1)を先頭アドレスとするオブジェクトaの到達可能性フィールド51にマークが付いているか否かを調べる(S732)。この場合、マークが付いているので、このオブジェクトaの移動先フィールドの値(=6)を戻り値とし(S753)、移動先取得処理を終了する。   In the called destination acquisition process (S730), first, an argument p (= 1) is substituted for P (S731). Next, it is checked whether or not the reachability field 51 of the object a having P (= 1) as the head address is marked (S732). In this case, since there is a mark, the value (= 6) of the destination field of this object a is set as a return value (S753), and the destination acquisition process is terminated.

ステップ721での移動先取得処理の呼び出し後、この移動先取得処理から戻り値(=6)をQとする、つまり、図18(e)に示すように、戻り値(=6)をオブジェクトcの移動先フィールド53に書き込む(S716)。次に、S(=3)のアドレスを先頭アドレスとするオブジェクトcの到達可能性フィールド51にマークを付ける(S717)。なお、オブジェクトcの到達可能性フィールド51には既にマークが付いているのでマークを上書きすることになる。そして、Sの値(=3)を新しいSの値(=4)とし(S718)、再び、ステップ712に戻る。   After calling the destination acquisition process in step 721, the return value (= 6) from this destination acquisition process is set to Q, that is, the return value (= 6) is set to the object c as shown in FIG. Is written in the destination field 53 of the destination (S716). Next, the reachability field 51 of the object c having the address of S (= 3) as the head address is marked (S717). Since the reachability field 51 of the object c is already marked, the mark is overwritten. Then, the value of S (= 3) is changed to a new value of S (= 4) (S718), and the process returns to step 712 again.

このステップ712では、Sの値(=4)が若い世代領域42の使用中領域の後尾アドレスであるので、Sの値(=4)が若い世代領域42の使用中領域の後尾アドレス未満ではないと判断して、若い世代のメモリ内容修正処理を終了する。   In this step 712, since the value of S (= 4) is the tail address of the in-use area of the young generation area 42, the value of S (= 4) is not less than the tail address of the in-use area of the young generation area 42. It is determined that the memory content correction process for the younger generation is terminated.

次に、図13に示すフローチャートに従って、ルートのメモリ内容修正処理(S740)について説明する。   Next, the route memory content correction process (S740) will be described with reference to the flowchart shown in FIG.

このメモリ内容修正処理(S740)では、全てのルートに対し、その内容を順に修正していく。ゴミ集め実行部21は、まず、未処理のルートが残っているかを調べる(S741)。残っていない場合は処理を終了する。残っていた場合は、未処理のルートを一つ取り出し、このルート値をRとする(S742)。次に、Rを引数として前述の移動先取得処理(S730)を呼び出す(S743)。そして、移動先取得処理からの戻り値をRに代入し、つまり、ルートフィールドに書き込んで(S744)、ステップ741に戻る。ルートのメモリ修正処理において大域変数のscanもルートとして扱う。一方、freeはルートとして扱わない。   In this memory content correction process (S740), the contents are corrected in order for all routes. The garbage collection execution unit 21 first checks whether an unprocessed route remains (S741). If not, the process is terminated. If it remains, one unprocessed route is taken out and this route value is set as R (S742). Next, the above-mentioned destination acquisition process (S730) is called with R as an argument (S743). Then, the return value from the movement destination acquisition process is substituted for R, that is, written in the route field (S744), and the process returns to step 741. The global variable scan is also treated as a root in the route memory modification process. On the other hand, free is not treated as a root.

次に、図14に示すフローチャートに従って、古い世代のメモリ内容修正処理(S750)について説明する。   Next, the old generation memory content correction processing (S750) will be described with reference to the flowchart shown in FIG.

この古い世代のメモリ内容修正処理(S750)では、古い世代の各オブジェクトに対し、ポインタフィールドの値をポインタの指すオブジェクトの移動先に修正する。ゴミ集め実行部21は、まず、古い世代領域の先頭アドレスをPに代入する(S751)。このPは現在、メモリ内容修正中のオブジェクトを指すポインタである。次に、Pが古い世代の使用中領域の後尾アドレス未満であるかを調べる(S752)。Pが古い世代の使用中領域の後尾アドレス未満でない場合、古い世代領域の全てのオブジェクトに対しメモリ内容修正が終了したことになるので、古い世代領域のメモリ内容修正処理を終了する。一方、Pが古い世代の使用中領域の後尾アドレス未満の場合、Pを先頭アドレスとするオブジェクトの到達可能性フィールドにマークが付いているかを調べる(S753)。マークが付いている場合は、Pの指すオブジェクトに未処理のポインタがあるかを調べる(S754)。未処理のポインタがある場合、Pの指すオブジェクトの未処理のポインタフィールドの値を一つ取り出しそれをQとする(S755)。そして、Qの値を引数として、前述の移動先取得処理(S730)を呼び(S756)、この移動先取得処理からの戻り値にQの値を更新する。つまり、Pの指すオブジェクトのポインタフィールドに戻り値を書き込み(S757)、ステップ754に戻る。ステップ753で、Pを先頭アドレスとするオブジェクトの到達可能性フィールドにマークが付いていないと判断した場合、及びステップ754で、Pの指すオブジェクトに未処理のポインタがない場合には、Pの指すオブジェクトに、このオブジェクトのサイズを加えて、この値を新しいPの値とし(S758)、ステップ752に戻る。   In this old generation memory content correction process (S750), the value of the pointer field is corrected to the destination of the object pointed to by the pointer for each object of the old generation. First, the garbage collection execution unit 21 substitutes the head address of the old generation area for P (S751). This P is a pointer that points to the object whose memory contents are currently being modified. Next, it is checked whether P is less than the tail address of the old generation busy area (S752). If P is not less than the tail address of the old generation in-use area, the memory content correction has been completed for all objects in the old generation area, so the memory content correction processing for the old generation area is terminated. On the other hand, if P is less than the tail address of the old generation in-use area, it is checked whether the reachability field of the object having P as the head address is marked (S753). If there is a mark, it is checked whether there is an unprocessed pointer in the object pointed to by P (S754). If there is an unprocessed pointer, one value of the unprocessed pointer field of the object pointed to by P is extracted and set as Q (S755). Then, using the Q value as an argument, the above-mentioned destination acquisition process (S730) is called (S756), and the Q value is updated to the return value from this destination acquisition process. That is, the return value is written in the pointer field of the object pointed to by P (S757), and the process returns to step 754. If it is determined in step 753 that the reachability field of the object having P as the start address is not marked, and if there is no unprocessed pointer in the object pointed to by P in step 754, the point indicated by P The size of the object is added to the object to set this value as a new value of P (S758), and the process returns to step 752.

以上の若い世代のメモリ内容修正処理(S710)、ルートのメモリ内容修正処理(S740)、古い世代のメモリ内容修正処理(S750)で、メモリ内容修正処理(S700)が終了する。   The memory content correction processing (S700) is completed in the above-described young generation memory content correction processing (S710), root memory content correction processing (S740), and old generation memory content correction processing (S750).

ここで、具体的なルートのメモリ内容修正処理(S740)及び古い世代のメモリ内容修正処理(S750)の例について、図18(e)及び同図(f)を用いて説明する。   Here, an example of a specific route memory content correction process (S740) and an old generation memory content correction process (S750) will be described with reference to FIG. 18 (e) and FIG. 18 (f).

図18(e)は、前述したように、若い世代のメモリ内容修正処理(S710)が終了した段階のヒープ領域を示している。この若い世代のメモリ内容修正処理が終了すると、ルートのメモリ修正処理(S740)が開始される。このルートのメモリ内容修正処理では、未処理のルート、この場合、ルートフィールド61の値(=7)を取り出し、この値をRに設定する(S741,742)。次に、このR(=7)を引数として移動先取得処理(S730)を呼び出す(S743)。   FIG. 18E shows the heap area at the stage when the young generation memory content correction processing (S710) is completed, as described above. When this young generation memory content correction processing is completed, the root memory correction processing (S740) is started. In the memory content correction processing of this route, an unprocessed route, in this case, the value of the route field 61 (= 7) is taken out, and this value is set to R (S741, 742). Next, the destination acquisition process (S730) is called with this R (= 7) as an argument (S743).

呼び出された移動先取得処理(S730)では、まず、Pに引数p(=7)を代入する(S731)。次に、このP(=7)を先頭アドレスとするオブジェクトaの到達可能性フィールド51にマークが付いているか否かを調べる(S732)。この場合、マークが付いているので、このオブジェクトaの移動先フィールドの値(=6)を戻り値として(S753)、移動先取得処理を終了する。   In the called destination acquisition process (S730), first, an argument p (= 7) is substituted for P (S731). Next, it is checked whether or not the reachability field 51 of the object a having P (= 7) as the head address is marked (S732). In this case, since there is a mark, the value (= 6) of the destination field of this object a is set as a return value (S753), and the destination acquisition process is terminated.

ステップ743での移動先取得処理の呼び出し後、この移動先取得処理から戻り値(=6)をRとする、つまり、図18(f)に示すように、ルートフィールド61の値を戻り値(=6)に更新する(S744)。なお、このルートのメモリ内容修正処理では、scanやfreeもルートとして扱い、ルートと同様の処理を行う。このため、scanはアドレス「6」を指し、freeはアドレス「7」を指すようになる。以上で、ルートのメモリ内容修正処理が終了する。   After calling the destination acquisition process in step 743, the return value (= 6) from this destination acquisition process is set to R. That is, as shown in FIG. 18 (f), the value of the route field 61 is set to the return value ( = 6) (S744). In this route memory content correction processing, scan and free are also handled as routes, and processing similar to that for routes is performed. For this reason, scan indicates the address “6”, and free indicates the address “7”. This completes the route memory content correction process.

続いて、古い世代のメモリ内容修正処理(S750)が開始される。古い世代のメモリ内容修正処理では、まず、古い世代領域の先頭アドレス(=4)をPに代入する(S751)。次に、Pが古い世代の使用中領域の後尾アドレス未満であると(S752)、P(=4)を先頭アドレスとするオブジェクトdの到達可能性フィールド51にマークが付いているかを調べる(S753)。この場合、マークが付いているので、更に、このオブジェクトdに未処理のポインタがあるかを調べる(S754)。この場合、未処理のポインタがあるので、このオブジェクトcの未処理のポインタフィールドの値(=6)を取り出しそれをQとする(S755)。そして、Qの値を引数(=6)として、移動先取得処理(S730)を呼び出す(S756)。   Subsequently, an old generation memory content correction process (S750) is started. In the memory content correction process for the old generation, first, the start address (= 4) of the old generation area is substituted for P (S751). Next, if P is less than the tail address of the old generation in-use area (S752), it is checked whether the reachability field 51 of the object d having P (= 4) as the head address is marked (S753). ). In this case, since there is a mark, it is further checked whether there is an unprocessed pointer in this object d (S754). In this case, since there is an unprocessed pointer, the value (= 6) of the unprocessed pointer field of this object c is extracted and set as Q (S755). Then, the destination acquisition process (S730) is called using the Q value as an argument (= 6) (S756).

呼び出された移動先取得処理(S730)では、まず、Pに引数p(=6)を代入する(S731)。次に、このP(=6)を先頭アドレスとするオブジェクトfの到達可能性フィールド51にマークが付いているか否かを調べる(S732)。この場合、マークが付いているので、このオブジェクトfの移動先フィールドの値(=5)を戻り値として(S753)、移動先取得処理を終了する。   In the called destination acquisition process (S730), first, an argument p (= 6) is substituted for P (S731). Next, it is checked whether or not the reachability field 51 of the object f having this P (= 6) as the head address is marked (S732). In this case, since there is a mark, the value (= 5) of the destination field of this object f is set as a return value (S753), and the destination acquisition process is terminated.

ステップ756での移動先取得処理の呼び出し後、この移動先取得処理から戻り値(=5)をQとする、つまり、図18(f)に示すように、ポインタフィールド56の値を戻り値(=5)に更新し(S757)、ステップ754に戻る。その後、ステップ758を経て、ステップ752に戻る。以降、残りのオブジェクトe,f,aに対しても、ステップ752〜758の処理が繰り返されるが、オブジェクトe,f,aのポインタフィールド56の変更は行われない。   After the movement destination acquisition process is called in step 756, the return value (= 5) from this movement destination acquisition process is set to Q. That is, as shown in FIG. = 5) (S757), and the process returns to Step 754. Thereafter, the process returns to step 752 via step 758. Thereafter, the processing of steps 752 to 758 is repeated for the remaining objects e, f, and a, but the pointer field 56 of the objects e, f, and a is not changed.

次に、図15に示すフローチャートに従って、オブジェクト移動処理(S800)について説明する。   Next, the object movement process (S800) will be described with reference to the flowchart shown in FIG.

このオブジェクト移動処理は、先の移動先決定処理(S600)で決めた移動先のアドレスに、オブジェクトを実際に移動する処理である。   This object movement processing is processing for actually moving an object to the destination address determined in the previous destination determination processing (S600).

ゴミ集め実行部21は、このオブジェクト移動処理(S800)で、まず、古い世代領域の先頭アドレスをPに代入する(S801)。このPは移動処理の対象となるオブジェクトを指す。次に、アドレスPが古い世代領域の使用中領域の後尾アドレス未満かを調べる(S802)。アドレスPが古い世代領域の使用中領域の後尾アドレス未満の場合、Pを先頭アドレスとするオブジェクトの到達可能性フィールドにマークがあるか、さらに、このオブジェクトの移動先フィールドに値が格納されているかを調べる(S803)。このオブジェクトの到達可能性フィールドにマークがあり、さらに、このオブジェクトの移動先フィールドに値が格納されている場合には、このオブジェトが移動候補であるとして、freeをこのオブジェクトの移動先フィールドの値に換えると共に、このオブジェクトの到達可能性フィールドのマークと移動先フィールドの値を消去する(S804)。続いて、このオブジェクトをfreeの位置に移動する(S805)。なお、このオブジェクト移動処理での「移動」は、前述したように、コピー処理のように移動元にオブジェクトが残る移動ではない。但し、本願において、特にことわりがない限り、「移動」とは、コピー処理のように移動元にオブジェクトが残る移動も、このオブジェクト移動処理の際の移動のように移動元にオブジェクトが残らない移動も含まれる。そして、PにPのサイズを加えることで、処理対象となるオブジェクトを次のオブジェクトに進めて(S806)、ステップ802に戻る。また、ステップ803で、Pを先頭アドレスとするオブジェクトの到達可能性フィールにマークがない、又は、このオブジェクトの移動先フィールドに値が格納されていないと判断した場合にも、同様に、PにPのサイズを加えてから(S806)、ステップ802に戻る。   In this object movement process (S800), the garbage collection execution unit 21 first substitutes the top address of the old generation area for P (S801). This P indicates an object to be moved. Next, it is checked whether the address P is less than the tail address of the in-use area of the old generation area (S802). If the address P is less than the tail address of the used area of the old generation area, is there a mark in the reachability field of the object with P as the start address, and whether a value is stored in the destination field of this object? (S803). If there is a mark in the reachability field of this object and a value is stored in the destination field of this object, the value of the destination field of this object is considered as an object to be moved. In addition, the reachability field mark and the destination field value of this object are deleted (S804). Subsequently, this object is moved to the free position (S805). Note that the “move” in the object move process is not a move in which an object remains at the move source as in the copy process, as described above. However, in this application, unless otherwise specified, “move” refers to a movement in which an object remains in the movement source, such as a copy process, and a movement in which an object does not remain in the movement source, such as a movement in the object movement process. Is also included. Then, by adding the size of P to P, the object to be processed is advanced to the next object (S806), and the process returns to step 802. Similarly, when it is determined in step 803 that there is no mark in the reachability field of the object having P as the head address or no value is stored in the destination field of this object, After adding the size of P (S806), the process returns to step 802.

ステップ802で、アドレスPが古い世代領域の使用中領域の後尾アドレス未満ではないと判断すると、PにPのサイズを加えて(S807)、オブジェクト移動処理を終了する。   If it is determined in step 802 that the address P is not less than the trailing address of the used area of the old generation area, the size of P is added to P (S807), and the object movement process is terminated.

以上のマーク処理(S500)、移動先決定処理(S600)、メモリ内容修正処理(S700)、オブジェクト移動処理(S800)で、古い世代のゴミ集めが終了する。   The above-described mark processing (S500), movement destination determination processing (S600), memory content correction processing (S700), and object movement processing (S800) complete the collection of old generation garbage.

ここで、具体的なオブジェクト移動処理(S800)の例について、図18(f)及び同図(g)を用いて説明する。   Here, a specific example of the object movement process (S800) will be described with reference to FIG. 18 (f) and FIG. 18 (g).

図18(f)は、前述したように、メモリ内容修正処理(S700)が終了した段階のヒープ領域を示している。このメモリ内容修正処理が終了すると、オブジェクト移動処理(S800)が開始される。ゴミ集め実行部21は、まず、古い世代領域43の先頭アドレスをPに代入する(S801)。次に、アドレスP(=4)が古い世代領域43の使用中領域の後尾アドレス未満かを調べる(S802)。アドレスPが古い世代領域の使用中領域の後尾アドレス未満の場合、P(=4)を先頭アドレスとするオブジェクトdの到達可能性フィールド51にマークがあるか、さらに、このオブジェクトdの移動先フィールド53に値が格納されているかを調べる(S803)。このオブジェクトdの移動先フィールド53には値が格納されていないので、PにPのサイズを加えてから(S806)、ステップ802に戻る。   FIG. 18F shows the heap area at the stage where the memory content correction process (S700) is completed as described above. When this memory content correction process ends, an object movement process (S800) is started. The garbage collection execution unit 21 first substitutes the top address of the old generation area 43 for P (S801). Next, it is checked whether the address P (= 4) is less than the tail address of the used area of the old generation area 43 (S802). If the address P is less than the tail address of the used area of the old generation area, there is a mark in the reachability field 51 of the object d having P (= 4) as the head address, or the destination field of this object d It is checked whether a value is stored in 53 (S803). Since no value is stored in the destination field 53 of the object d, the size of P is added to P (S806), and the process returns to step 802.

同様に、P(=5)を先頭アドレスとするオブジェクトeに対しても、ステップ803〜ステップ806を実行し、対象とするオブジェクトをオブジェクトfに変える。このオブジェクトfは、その到達可能性フィールド51にマークがあり、さらに、このオブジェクトfの移動先フィールド53に値が格納されているので(S803)、このオブジェトfが移動候補であるとして、freeをこのオブジェクトfの移動先フィールド53の値(=5)に換えると共に、このオブジェクトfの到達可能性フィールドのマークと移動先フィールドの値を消去する(S804)。続いて、図18(g)に示すように、このオブジェクトfをfree(=5)の位置に移動する(S805)。なお、図18(g)中のscan及びfreeは、このオブジェクト移動処理に関係するものではなく、後述するように、スキャン処理のためのものである。その後、処理対象となるオブジェクトを次のオブジェクトaに進めて(S806)、ステップ802に戻る。   Similarly, Step 803 to Step 806 are executed for the object e having P (= 5) as the head address, and the target object is changed to the object f. Since this object f has a mark in its reachability field 51 and a value is stored in the destination field 53 of this object f (S803), it is determined that this object f is a movement candidate and free is set. In addition to the value (= 5) of the destination field 53 of this object f, the mark of the reachability field and the value of the destination field of this object f are erased (S804). Subsequently, as shown in FIG. 18G, the object f is moved to the position of free (= 5) (S805). Note that “scan” and “free” in FIG. 18G are not related to the object movement process, but are for the scan process, as will be described later. Thereafter, the object to be processed is advanced to the next object a (S806), and the process returns to step 802.

このオブジェクトaは、その到達可能性フィールド51にマークがあり、さらに、このオブジェクトaの移動先フィールド53に値が格納されているので(S803)、このオブジェトaも移動候補であるとして、freeをこのオブジェクトaの移動先フィールド53の値(=6)に換えると共に、このオブジェクトaの到達可能性フィールドのマークと移動先フィールドの値を消去する(S804)。続いて、このオブジェクトaをfree(=6)の位置に移動する(S805)。そして、PにPのサイズを加えてから(S806)、ステップ802に戻る。   Since this object a has a mark in its reachability field 51 and a value is stored in the destination field 53 of this object a (S803), it is assumed that this object a is also a movement candidate, and free is set. In addition to changing to the value (= 6) of the destination field 53 of this object a, the mark of the reachability field and the value of the destination field of this object a are deleted (S804). Subsequently, the object a is moved to the position of free (= 6) (S805). Then, after adding the size of P to P (S806), the process returns to step 802.

ステップ802では、アドレスP(=7)が古い世代領域43の使用中領域の後尾アドレス未満ではないと判断して、PにPのサイズを加えて(S807)、オブジェクト移動処理を終了する。この結果、古い世代のゴミ集め(S10)が終了する。   In step 802, it is determined that the address P (= 7) is not less than the tail address of the in-use area of the old generation area 43, the size of P is added to P (S807), and the object movement process is terminated. As a result, the old generation garbage collection (S10) ends.

この古い世代のゴミ集め(S10)は、図3を用いて前述したように、若い世代のゴミ集めのスキャン処理過程で中断(S9)した後に行われた処理であるため、この若い世代のゴミ集め(S10)が終了すると、中断していた若い世代のゴミ集めのスキャン処理が再開される(S11)。このスキャン処理では、スキャン処理の具体例として、図18(h)を用いて前述したように、アドレス値「3」を先頭とするオブジェクトcがアドレス「7」の位置にコピーされ、若い世代のゴミ集めが終了する。このように若い世代のゴミ集めが終了すると、若い世代領域42には、実体が古い世代領域43に移動してしまったオブジェクトa,cと、システムからアクセスできない、つまり生存していないオブジェクトbのみが残ることになる。この結果、若い世代領域42は、不要なオブジェクトのみしか存在しなくなったので、以降、若い世代領域42の全領域に新たなオブジェクトを格納することができるようになる。   This old generation garbage collection (S10) is a process performed after interruption (S9) in the scan process of the young generation garbage collection as described above with reference to FIG. When the collection (S10) is completed, the interrupted scan process for collecting the young generation's garbage is resumed (S11). In this scan process, as a specific example of the scan process, as described above with reference to FIG. 18H, the object c starting from the address value “3” is copied to the position of the address “7”. Garbage collection ends. When the collection of garbage of the young generation is completed in this way, only the objects a and c whose entities have moved to the old generation area 43 and the object b that cannot be accessed from the system, that is, the object b that is not alive, are included in the young generation area 42. Will remain. As a result, since only the unnecessary objects exist in the young generation area 42, new objects can be stored in the entire area of the young generation area 42 thereafter.

以上のように、本実施形態では、若い世代領域42のゴミ集めの際に、この若い世代領域42に格納されている1以上のオブジェクトのうちから古い世代領域43へ移すオブジェクトの量、つまり若い世代の生存量ESを、若い世代領域42の過去のゴミ集め実績から予測し、この移動量と古い世代領域43の空き容量OFと比較し、その結果に応じて、古い世代領域43のごみ集めを実行するので、古い世代領域のゴミ集めのタイミングが比較的的確になり、システム障害の可能性を低くすると共に、システムの性能低下を抑えることができる。さらに、若い世代領域42のゴミ集め実行中に、この若い世代領域42からのオブジェクトを格納するための空きが古い世代領域43に無くなった場合、若い世代領域42のゴミ集めが一時中断され、古い世代領域43のゴミ集めが実行された後、再び、若い世代領域42のゴミ集めが再開されるので、よりシステム障害の可能性を低くし、システム性能の低下を抑えることができる。   As described above, in the present embodiment, the amount of objects transferred from the one or more objects stored in the young generation area 42 to the old generation area 43 when collecting the garbage in the young generation area 42, that is, young The survival amount ES of the generation is predicted from the past collection results of the young generation area 42, and the amount of movement is compared with the free capacity OF of the old generation area 43, and according to the result, the garbage collection of the old generation area 43 is collected. Therefore, the timing of collecting garbage in the old generation area becomes relatively accurate, the possibility of a system failure is reduced, and the performance degradation of the system can be suppressed. Further, when the old generation area 43 has no space for storing objects from the young generation area 42 during the collection of garbage in the young generation area 42, the collection of garbage in the young generation area 42 is temporarily interrupted. After the collection of the garbage in the generation area 43 is executed, the collection of the garbage in the young generation area 42 is resumed, so that the possibility of a system failure can be further reduced and the deterioration of the system performance can be suppressed.

[第二の実施形態]
第二の実施形態について、図19〜図23を用いて説明する。
[Second Embodiment]
A second embodiment will be described with reference to FIGS.

本実施形態では、第一の実施形態のように、若い世代領域のゴミ集めを生き残った全てのオブジェクトが古い世代領域に殿堂入りするのではなく、若い世代領域での1回以上のゴミ集めを生き残ったオブジェクトのみが古い世代領域に殿堂入りする。   In this embodiment, as in the first embodiment, all objects that survived garbage collection in the young generation area do not enter the old generation area, but collect one or more garbage in the young generation area. Only the surviving objects enter the old generation area.

このため、本実施形態では、図19に示すように、第一の実施形態に対してゴミ集め処理部20aの機能構成が異なっている。具体的には、若い世代領域から古い世代領域に移されるオブジェクトの量として、第一の実施形態では若い世代領域のオブジェクトの生存量ESを予測しているが、本実施形態では若い世代領域から古い世代領域へオブジェクトの昇進量EPを予測する。なお、本実施形態は、このゴミ集め処理部20a以外の部分の構成及び動作は第一の実施形態と同様である。   For this reason, in this embodiment, as shown in FIG. 19, the functional configuration of the dust collection processing unit 20a is different from that of the first embodiment. Specifically, as the amount of objects transferred from the young generation area to the old generation area, the survival amount ES of the objects in the young generation area is predicted in the first embodiment. Predict the promotion amount EP of the object to the old generation area. In the present embodiment, the configuration and operation of portions other than the dust collection processing unit 20a are the same as those in the first embodiment.

また、本実施形態では、前述したように、若い世代領域での1回以上のゴミ集めを生き残ったオブジェクトのみが殿堂入りするので、ある世代でのゴミ集めを生き残った回数を把握する必要がある。このため、図20に示すように、オブジェクトのヘッダ50は、第一の実施形態と同様の、到達可能性フィールド51と移動済みフィールド52と移動先フィールド53とサイズフィールド54の他に、現在存在している世代の領域でのゴミ集めを生き残った回数である年齢が格納される年齢フィールド56aがある。   In this embodiment, as described above, since only objects that survive one or more garbage collections in the young generation area enter the Hall of Fame, it is necessary to grasp the number of times the garbage collection survived a certain generation. . For this reason, as shown in FIG. 20, the object header 50 is present in addition to the reachability field 51, the moved field 52, the destination field 53, and the size field 54 as in the first embodiment. There is an age field 56a in which the age, which is the number of times that the collection of garbage in the generation area, has survived, is stored.

図19に示すように、データメモリ40のヒープ領域41は、若い世代領域42aと古い世代領域43とに分けられている。この若い世代領域42aは、さらに、Eden44とfrom45とto46とに分けられている。   As shown in FIG. 19, the heap area 41 of the data memory 40 is divided into a young generation area 42 a and an old generation area 43. The young generation area 42a is further divided into Eden 44, from 45, and to 46.

ゴミ集め処理部20aは、図19に示すように、データメモリ40の若い世代領域42a及び古い世代領域43のぞれぞれのゴミ集めを実行するゴミ集め実行部21aと、各領域42a,43の使用量及び空き容量を計測するメモリ監視部22と、若い世代領域42aから古い世代領域43へ殿堂入りするオブジェクト昇進量EPを予測する予測昇進量算出部27と、これらの各部21a,22,27を制御するゴミ集め制御部23とを有している。予測昇進量算出部27は、ゴミ集め前のオブジェクトの領域使用量YUに対するゴミ集め後に生き残ったオブジェクトの生存量YSの割合である生存率SR(=YS/YU)を計測し、過去の生存率SRの実績から現在の生存率ESRを予測する生存率予測部25と、若い世代のゴミ集め後に生き残ったオブジェクトの生存量YSに対する若い世代領域42aから古い世代領域43へ殿堂入りするオブジェクトの昇進量YPの割合である昇進率PR(=YP/YS)を計測し、過去の昇進率PRの実績から次のゴミ集めの際の昇進率EPRを予測する昇進率予測部28と、予測された昇進率EPRと予測された若い世代領域42aの現在の生存率ESRと現在の若い世代領域42aの使用量YUとから、若い世代領域42aから古い世代領域43へ殿堂入りするオブジェクトの昇進量EP(=EPR(YU・ESR))を予測する昇進量予測部29とを有する。   As shown in FIG. 19, the garbage collection processing unit 20a includes a garbage collection execution unit 21a for collecting garbage in each of the young generation area 42a and the old generation area 43 of the data memory 40, and each of the areas 42a, 43. A memory monitoring unit 22 that measures the usage amount and free space of the computer, a predicted promotion amount calculation unit 27 that predicts an object promotion amount EP that enters the old generation region 43 from the young generation region 42a, and each of these units 21a, 22, And a dust collection control unit 23 for controlling 27. The predicted promotion amount calculation unit 27 measures the survival rate SR (= YS / YU), which is the ratio of the survival amount YS of the object that survived after collecting the dust to the area usage amount YU of the object before collecting the dust, and the past survival rate. The survival rate predicting unit 25 that predicts the current survival rate ESR from the SR results, and the promotion amount of the object that enters the old generation region 43 from the young generation region 42a with respect to the survival amount YS of the object that survived after collecting the garbage of the young generation Promotion rate PR (= YP / YS) which is the ratio of YP is measured, and the promotion rate prediction unit 28 for predicting the promotion rate EPR at the time of the next garbage collection from the past promotion rate PR results, and the predicted promotion From the predicted generation rate EPR and the current survival rate ESR of the young generation region 42a and the current usage amount YU of the young generation region 42a, the young generation region 42a to the old generation region 4 And a promotion amount prediction unit 29 for predicting the promotion of the object to be tenured EP (= EPR (YU · ESR)) to.

記憶割当部15は、命令実行部14からオブジェクトのメモリ割当命令を受けると、若い世代領域42aのEden44に格納領域を確保し、この格納領域の先頭アドレスを命令実行部14に返す。記憶割当部15は、仮に、若い世代領域42aのEden44に十分な格納領域を確保できないと認識した場合、ゴミ集め処理部20aに対してゴミ集め実行命令を出力し、データメモリ40内のゴミ集めを実行させる。   When the memory allocation unit 15 receives an object memory allocation command from the instruction execution unit 14, the storage allocation unit 15 secures a storage area in the Eden 44 of the young generation area 42 a and returns the top address of this storage area to the instruction execution unit 14. If the storage allocation unit 15 recognizes that a sufficient storage area cannot be secured in the Eden 44 of the young generation area 42a, the storage allocation unit 15 outputs a garbage collection execution instruction to the garbage collection processing unit 20a, and collects the garbage in the data memory 40. Is executed.

次に、記憶割当部15からゴミ集め実行命令を受けた際のゴミ集め処理部20aの動作内容、言い換えると、ゴミ集め処理プログラム32の実行による処理内容について、図21に示すフローチャートに従って説明する。   Next, the operation content of the dust collection processing unit 20a when receiving a dust collection execution command from the storage allocation unit 15, in other words, the processing content by the execution of the dust collection processing program 32 will be described with reference to the flowchart shown in FIG.

ゴミ集め処理部20aのゴミ集め制御部23は、前述の記憶割当部15からゴミ集め実行命令を受けると、生存率予測部25が若い世代領域42aの予測生存率をESRとして昇進量予測部29に渡すと共に、昇進率予測部28が若い世代領域42aから古い世代領域43へ殿堂入りする予測昇進率をEPRとして昇進量予測部29に渡す(S1a)。この際、ゴミ集め実行命令の受信が例えば5回目以降である場合には、生存率予測部25は、ここで予測した予測生存率をESRとして昇進量予測部29に渡し、昇進率予測部28は、ここで予測した予測昇進率をEPRとして昇進量予測部29に渡す。また、ゴミ集め実行命令の受信が例えば5回目未満である場合には、生存率予測部25は、予め設定された予測生存率をESRとして生存量予測部26に渡し、昇進率予測部28は、予め設定された予測昇進率をEPRとして昇進量予測部29に渡す。   When the garbage collection control unit 23 of the garbage collection processing unit 20a receives a garbage collection execution command from the storage allocation unit 15, the survival rate prediction unit 25 sets the predicted survival rate of the young generation area 42a as the ESR and the promotion amount prediction unit 29. And the promotion rate prediction unit 28 passes the predicted promotion rate of entering the hall of fame from the young generation region 42a to the old generation region 43 to the promotion amount prediction unit 29 as EPR (S1a). At this time, if the garbage collection execution command is received for the fifth time or later, for example, the survival rate prediction unit 25 passes the predicted survival rate predicted here as the ESR to the promotion amount prediction unit 29, and the promotion rate prediction unit 28 Passes the predicted promotion rate predicted here to the promotion amount prediction unit 29 as EPR. In addition, when the garbage collection execution command is received, for example, less than the fifth time, the survival rate prediction unit 25 passes the preset prediction survival rate as the ESR to the survival amount prediction unit 26, and the promotion rate prediction unit 28 The preset promotion rate set in advance is passed to the promotion amount prediction unit 29 as EPR.

続いて、メモリ監視部22が若い世代領域42aの使用量YU及び古い世代領域43の空き量OFを計測し、若い世代領域42aの使用量YUを生存率予測部25及び生存量予測部26に渡すと共に、古い世代領域43の空き量OFをゴミ集め制御部23に渡す(S2)。ここでの使用量YUとは、図23に示すように、若い世代領域42aのEden44の使用量YOeとto46の使用量YOtとを加算したものである。なお、若い世代領域42aのfrom45は、後述する理由で未使用(但し、生存していないオブジェクトは存在する)である。   Subsequently, the memory monitoring unit 22 measures the usage amount YU of the young generation region 42a and the free space OF of the old generation region 43, and the usage amount YU of the young generation region 42a is sent to the survival rate prediction unit 25 and the survival amount prediction unit 26. At the same time, the empty amount OF in the old generation area 43 is transferred to the dust collection control unit 23 (S2). The usage amount YU here is the sum of the usage amount YOe of Eden 44 and the usage amount YOt of to46 in the young generation area 42a, as shown in FIG. It should be noted that the from 45 of the young generation area 42a is unused for the reason described later (however, there are objects that are not alive).

昇進量予測部29は、若い世代領域42aの使用量YUを受け取ると、この使用量YUと先に受け取った若い世代領域42の予測生存率ESRとから、若い世代領域42aの予測生存量(=ESR・YU)を求め、この予測生存量に予測昇進率EPRを掛けて、予測昇進量EP(=EPR(ESR・YU))を求める。そして、この予測昇進量EPをゴミ集め制御部23に渡す(S3a)。   Upon receiving the usage amount YU of the young generation region 42a, the promotion amount prediction unit 29 receives the predicted survival amount (=) of the young generation region 42a from the usage amount YU and the predicted survival rate ESR of the young generation region 42 previously received. ESR · YU) is obtained, and this predicted survival amount is multiplied by the predicted promotion rate EPR to obtain the predicted promotion amount EP (= EPR (ESR · YU)). Then, the predicted promotion amount EP is passed to the dust collection control unit 23 (S3a).

ゴミ集め制御部23は、若い世代領域42aの予測昇進量EPを受け取ると、先に受け取った古い世代領域43の空き量OFと若い世代領域42aの予測昇進量EPとの大小関係を比較し(S4)、古い世代領域43の空き量OFに対して若い世代領域42aの予測昇進量EPが大きければ、ゴミ集め実行部21aに古い世代領域43のゴミ集めを実行させた後(S5)、若い世代領域42aのゴミ集めを実行させる(S6a)。一方、古い世代領域43の空き量OFに対して若い世代領域42aの予測昇進量EPが大きくなければ、ゴミ集め実行部21aに若い世代領域42aのゴミ集めを開始させる(S7a)。   When the garbage collection control unit 23 receives the predicted promotion amount EP of the young generation region 42a, the garbage collection control unit 23 compares the size relationship between the previously received free amount OF of the old generation region 43 and the predicted promotion amount EP of the young generation region 42a ( S4) If the predicted promotion amount EP of the young generation area 42a is larger than the free capacity OF of the old generation area 43, the garbage collection execution unit 21a executes the garbage collection of the old generation area 43 (S5) The garbage collection of the generation area 42a is executed (S6a). On the other hand, if the predicted promotion amount EP of the young generation area 42a is not larger than the free capacity OF of the old generation area 43, the garbage collection execution unit 21a starts collecting the garbage of the young generation area 42a (S7a).

ここで、図23を用いて、古い世代領域43の空き量OFと若い世代領域42aの予測昇進量EPとの大小関係の比較理由、及びこの比較結果でゴミ集めの実行対象領域が異なる理由について説明する。なお、同図(a)は若い世代領域42aのゴミ集め前のヒープ領域の状態を示し、同図(b)は若い世代領域42aのゴミ集め後のヒープ領域の状態を示す。   Here, with reference to FIG. 23, the reason for comparing the size relationship between the free space OF of the old generation area 43 and the predicted advancement amount EP of the young generation area 42a, and the reason why the execution target area of garbage collection differs depending on the comparison result. explain. FIG. 4A shows the state of the heap area before collecting garbage in the young generation area 42a, and FIG. 4B shows the state of the heap area after collecting garbage in the young generation area 42a.

若い世代領域42aのゴミ集めでは、前述したように、何回かのゴミ集めを生き残ったオブジェクトのみが古い世代領域43に殿堂入りする。このため、若い世代領域42aから古い世代領域43へ殿堂入りするであろうオブジェクトの量、つまり予測昇進量EPを求め、この予測昇進量EP分のオブジェクトを古い世代領域43の空き領域に移せるか否かを把握するために、古い世代領域43の空き量OFと若い世代領域42aの予測昇進量EPとの大小関係を比較する。   In the collection of garbage in the young generation area 42a, as described above, only objects that survive several times of garbage collection enter the old generation area 43. For this reason, the amount of objects that will be inducted into the old generation region 43 from the young generation region 42a, that is, the predicted promotion amount EP is obtained, and whether the objects corresponding to the predicted promotion amount EP can be moved to the free space of the old generation region 43. In order to ascertain whether or not, the magnitude relationship between the free space OF in the old generation area 43 and the predicted promotion amount EP of the young generation area 42a is compared.

古い世代領域43の空き量OFに対して若い世代領域42aの予測昇進量EPが大きければ、若い世代領域42aの予測昇進量EP分のオブジェクトを古い世代領域43の空き領域に移せないので、まず、古い世代領域43のゴミ集めを実行させ(S5)、その後、若い世代領域42aのゴミ集めを実行させる(S6a)。一方、古い世代領域43の空き量OFに対して若い世代領域42aの予測昇進量EPが大きくなければ、若い世代領域42aの予測昇進量EP分のオブジェクトを古い世代領域43の空き領域に移せるので、若い世代領域42aのゴミ集めを開始させる(S7a)。   If the predicted promotion amount EP of the young generation area 42a is larger than the free capacity OF of the old generation area 43, objects corresponding to the predicted promotion amount EP of the young generation area 42a cannot be moved to the free area of the old generation area 43. Then, garbage collection of the old generation area 43 is executed (S5), and then garbage collection of the young generation area 42a is executed (S6a). On the other hand, if the predicted promotion amount EP of the young generation area 42a is not large relative to the free capacity OF of the old generation area 43, objects corresponding to the predicted promotion amount EP of the young generation area 42a can be moved to the free area of the old generation area 43. Then, garbage collection in the young generation area 42a is started (S7a).

若い世代領域42aのゴミ集めが開始されると、若い世代領域42aから古い世代領域43にオブジェクトが殿堂入りする。このため、メモリ監視部22は、第一の実施形態と同様に、若い世代領域42aのゴミ集め実行中、古い世代領域43の空き量が十分に確保されているか否かを確認する(S8)。メモリ監視部22は、古い世代領域43の空き量が十分に確保されなくなったことを検知すると、ゴミ集め制御部23は、ゴミ集め実行部21aに若い世代領域42aのゴミ集めを一時中断させ(S9)、古い世代領域43のゴミ集めを実行させる(S10)。そして、この古い世代領域43のゴミ集めが終了すると、若い世代領域42aのゴミ集めを再開させる(S11a)。   When the collection of garbage in the young generation area 42a is started, the object enters the old generation area 43 from the young generation area 42a. For this reason, as in the first embodiment, the memory monitoring unit 22 confirms whether or not a free space in the old generation area 43 is sufficiently secured during the collection of garbage in the young generation area 42a (S8). . When the memory monitoring unit 22 detects that the free space in the old generation area 43 is not sufficiently secured, the garbage collection control unit 23 causes the garbage collection execution unit 21a to temporarily suspend collection of garbage in the young generation area 42a ( S9) The garbage collection of the old generation area 43 is executed (S10). When the collection of garbage in the old generation area 43 is completed, the collection of garbage in the young generation area 42a is resumed (S11a).

若い世代領域42aのゴミ集めが終了すると(S6a,S11a,S12)、ゴミ集め実行部21aは、若い世代領域42aから古い世代領域43へ実際に移したオブジェクトの量、つまり若い世代領域42aからの昇進量をYPとして、生存率予測部25及び昇進率予測部28に渡す。さらに、若い世代領域42aのゴミ集めで、他の領域に実際に移した全オブジェクトの量、つまり若い世代領域42aのオブジェクトの生存量をYSとして、昇進率予測部28に渡す(S13a)。なお、若い世代領域42aのゴミ集めで、他の領域に実際に移した全オブジェクトの量、つまり生存量YSは、図23に示すように、若い世代領域42aから古い世代領域43への実際に移したオブジェクトの量である昇進量YP(=YSt)に、若い世代領域42a内のある領域から他の領域へ実際に移したオブジェクトの量(YSe)を加えた量(YP(=YSt)+YSe)である。   When the collection of garbage in the young generation area 42a is completed (S6a, S11a, S12), the garbage collection execution unit 21a moves the amount of objects actually transferred from the young generation area 42a to the old generation area 43, that is, from the young generation area 42a. The promotion amount is transferred to the survival rate prediction unit 25 and the promotion rate prediction unit 28 as YP. Further, the amount of all objects actually moved to other areas in the collection of garbage in the young generation area 42a, that is, the survival amount of objects in the young generation area 42a is passed to the promotion rate prediction unit 28 as YS (S13a). It should be noted that the amount of all objects actually moved to other areas by collecting garbage in the young generation area 42a, that is, the survival amount YS is actually from the young generation area 42a to the old generation area 43 as shown in FIG. The amount (YP (= YSt) + YSe) obtained by adding the amount (YSe) of the object actually transferred from one region in the young generation region 42a to another region to the promotion amount YP (= YSt) that is the amount of the transferred object ).

生存率予測部25は、この生存量YSを受け取ると、先のステップ2でメモリ監視部22から受け取ったゴミ集め前の若い世代領域42aの使用量YUとこの生存量YSとから、ゴミ集め直前における若い世代領域42aのオブジェクト生存率SR(=YS/YU)を求め、これを記憶しておく(S14)。そして、今回求めたオブジェクト生存率SRと、過去4回のゴミ集めで求めたオブジェクト生存率SRとを統計処理して、次回のゴミ集め直前の若い世代領域42aの生存率ESRを予測する(S15)。この予測生存率ESRは、次回のゴミ集め処理のステップ1aで用いられる。   When the survival rate predicting unit 25 receives the survival amount YS, the survival rate predicting unit 25 immediately before collecting the garbage from the usage amount YU of the young generation area 42a before the garbage collection received from the memory monitoring unit 22 in the previous step 2 and the survival amount YS. The object survival rate SR (= YS / YU) of the young generation area 42a is obtained and stored (S14). Then, the object survival rate SR obtained this time and the object survival rate SR obtained in the past four garbage collections are statistically processed to predict the survival rate ESR of the young generation area 42a immediately before the next garbage collection (S15). ). This predicted survival rate ESR is used in step 1a of the next dust collection process.

また、昇進率予測部28は、ステップ13aで生存量YS及び昇進量YPを受け取ると、これらの値を用いて、若い世代領域42aの昇進率PR(=YP/YS)を求め、これを記憶しておく(S16)。そして、今回求めた昇進率PRと、過去4回のゴミ集めで求めた昇進率PRとを統計処理して、次回の若い世代領域42aのゴミ集めの際の昇進率EPRを予測する(S17)。この予測昇進率EPRは、次回のゴミ集め処理のステップ1aで用いられる。   Further, when the survival rate YS and the promotion amount YP are received in step 13a, the promotion rate prediction unit 28 obtains the promotion rate PR (= YP / YS) of the young generation region 42a using these values, and stores this. (S16). Then, the promotion rate PR obtained this time and the promotion rate PR obtained in the past four garbage collections are statistically processed to predict the promotion rate EPR at the time of the next garbage collection of the young generation region 42a (S17). . This predicted promotion rate EPR is used in step 1a of the next dust collection process.

なお、過去の生存率SRから予測生存率ESRを求める方法、過去の昇進率PRから予測昇進率EPRを求める方法は、第一の実施形態において、例示した各種統計処理方法が考えられる。   In addition, as the method for obtaining the predicted survival rate ESR from the past survival rate SR and the method for obtaining the predicted promotion rate EPR from the past promotion rate PR, the various statistical processing methods exemplified in the first embodiment can be considered.

次に、若い世代のゴミ集め処理(S6a,S7a)について説明する。   Next, the garbage collection process (S6a, S7a) of the young generation will be described.

この実施形態でも、ゴミ集め実行部21aは、若い世代のゴミ集め処理で、図4に示すように、初期化処理(S100)、ルート処理(S200)、スキャン処理(S300)を実行する。但し、初期化処理の内容、ルート処理及びスキャン処理でのコピー処理の内容が第一の実施形態と異なるので、以下では、これらの内容について説明する。   Also in this embodiment, the dust collection execution unit 21a performs the initialization process (S100), the route process (S200), and the scan process (S300) as shown in FIG. However, since the contents of the initialization process and the contents of the copy process in the route process and the scan process are different from those in the first embodiment, these contents will be described below.

初期化処理では、ゴミ集め実行部21aは、まず、第一の実施形態と同様に、大域変数のscan及びfreeを古い世代の空き領域OFの先頭アドレスとする。次に、図23に示すように、現在のfrom45をto46とし、現在のto46をfrom45とする。この結果、未使用の領域はfrom45からto46に変わる。そして、変数scan to及び変数free toを新たなto46の先頭アドレスとして、初期化処理を終了する。   In the initialization process, the garbage collection execution unit 21a first sets the global variables scan and free as the head address of the old generation free area OF, as in the first embodiment. Next, as shown in FIG. 23, the current from45 is set to to46, and the current to46 is set to from45. As a result, the unused area changes from from 45 to to 46. Then, the initialization process is terminated with the variable scan to and the variable free to as the start address of the new to 46.

ルート処理(S200)では、第一の実施形態と同様に、未処理のルートの値を引数としてコピー処理を呼び出し(図5、S203)、スキャン処理(S300)では、未処理のポインタの値を引数としてコピー処理を呼び出す(図7、S304)。   In the route process (S200), as in the first embodiment, the copy process is called with the unprocessed route value as an argument (FIG. 5, S203), and in the scan process (S300), the unprocessed pointer value is set. Copy processing is called as an argument (FIG. 7, S304).

このコピー処理(S400a)で、ゴミ集め実行部21aは、まず、第一の実施形態のコピー処理(図6、S400)と同様に、ルート処理又はスキャン処理からの引数をPに代入し(S401)、このPの値を先頭アドレスとするオブジェクトが移動済みであるか否かを判断する(S402)。Pを先頭アドレスとするオブジェクトが移動済みである場合には、Pを先頭アドレスとするオブジェクトの移動先フィールド53に格納されている値をコピー処理の戻り値として返して(S408)、コピー処理を終了する。   In this copy process (S400a), the dust collection execution unit 21a first substitutes an argument from the route process or the scan process into P, similarly to the copy process (FIG. 6, S400) of the first embodiment (S401). ), It is determined whether or not the object having the value of P as the head address has been moved (S402). If the object having P as the start address has been moved, the value stored in the destination field 53 of the object having P as the start address is returned as the return value of the copy process (S408), and the copy process is performed. finish.

一方、Pを先頭アドレスとするオブジェクトが移動済みでない場合には、このオブジェクトの年齢フィールド56aを参照して、このオブジェクトの年齢が予め定められた昇進年齢より大きいか否かを判断する(S410)。このオブジェクトの年齢が予め定められた昇進年齢より大きい場合、つまり、図23(a)に示すように、ゴミ集めの初期化処理前の若い世代領域42aのto46(初期化処理後のfrom45)に格納されているオブジェクトである場合、第一の実施形態のステップ403〜ステップ405と同様の処理を行う。すなわち、変数addrに、初期化処理で設定したfreeの値を代入し(S403)、Pを先頭アドレスとするオブジェクトをfreeが指すアドレスを先頭とする領域にコピーし(S404)、freeの値をコピーしたオブジェクトのサイズ分だけ大きくする(S405)。そして、このオブジェクトの年齢フィールド56aの値を0にする(S411)。   On the other hand, if the object having P as the head address has not been moved, it is determined whether or not the age of this object is greater than a predetermined promotion age with reference to the age field 56a of this object (S410). . When the age of this object is larger than a predetermined promotion age, that is, as shown in FIG. 23A, in to 46 (from 45 after the initialization process) of the young generation area 42a before the garbage collection initialization process. If the object is a stored object, the same processing as in step 403 to step 405 of the first embodiment is performed. That is, the value of free set in the initialization process is substituted into the variable addr (S403), the object having P as the head address is copied to the area starting with the address pointed to by free (S404), and the value of free is set. The size is increased by the size of the copied object (S405). Then, the value of the age field 56a of this object is set to 0 (S411).

一方、ステップ410の判断で、このオブジェクトの年齢が予め定められた昇進年齢より大きくない場合、つまり、図23(a)に示すように、ゴミ集めの初期化処理前の若い世代領域42aのEden44に格納されているオブジェクトである場合、変数addrに、初期化処理で設定したfree toの値を代入し(S403a)、Pを先頭アドレスとするオブジェクトをfree toが指すアドレスを先頭とする領域にコピーし(S404a)、free toの値をコピーしたオブジェクトのサイズ分だけ大きくする(S405a)。そして、このオブジェクトの年齢フィールド56aの値に1を加える(S411a)。   On the other hand, if it is determined in step 410 that the age of this object is not greater than the predetermined promotion age, that is, as shown in FIG. 23A, the Eden 44 of the young generation area 42a before the garbage collection initialization process is performed. If the object is stored in, the value of free to set in the initialization process is substituted into the variable addr (S403a), and the object having P as the head address is set to the area having the address pointed to by free to as the head. Copy (S404a) and increase the value of free to by the size of the copied object (S405a). Then, 1 is added to the value of the age field 56a of this object (S411a).

コピー元のオブジェクトの年齢フィールド56aの値を変更した後(S411,411a)は、第一の実施形態と同様に、ステップ406,470の処理を実行してコピー処理を終了する。   After changing the value of the age field 56a of the copy source object (S411, 411a), the processing of Steps 406 and 470 is executed and the copy processing is terminated as in the first embodiment.

以上のようなコピー処理(S400a)を含むルート処理及びスキャン処理が終了し、若い世代のゴミ集めが終了すると、図23に示すように、若い世代領域42aのEden44に格納されていた生存中のオブジェクトが若い世代領域42aのto46にコピーされ、Eden44は、生存していないオブジェクト又はコピー済みのオブジェクトのみになり、未使用領域として利用できるようになる。また、ゴミ集めの初期化処理前の若い世代領域42aのto46(初期化処理後のfrom45)に格納されているオブジェクトは、古い世代領域43の未使用領域に格納され、ゴミ集めの初期化処理前のto46、言い換えると、初期化処理後のfrom45は、生存していないオブジェクト又はコピー済みのオブジェクトのみになり、未使用領域として利用できるようになる。   When the root process and the scan process including the copy process (S400a) as described above are finished and the collection of garbage of the young generation is finished, as shown in FIG. 23, the living being stored in the Eden 44 of the young generation area 42a The object is copied to to 46 of the young generation area 42a, and the Eden 44 becomes only a non-living object or a copied object, and can be used as an unused area. The object stored in the to 46 (from 45 after the initialization process) of the young generation area 42a before the garbage collection initialization process is stored in the unused area of the old generation area 43, and the garbage collection initialization process is performed. The previous to 46, in other words, the after 45 after the initialization process is only an object that is not alive or a copied object, and can be used as an unused area.

ところで、この実施形態におけるスキャン処理では、図7を用いて説明した第一の実施形態のスキャン処理のステップ301,302,303,306で、各処理の「scan」を「scan to」にし、各処理の「free」を「free to」にした処理を行う。   By the way, in the scan processing in this embodiment, in steps 301, 302, 303, and 306 of the scan processing of the first embodiment described with reference to FIG. Performs processing with “free” set to “free to”.

また、若い世代のメモリ内容修正処理でも、図11に示す第一の実施形態の若い世代のメモリ内容修正処理を二点変更した処理を行う。第一点は、最初の処理において、ステップ711でEden44の先頭アドレスをSに代入する処理に変更し、ステップ712の判断では、SがEden44の使用中領域の最後のアドレス未満であるかを調べる処理に変更する点である。第二点は、次に実行する処理において、ステップ711でTo46の先頭アドレスをSに代入する処理に変更し、ステップ712の判断では、Sがto46の使用中領域の最後のアドレス未満であるかを調べる処理に変更する点である。   Further, even in the young generation memory content correction process, a process in which the young generation memory content correction process of the first embodiment shown in FIG. The first point is that in the first process, the process changes to the process of substituting the head address of Eden 44 for S in Step 711, and in the determination of Step 712, it is checked whether S is less than the last address of the used area of Eden 44. It is a point to change to processing. The second point is that in the process to be executed next, the process changes to the process of substituting the head address of To46 into S in Step 711. In the judgment of Step 712, is S less than the last address of the area in use of To46? It is a point which changes to the processing which investigates.

なお、以上の実施形態では、昇進年齢が常に一定であるとしたが、システムの実行状況によって昇進年齢を可変にすることも可能である。   In the above embodiment, the promotion age is always constant, but the promotion age can be made variable depending on the execution status of the system.

[第三の実施形態]
第三の実施形態について、図24を用いて説明する。
[Third embodiment]
A third embodiment will be described with reference to FIG.

本実施形態では、第一の実施形態のように、古い世代のゴミ集めをする際には、古い世代領域のゴミ集めのみを行わず、全世代のゴミ集めをする。   In the present embodiment, as in the first embodiment, when collecting the old generation of garbage, the collection of all generations of garbage is performed without collecting only the garbage of the old generation area.

このため、本実施形態のゴミ集め処理では、図24に示すように、第一の実施形態における図3に示すゴミ集め処理中の以下の二点が異なる。すなわち、第一点は、古い世代領域43の空き量OFと若い世代領域42の予測生存量ESとの大小関係を比較した後(S4)、古い世代領域43の空き量OFに対して若い世代領域42の予測生存量ESが大きければ、ゴミ集め実行部21に直ちに全世代領域のゴミ集めを実行させる(S5a)点である。第二点は、ゴミ集め実行部21に若い世代領域42のゴミ集めを実行させている最中に(S7)、古い世代領域43の空き量が十分に確保されなくなった場合(S8)、若い世代領域42のゴミ集めを中止させて(S9b)、ゴミ集め実行部21に直ちに全世代領域のゴミ集めを実行させる(S10)点である。   For this reason, in the dust collection process of this embodiment, as shown in FIG. 24, the following two points during the dust collection process shown in FIG. 3 in the first embodiment are different. That is, the first point is that after comparing the magnitude relationship between the free capacity OF of the old generation area 43 and the predicted survival amount ES of the young generation area 42 (S4), the young generation is compared with the free capacity OF of the old generation area 43. If the predicted survival amount ES of the area 42 is large, the garbage collection execution unit 21 immediately executes the collection of garbage for all generation areas (S5a). The second point is that when the garbage collection execution unit 21 is collecting garbage in the young generation area 42 (S7), if the free space in the old generation area 43 is not sufficiently secured (S8), it is young. The point is that collection of garbage in the generation area 42 is stopped (S9b), and the garbage collection execution unit 21 immediately executes collection of garbage in all generation areas (S10).

全世代領域のゴミ集め処理は、第一の実施形態の古い世代領域43のゴミ集めと同様に、Lisp2方式のアルゴリズムを用いたマークコンパクト方式を採用する。したがって、本実施形態における全世代領域のゴミ集め処理でも、図8に示すフローチャートに示す処理と同様に、マーク処理、移動先決定処理、メモリ内容修正処理、オブジェクト移動処理を行う。但し、本実施形態では、マーク処理及び移動先決定処理に関して、第一の実施形態と若干異なる。   The dust collection process for all generation areas employs a mark compact system using a Lisp2 algorithm, as in the old generation area 43 of the first embodiment. Therefore, also in the dust collection process for all generation areas in the present embodiment, the mark process, the move destination determination process, the memory content correction process, and the object move process are performed as in the process shown in the flowchart of FIG. However, the present embodiment is slightly different from the first embodiment with respect to the mark process and the movement destination determination process.

本実施形態のマーク処理の際には、全世代領域に存在するオブジェクトで、ルートから到達可能な全てのオブジェクの到達可能性フィールドにマークが付けられる。   In the mark processing of this embodiment, the reachability fields of all objects reachable from the root among the objects existing in all generation areas are marked.

また、本実施形態の移動先決定処理の際には、まず、図9に示すフローチャートに従って古い世代領域のオブジェクトの移動先を決定した後、同フローチャートに従って若い世代領域のオブジェクトの移動先を決定する。この場合、図9中のフローチャートのステップ601で、若い世代領域の先頭アドレスの値をPに代入し、freeに対する代入処理を行わない。さらに、ステップ602で、Pの値が若い世代領域の使用中の領域の後尾アドレス未満であるか否かを判断する。   In the migration destination determination process according to the present embodiment, first, the migration destination of the object in the old generation area is determined according to the flowchart shown in FIG. 9, and then the migration destination of the object in the young generation area is determined according to the flowchart. . In this case, in step 601 of the flowchart in FIG. 9, the value of the start address of the young generation area is substituted for P, and the substitution process for free is not performed. In step 602, it is determined whether or not the value of P is less than the tail address of the area in use of the young generation area.

第一の実施形態の古い世代領域43のゴミ集め処理の方法に以上のような変更を加えることで、全世代領域のゴミ集めが可能になる。   By adding the above-described changes to the method of collecting dust in the old generation area 43 of the first embodiment, it is possible to collect garbage in all generation areas.

以上、本実施形態では、若い世代領域のゴミ集め中に、古い世代領域の空き容量が不足した場合、若い世代領域のゴミ集めが中止されるものの、全世代領域のゴミ集めが実行されるので、基本的に第一の実施形態と同様の効果を得ることができる。   As described above, in this embodiment, if the free space in the old generation area becomes insufficient during the collection of garbage in the young generation area, the collection of garbage in all generation areas is executed although the collection of garbage in the young generation area is stopped. Basically, the same effects as those of the first embodiment can be obtained.

ここで、本実施形態の変形例について説明する。   Here, a modified example of the present embodiment will be described.

オブジェクトとしては、図2を用いて説明した第一の実施形態のように、到達可能性フィールド51及び移動済みフィールド52を有するものが考えられるが、これら二つのフィールド51,52が一つのフィールドで形成され、この一つのフィールドが到達可能性フィールドと移動済みフィールドとを兼ねる場合も考えられる。そこで、このような場合の対応方法について、第三の実施形態の変形例として、以下で説明する。   As the object, as in the first embodiment described with reference to FIG. 2, an object having the reachability field 51 and the moved field 52 can be considered. However, these two fields 51 and 52 are one field. It is also conceivable that this single field is both a reachability field and a moved field. Therefore, a method for dealing with such a case will be described below as a modification of the third embodiment.

この変形例でも、第三の実施形態と同様に、若い世代領域42のゴミ集めを実行させている最中に(S7)、古い世代領域43の空き量が十分に確保されなくなった場合(S8)、若い世代領域42のゴミ集めを中止させて(S9b)、ゴミ集め実行部21に直ちに全世代領域のゴミ集めを実行させる(S10)。但し、若い世代のゴミ集め中止(S9b)の後、再び、若い世代のゴミ集めを行う。この再度行う若い世代のゴミ集めでは、図6に示すコピー処理の際、ステップ402でPを先頭アドレスとするオブジェクトが移動済みでない場合、Pを戻り値としてコピー処理を終了する。そして、この再度の若い世代のゴミ集めが終了したら、若い世代領域に存在する全てのオブジェクトについて、到達可能性フィールド兼移動済みフィールドのマーク(移動済みを示すマーク)を消去する。   Also in this modified example, as in the third embodiment, when the garbage collection of the young generation area 42 is being performed (S7), the free space of the old generation area 43 is not sufficiently secured (S8). ) The garbage collection in the young generation area 42 is stopped (S9b), and the garbage collection execution unit 21 immediately executes the collection of garbage in all generation areas (S10). However, after the young generation garbage collection is stopped (S9b), the young generation garbage collection is performed again. In this young generation garbage collection performed again, if the object having P as the start address has not been moved in step 402 during the copy process shown in FIG. 6, the copy process is terminated with P as a return value. When the collection of garbage for the younger generation is completed again, the reachability field / moved field mark (mark indicating moved) is erased for all objects existing in the younger generation area.

また、全世代領域のゴミ集めでは、第三の実施形態と同様に、マーク処理、移動先決定処理、メモリ内容修正処理、オブジェクト移動処理を行う。これらの処理のうち、マーク処理及び移動先決定処理に関しては、第三の実施形態と同様である。   Further, in the collection of garbage in all generation areas, as in the third embodiment, mark processing, movement destination determination processing, memory content correction processing, and object movement processing are performed. Among these processes, the mark process and the movement destination determination process are the same as in the third embodiment.

メモリ内容修正処理における若い世代のメモリ内容修正処理では、第一の実施形態における若い世代のメモリ内容修正処理を行わず、図14に示す第一の実施形態の古い世代のメモリ内容修正処理の一部を変更した処理を行う。この若い世代のメモリ内容修正処理では、図14のフローチャート中、ステップ751で若い世代領域の先頭アドレスをPに代入し、ステップ752でPの値が若い世代領域の使用中領域の後尾アドレス未満であるか否かを判断する。その他の処理は、図14のフローチャートに示す処理と同様である。   In the memory content modification processing of the young generation in the memory content modification processing, the memory content modification processing of the younger generation in the first embodiment shown in FIG. The process which changed the part is performed. In this young generation memory content correction process, in step 751, the start address of the young generation area is substituted for P in step 751, and in step 752, the value of P is less than the end address of the use area of the young generation area. Judge whether there is. Other processes are the same as those shown in the flowchart of FIG.

また、各メモリ内容修正処理で呼び出される移動先取得処理では、図12に示すフローチャート中のステップ734,735,736を省略し、ステップ732で到達可能性フィールドにマークがないと判断した場合には、直ちに、ステップ737に進む処理を行う。   Further, in the destination acquisition process called in each memory content correction process, when steps 734, 735, and 736 in the flowchart shown in FIG. 12 are omitted and it is determined in step 732 that there is no mark in the reachability field. Immediately, the process proceeds to step 737.

[第四の実施形態]
第四の実施形態について、図25を用いて説明する。
[Fourth embodiment]
A fourth embodiment will be described with reference to FIG.

本実施形態は、第一の実施形態の変形例で、第三の実施形態に対するその変形例との関係のように、第一の実施形態におけるオブジェクト中の一つのフィールドが到達可能性フィールドと移動済みフィールドとを兼ねる場合の例である。   This embodiment is a modification of the first embodiment. As in the relationship with the modification of the third embodiment, one field in the object in the first embodiment is moved with the reachability field. This is an example in the case of serving as a completed field.

本実施形態は、古い世代領域に存在するオブジェクトでは、このオブジェクトの兼用フィールドを到達可能性フィールドとして利用し、若い世代領域に存在するオブジェクトでは、このオブジェクトの兼用フィールドを移動済みフィールドとして利用する。この区別を行うため、オブジェクトが若い世代領域と古い世代領域のどちらに属するかによって、到達可能性フィールドを検査する場合の処理に変更が加わる。さらに、メモリ内容修正処理では、第一の実施形態において、若い世代領域のオブジェクトの到達可能性フィールドにマークを付けることで移動先が更新済みであることを区別したが、本実施形態おいては、メモリ内容修正処理の完了点を示すポインタとオブジェクトのアドレスを比較することで、オブジェクトの移動先が更新済みであるかを区別する。それ以外のアルゴリズムについては第一の実施形態と同様である。そこで、以下、第一の実施形態との相違点のみについて説明する。   In this embodiment, an object existing in the old generation area uses the shared field of this object as the reachability field, and an object existing in the young generation area uses the shared field of this object as the moved field. In order to make this distinction, a change is made to the processing when the reachability field is checked depending on whether the object belongs to a young generation area or an old generation area. Furthermore, in the memory content correction process, in the first embodiment, it is distinguished that the destination has been updated by marking the reachability field of the object in the young generation area. By comparing the pointer indicating the completion point of the memory content correction process with the address of the object, it is discriminated whether or not the destination of the object has been updated. Other algorithms are the same as in the first embodiment. Therefore, only differences from the first embodiment will be described below.

図11に示す若い世代のメモリ内容修正処理では、この処理で用いる変数Sを大域変数として確保する。この大域変数Sは、メモリ内容修正処理がどの場所まで終了しているかを判定するために用いる。   In the young generation memory content correction process shown in FIG. 11, the variable S used in this process is secured as a global variable. This global variable S is used to determine where the memory content correction process has been completed.

また、各メモリ内容修正処理で呼び出される移動先取得処理では、図25のフローチャートに示す処理を行う。   In the destination acquisition process called in each memory content correction process, the process shown in the flowchart of FIG. 25 is performed.

ゴミ集め実行部21は、第一の実施形態と同様に、この移動先取得処理(S730c)で、Pへの引数代入(S731)、Pを先頭アドレスとするオブジェクトの兼用フィールドにマークが付いているか否かの調査(S732)を行う。マークが付いていない場合、第一の実施形態と異なり、直ちに、Pの値を戻り値とし(S737)、処理を終了する。つまり、この場合は、引数として与えられた値がそのまま戻り値になる。また、マークが付いている場合は、Pの値が前述の大域変数Sの値未満であるか、又は、Pの値が古い世代領域の先頭アドレス以上であるかを調べる(S738)。Pの値がSの値より小さい場合、Pを先頭アドレスとするオブジェトの兼用フィールドのマークは移動済みであることを表し、このオブジェクトの移動先フィールドが指す先はコンパクションによりこのオブジェクトが移動される先を示す。この場合、移動先は、移動先フィールドの値となる。また、Pが古い世代領域の先頭アドレス以上のときは、Pを先頭アドレスとするオブジェクトが古い世代領域に属するので、このオブジェクトの移動先フィールドの値がオブジェクトの移動先となる。   In the same way as in the first embodiment, the garbage collection execution unit 21 assigns an argument to P (S731) and marks the shared field of the object having P as the start address in this movement destination acquisition process (S730c). An investigation is made as to whether or not there is (S732). When the mark is not attached, unlike the first embodiment, the value of P is immediately set as a return value (S737), and the process ends. That is, in this case, the value given as an argument becomes the return value as it is. If it is marked, it is checked whether the value of P is less than the value of the global variable S described above or whether the value of P is equal to or greater than the start address of the old generation area (S738). When the value of P is smaller than the value of S, it indicates that the mark of the combined field of the object having P as the start address has been moved, and the destination indicated by the destination field of this object is moved by compaction. Indicates the destination. In this case, the destination is the value of the destination field. When P is equal to or greater than the top address of the old generation area, the object having P as the top address belongs to the old generation area, and the value of the destination field of this object becomes the destination of the object.

ステップ738の判断で、Pの値が前述の大域変数Sの値未満であるか、又は、Pの値が古い世代領域の先頭アドレス以上であると判断した場合には、このオブジェクトの移動先フィールドの値を戻り値とし(S733)、処理を終了する。また、Pの値が前述の大域変数Sの値未満ではなく、且つPの値が古い世代領域の先頭アドレス以上ではないと判断した場合には、このオブジェクトの移動先フィールドの値がこのオブジェクトの実体が存在する場所を示すので、このオブジェクトの移動先フィールドの値、つまり実体が存在する場所のアドレスを引数として、この処理自身を呼び出し(S735)、呼び出した処理からの戻り値を、この移動先取得処理での戻り値とし(S736)、処理を終了する。   If it is determined in step 738 that the value of P is less than the value of the global variable S described above, or the value of P is greater than or equal to the start address of the old generation area, the destination field of this object As a return value (S733), the process is terminated. If it is determined that the value of P is not less than the value of the global variable S and that the value of P is not greater than or equal to the start address of the old generation area, the value of the destination field of this object is the value of this object. Since this indicates the location where the entity exists, this process itself is called with the value of the destination field of this object, that is, the address of the location where the entity exists, as an argument (S735), and the return value from the called process is used as this movement. The return value in the previous acquisition process is used (S736), and the process is terminated.

以上の変更により、ブジェクト中の一つのフィールドが到達可能性フィールドと移動済みフィールドとを兼ねる場合でも、以上で説明した処理を除き、基本的に、第一の実施形態と同様の処理を行うことができる。   As a result of the above changes, even if one field in the object serves both as a reachability field and a moved field, the same processing as in the first embodiment is basically performed except for the processing described above. Can do.

本発明に係る第一の実施形態のコンピュータの機能構成を示す説明図である。It is explanatory drawing which shows the function structure of the computer of 1st embodiment which concerns on this invention. 本発明に係る第一の実施形態のオブジェクトのデータ構成を示す説明図である。It is explanatory drawing which shows the data structure of the object of 1st embodiment which concerns on this invention. 本発明に係る第一の実施形態のゴミ集め処理のフローチャートである。It is a flowchart of the dust collection process of 1st embodiment which concerns on this invention. 図3のフローチャート中の若い世代のゴミ集め処理のフローチャートである。FIG. 4 is a flowchart of a young generation garbage collection process in the flowchart of FIG. 3. 図4のフローチャート中のスキャン処理のフローチャートである。5 is a flowchart of scan processing in the flowchart of FIG. 4. 本発明に係る第一の実施形態のルート処理及びスキャン処理中のコピー処理のフローチャートである。It is a flowchart of the copy process during the route process and the scan process of the first embodiment according to the present invention. 図4のフローチャート中のルート処理のフローチャートである。It is a flowchart of the route process in the flowchart of FIG. 図3のフローチャート中の古い世代のゴミ集め処理のフローチャートである。It is a flowchart of the garbage collection process of the old generation in the flowchart of FIG. 図8のフローチャート中の移動先決定処理のフローチャートである。It is a flowchart of the movement destination determination process in the flowchart of FIG. 図8のフローチャート中のメモリ内容修正処理のフローチャートである。It is a flowchart of the memory content correction process in the flowchart of FIG. 図10のフローチャート中の若い世代のメモリ内容修正処理のフローチャートである。It is a flowchart of the memory content correction process of the young generation in the flowchart of FIG. 図11のフローチャート中の移動先取得処理のフローチャートである。It is a flowchart of the movement destination acquisition process in the flowchart of FIG. 図10のフローチャート中のルートのメモリ内容修正処理のフローチャートである。It is a flowchart of the memory content correction process of the route in the flowchart of FIG. 図10のフローチャート中の古い世代のメモリ内容修正処理のフローチャートである。It is a flowchart of the memory content correction process of the old generation in the flowchart of FIG. 図10のフローチャート中のオブジェクト移動処理のフローチャートである。It is a flowchart of the object movement process in the flowchart of FIG. 本発明に係る第一の実施形態で、若い世代領域と古い世代領域のいずれの領域をゴミ集めするかの判断を説明するための説明図である。It is explanatory drawing for demonstrating judgment of which area | region of a young generation area | region and an old generation area | region which collects garbage in 1st embodiment which concerns on this invention. 本発明に係る第一の実施形態でのゴミ集め実行過程でのヒープ領域の変化を示す説明図(その1)である。It is explanatory drawing (the 1) which shows the change of the heap area in the garbage collection execution process in 1st embodiment which concerns on this invention. 本発明に係る第一の実施形態でのゴミ集め実行過程でのヒープ領域の変化を示す説明図(その2)である。It is explanatory drawing (the 2) which shows the change of the heap area in the garbage collection execution process in 1st embodiment which concerns on this invention. 本発明に係る第二の実施形態のコンピュータの機能構成を示す説明図である。It is explanatory drawing which shows the function structure of the computer of 2nd embodiment which concerns on this invention. 本発明に係る第二の実施形態のオブジェクトのデータ構成を示す説明図である。It is explanatory drawing which shows the data structure of the object of 2nd embodiment which concerns on this invention. 本発明に係る第二の実施形態のゴミ集め処理のフローチャートである。It is a flowchart of the dust collection process of 2nd embodiment which concerns on this invention. 本発明に係る第二の実施形態のコピー処理のフローチャートである。It is a flowchart of the copy process of 2nd embodiment which concerns on this invention. 本発明に係る第二の実施形態で、若い世代領域と古い世代領域のいずれの領域をゴミ集めするかの判断を説明するための説明図である。It is explanatory drawing for demonstrating judgment of which area of a young generation area | region and an old generation area | region which collects garbage in 2nd embodiment which concerns on this invention. 本発明に係る第三の実施形態のゴミ集め処理のフローチャートである。It is a flowchart of the dust collection process of 3rd embodiment which concerns on this invention. 本発明に係る第四の実施形態の移動先取得処理のフローチャートである。It is a flowchart of the movement destination acquisition process of 4th embodiment which concerns on this invention.

符号の説明Explanation of symbols

10:コンピュータ、11:プロセッサ、12:仮想マシン、20,20a:ゴミ集め処理部、21,21a:ゴミ集め実行部、22:メモリ監視部、23:ゴミ集め制御部、24:予測生存量算出部、25:生存率予測部、26:生存量予測部、27:予測昇進量算出部、28:昇進率予測部、29:昇進量予測部、30:プログラムメモリ、31:仮想マシンプログラム、32:ゴミ集め処理(CG)プログラム、33:実行プログラム、40:データメモリ、41:ヒープ領域、42,42a:若い世代領域、43:古い世代領域、50:ヘッダ、51:到達可能性フィールド、52:移動済みフィールド、53:移動先フィールド、54:サイズフィールド、56,57,59:ポインタフィールド、56a:年齢フィールド、58:データ 10: Computer, 11: Processor, 12: Virtual machine, 20, 20a: Garbage collection processing unit, 21, 21a: Garbage collection execution unit, 22: Memory monitoring unit, 23: Garbage collection control unit, 24: Calculation of predicted survival amount Part: 25: survival rate prediction unit, 26: survival amount prediction unit, 27: predicted promotion amount calculation unit, 28: promotion rate prediction unit, 29: promotion amount prediction unit, 30: program memory, 31: virtual machine program, 32 : Garbage collection processing (CG) program, 33: execution program, 40: data memory, 41: heap area, 42, 42a: young generation area, 43: old generation area, 50: header, 51: reachability field, 52 : Moved field, 53: destination field, 54: size field, 56, 57, 59: pointer field, 56a: age field, 58: data

Claims (6)

メモリのヒープ領域を複数の世代別の領域に分け、各世代別の領域のゴミ集めを行うゴミ集め処理プログラムにおいて、
複数の世代の領域のゴミ集めを行うゴミ集め実行ステップと、
複数の世代の領域のうちの一つの世代の領域(以下、若い世代領域とする)に対するゴミ集め実行で、該若い世代領域に存在している1以上のオブジェクトのうちから生存中のオブジェクトを該若い世代領域よりも一つ古い世代の領域(以下、古い世代領域とする)へ移すオブジェクトの量を、過去のゴミ集め実績から予測する移動量予測ステップと、
前記古い世代領域の空き容量を計測する空き容量計測ステップと、
前記移動量予測ステップで予測された前記若い世代領域のオブジェクトの移動量が、前記空き容量計測ステップで計測された前記古い世代領域の空き容量より小さければ、該若い世代領域のゴミ集めを前記ゴミ集め実行ステップで実行させ、該若い世代領域のオブジェクトの移動量が該古い世代領域の空き容量以上であれば、該古い世代領域を含む領域のゴミ集めを該ゴミ集め実行ステップで実行させるゴミ集め制御ステップと、
を前記メモリを備えているコンピュータに実行させることを特徴とするゴミ集め処理プログラム。
In the garbage collection processing program that divides the memory heap area into multiple generation areas and collects garbage in each generation area,
Garbage collection execution step for collecting garbage from multiple generation areas,
By performing garbage collection for one generation area (hereinafter referred to as a young generation area) of a plurality of generation areas, a living object is selected from one or more objects existing in the young generation area. A movement amount prediction step for predicting the amount of an object to be moved to a generation area one older than a young generation area (hereinafter referred to as an old generation area) from past garbage collection results;
A free capacity measuring step for measuring the free capacity of the old generation area;
If the movement amount of the object in the young generation area predicted in the movement amount prediction step is smaller than the free space in the old generation area measured in the free capacity measurement step, the garbage collection in the young generation area is collected. If the movement amount of the object in the young generation area is greater than or equal to the free capacity of the old generation area, the garbage collection causes the area including the old generation area to be collected in the garbage collection execution step. Control steps;
A garbage collection processing program that causes a computer having the memory to execute.
請求項1に記載のゴミ集め処理プログラムにおいて、
前記ゴミ集め実行ステップでは、前記若い世代領域のゴミ集めの際には、該若い世代領域に存在している1以上のオブジェクトのうちから、生存中のオブジェクトを全て前記古い世代領域に移し、
前記移動量予測ステップは、
前記若い世代領域の使用量を計測する使用量計測ステップと、
ゴミ集め前のオブジェクトの領域使用量に対するゴミ集め後のオブジェクトの生存量の割合である生存率を、前記若い世代領域のゴミ集め実行毎に計測する生存率計測ステップと、
前記生存率計測ステップで計測された過去の生存率から次のゴミ集めの際の生存率を予測する生存率予測ステップと、
前記使用量計測ステップで計測された前記若い世代領域の使用量と前記生存量予測ステップで予測された前記生存率とから、該若い世代領域のオブジェクトの生存量を予測する生存量予測ステップと、を有し、
前記ゴミ集め制御ステップでは、前記生存量予測ステップで予測された前記若い世代領域のオブジェクトの生存量を、該若い世代領域のオブジェクトの移動量として、前記古い世代領域の空き容量と比較する、
ことを特徴とするゴミ集め処理プログラム。
In the garbage collection processing program according to claim 1,
In the garbage collection execution step, when collecting garbage in the young generation area, all the surviving objects are moved to the old generation area from one or more objects existing in the young generation area,
The movement amount prediction step includes:
A usage measuring step for measuring the usage of the young generation area;
A survival rate measuring step of measuring a survival rate, which is a ratio of a survival rate of an object after collecting garbage with respect to an area usage amount of the object before collecting garbage, for each execution of collecting garbage in the young generation region;
A survival rate prediction step of predicting a survival rate at the time of the next garbage collection from the past survival rate measured in the survival rate measurement step;
A survival amount prediction step for predicting a survival amount of an object in the young generation region from the usage amount of the young generation region measured in the usage amount measurement step and the survival rate predicted in the survival amount prediction step; Have
In the garbage collection control step, the survival amount of the object of the young generation region predicted in the survival amount prediction step is compared with the free capacity of the old generation region as the movement amount of the object of the young generation region.
A garbage collection program characterized by that.
請求項1に記載のゴミ集め処理プログラムにおいて、
前記ゴミ集め実行ステップでは、前記若い世代領域のゴミ集めの際には、該若い世代領域に存在している1以上のオブジェクトのうちから、予め定められた回数のゴミ集めで生き残ったオブジェクトのみを前記古い世代領域に移し、
前記移動量予測ステップは、
前記若い世代領域の使用量を計測する使用量計測ステップと、
ゴミ集め前のオブジェクトの領域使用量に対するゴミ集め後のオブジェクトの生存量の割合である生存率を、前記若い世代領域のゴミ集め実行毎に計測する生存率計測ステップと、
前記生存率計測ステップで計測された過去の生存率から次のゴミ集めの際の生存率を予測する生存率予測ステップと、
前記若い世代領域のオブジェクトの生存量に対する、前記若い世代領域のゴミ集めで前記古い世代領域に移るオブジェクトの昇進量の割合である昇進率を、該若い世代領域のゴミ集め実行毎に計測する昇進率計側ステップと、
前記昇進率計側ステップで計測された過去の昇進率から次のゴミ集めでの昇進率を予測する昇進率予測ステップと、
前記使用量計測ステップで計測された前記若い世代領域の使用量と前記生存量予測ステップで予測された前記生存率と前記昇進率予測ステップで予測された次のゴミ集めでの昇進率とから、次のゴミ集めでの昇進量を予測する昇進量予測ステップと、を有し、
前記ゴミ集め制御ステップでは、前記昇進量予測ステップで予測された前記若い世代領域のオブジェクトの昇進量を、該若い世代領域のオブジェクトの移動量として、前記古い世代領域の空き容量と比較する、
ことを特徴とするゴミ集め処理プログラム。
In the garbage collection processing program according to claim 1,
In the garbage collection execution step, when collecting garbage in the young generation area, only objects that have survived by a predetermined number of garbage collection are selected from one or more objects existing in the young generation area. Move to the old generation area,
The movement amount prediction step includes:
A usage measuring step for measuring the usage of the young generation area;
A survival rate measuring step of measuring a survival rate, which is a ratio of a survival rate of an object after collecting garbage with respect to an area usage amount of the object before collecting garbage, for each execution of collecting garbage in the young generation region;
A survival rate prediction step of predicting a survival rate at the time of the next garbage collection from the past survival rate measured in the survival rate measurement step;
Promotion that measures the promotion rate, which is the ratio of the amount of promotion of the object that moves to the old generation area by collecting the garbage of the young generation area to the survival amount of the object of the young generation area, every time the garbage collection of the young generation area is executed Rate meter side step,
A promotion rate prediction step of predicting a promotion rate in the next garbage collection from the past promotion rate measured in the promotion rate meter side step;
From the usage amount of the young generation area measured in the usage amount measurement step, the survival rate predicted in the survival amount prediction step, and the promotion rate in the next garbage collection predicted in the promotion rate prediction step, A promotion amount prediction step for predicting a promotion amount in the next garbage collection,
In the garbage collection control step, the promotion amount of the object of the young generation area predicted in the promotion amount prediction step is compared with the free capacity of the old generation area as the movement amount of the object of the young generation area.
A garbage collection program characterized by that.
請求項1から3のいずれか一項に記載のゴミ集め処理プログラムにおいて、
前記若い世代領域のゴミ集め実行中に、前記空き容量計測ステップにより前記古い世代領域の空き容量が該若い世代領域のゴミ集めに十分な量でなくなったことが計測されると、前記ゴミ集め制御ステップでは、前記ゴミ集め実行ステップに対して、前記若い世代領域のゴミ集めの実行を中断又は中止させ、前記古い世代領域を含む領域のゴミ集めを実行させる、
ことを特徴とするゴミ集め処理プログラム。
In the garbage collection processing program according to any one of claims 1 to 3,
When it is measured during the collection of garbage in the young generation area that the free capacity of the old generation area is not sufficient for collecting garbage in the young generation area, the garbage collection control is performed. In the step, with respect to the garbage collection execution step, execution of garbage collection of the young generation area is interrupted or stopped, and garbage collection of an area including the old generation area is executed.
A garbage collection program characterized by that.
メモリのヒープ領域を複数の世代別の領域に分け、各世代別の領域のゴミ集めを行うゴミ集め処理方法において、
複数の世代の領域のゴミ集めを行うゴミ集め実行工程と、
複数の世代の領域のうちの一つの世代の領域(以下、若い世代領域とする)に対するゴミ集め実行で、該若い世代領域に存在している1以上のオブジェクトのうちから生存中のオブジェクトを該若い世代領域よりも一つ古い世代の領域(以下、古い世代領域とする)へ移すオブジェクトの量を、過去のゴミ集め実績から予測する移動量予測工程と、
前記古い世代領域の空き容量を計測する空き容量計測工程と、
前記移動量予測工程で予測された前記若い世代領域のオブジェクトの移動量が、前記空き容量把握工程で計測された前記古い世代領域の空き容量より小さければ、該若い世代領域のゴミ集めを前記ゴミ集め実行工程で実行させ、該若い世代領域のオブジェクトの移動量が該古い世代領域の空き容量以上であれば、該古い世代領域を含む領域のゴミ集めを該ゴミ集め実行工程で実行させるゴミ集め制御工程と、
を含むことを特徴とするゴミ集め処理方法。
In the garbage collection processing method that divides the memory heap area into multiple generation areas and collects garbage in each generation area,
Garbage collection execution process to collect trash from multiple generation areas,
By performing garbage collection for one generation area (hereinafter referred to as a young generation area) of a plurality of generation areas, a living object is selected from one or more objects existing in the young generation area. A movement amount prediction step for predicting the amount of objects to be moved to a generation area one older than the young generation area (hereinafter referred to as an old generation area) from past garbage collection results;
A free capacity measuring step of measuring the free capacity of the old generation area;
If the movement amount of the object in the young generation area predicted in the movement amount prediction step is smaller than the free space in the old generation area measured in the free space grasping step, the garbage collection in the young generation region is collected. If the amount of movement of the object in the young generation area is greater than or equal to the free capacity of the old generation area, the garbage collection causes the area including the old generation area to be collected in the garbage collection execution process. Control process;
A garbage collection processing method comprising:
請求項5に記載のゴミ集め処理プログラムにおいて、
前記若い世代領域のゴミ集め実行中に、前記空き容量計測工程により前記古い世代領域の空き容量が該若い世代領域のゴミ集めに十分な量でなくなったことが計測されると、前記ゴミ集め制御工程では、前記ゴミ集め実行工程に対して、前記若い世代領域のゴミ集めの実行を中断又は中止させ、前記古い世代領域を含む領域のゴミ集めを実行させる、
ことを特徴とするゴミ集め処理方法。
In the garbage collection processing program according to claim 5,
When it is measured during the collection of garbage in the young generation area that the amount of free space in the old generation area is not sufficient for collecting garbage in the young generation area, the garbage collection control is performed. In the process, with respect to the garbage collection execution step, the execution of the garbage collection of the young generation area is interrupted or stopped, and the garbage collection of the area including the old generation area is executed.
A method for collecting and processing garbage.
JP2006031552A 2006-02-08 2006-02-08 Garbage collection processing program and method Pending JP2007213252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006031552A JP2007213252A (en) 2006-02-08 2006-02-08 Garbage collection processing program and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006031552A JP2007213252A (en) 2006-02-08 2006-02-08 Garbage collection processing program and method

Publications (1)

Publication Number Publication Date
JP2007213252A true JP2007213252A (en) 2007-08-23

Family

ID=38491638

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006031552A Pending JP2007213252A (en) 2006-02-08 2006-02-08 Garbage collection processing program and method

Country Status (1)

Country Link
JP (1) JP2007213252A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014044472A (en) * 2012-08-24 2014-03-13 Fujitsu Ltd Information processing method, program and device for garbage collection
US9323772B2 (en) 2012-10-05 2016-04-26 Samsung Electronics Co., Ltd. Segment group-based segment cleaning apparatus and methods for storage units

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014044472A (en) * 2012-08-24 2014-03-13 Fujitsu Ltd Information processing method, program and device for garbage collection
US9323772B2 (en) 2012-10-05 2016-04-26 Samsung Electronics Co., Ltd. Segment group-based segment cleaning apparatus and methods for storage units

Similar Documents

Publication Publication Date Title
KR100567082B1 (en) Methods and apparatus for generational dynamic management of computer memory
US7167881B2 (en) Method for heap memory management and computer system using the same method
TWI438633B (en) Garbage collection method of memory management, computer program product thereof, and apparatus thereof
US7953711B2 (en) Method and system for hybrid garbage collection of multi-tasking systems
US11099982B2 (en) NUMA-aware garbage collection
EP0969377B1 (en) Method of replication-based garbage collection in a multiprocessor system
CN103377162B (en) Signal conditioning package
US9229858B2 (en) Concurrent garbage collector thread
US20060173939A1 (en) Garbage collection and compaction
KR20050067203A (en) Maintaining an average erase count in a non-volatile storage system
TW200422830A (en) Maintaining erase counts in non-volatile storage systems
JPH0695954A (en) Computer system for conservative stack and generational heap-garbage collection and method thereof
US7783683B2 (en) Computer-readable storage medium storing generational garbage collection program
JPH113269A (en) System and method for assisting accurate garbage collection by separating contents of stack into sub-stacks
EP2151752A1 (en) Thread ordering techniques
JPWO2009063614A1 (en) Memory controller, nonvolatile memory module, access module, and nonvolatile memory system
TW405090B (en) Predictive cache loading by program address discontinuity history
WO2008016081A1 (en) Memory controller, nonvolatile memory device, access device, and nonvolatile memory system
US8397045B2 (en) Memory management device, memory management method, and memory management program
US11221947B2 (en) Concurrent garbage collection with minimal graph traversal
JP2014044472A (en) Information processing method, program and device for garbage collection
JP2009026081A (en) Memory management method, information processor, and memory management program
JPH05274152A (en) Object management system
US20100228796A1 (en) Memory management of soft references
US8589456B2 (en) Prompt large object reclamation