JP2011085985A - Memory management method, memory management program, and information processor - Google Patents
Memory management method, memory management program, and information processor Download PDFInfo
- Publication number
- JP2011085985A JP2011085985A JP2009236257A JP2009236257A JP2011085985A JP 2011085985 A JP2011085985 A JP 2011085985A JP 2009236257 A JP2009236257 A JP 2009236257A JP 2009236257 A JP2009236257 A JP 2009236257A JP 2011085985 A JP2011085985 A JP 2011085985A
- Authority
- JP
- Japan
- Prior art keywords
- memory area
- generation
- area
- profiling
- equal
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0253—Garbage collection, i.e. reclamation of unreferenced memory
- G06F12/0261—Garbage collection, i.e. reclamation of unreferenced memory using reference counting
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、メモリ管理方法、メモリ管理プログラム、及び、情報処理装置に関するものである。 The present invention relates to a memory management method, a memory management program, and an information processing apparatus.
Java(登録商標)言語の処理系であるJava仮想マシン(以下、「JavaVM」という。「VM」は「Virtual Machine」の略。)は、ガベージコレクタを実装している。ガベージコレクタは、JavaVMがオブジェクトを格納するために確保するメモリ領域(以下、「Javaヒープ領域」という。)を管理し、プログラム実行中に動的に生成したオブジェクト(が割当てられたメモリ領域)のうち、不要になったオブジェクト(が割当てられたメモリ領域)をガベージコレクション(以下、「GC」という。「GC」は、「garbage collection」の略。)によって動的に解放する(自動解放機能)。説明の便宜上、メモリ領域の解放を、そのメモリ領域に格納されているオブジェクトの解放として説明する場合がある。 A Java virtual machine (hereinafter referred to as “JavaVM”; “VM” is an abbreviation of “Virtual Machine”), which is a processing system of the Java (registered trademark) language, implements a garbage collector. The garbage collector manages the memory area (hereinafter referred to as “Java heap area”) that JavaVM reserves for storing objects, and dynamically creates objects (memory areas to which objects are allocated) during program execution. Among them, objects that are no longer needed (the memory area to which they are allocated) are dynamically released by garbage collection (hereinafter referred to as “GC”; “GC” is an abbreviation for “garbage collection”) (automatic release function) . For convenience of explanation, the release of the memory area may be described as the release of the object stored in the memory area.
このGCの方式の1つに、世代別GCがある。GCの方式として世代別GCを採用しているJavaVMでは、Javaヒープ領域をNew領域とOld領域のように世代別に分けている。さらに、New領域をEden領域とSurvivor領域に、Survivor領域をFrom領域とTo領域のように分けている。 One of the GC methods is generational GC. In JavaVM that uses generational GC as the GC method, the Java heap area is divided into generations, such as the New area and Old area. Furthermore, the New area is divided into an Eden area and a Survivor area, and the Survivor area is divided into a From area and a To area.
プログラム実行中に動的に生成されたオブジェクトは、最初、Eden領域に格納される。Eden領域が枯渇した場合には、ガベージコレクタが、アプリケーションプログラムの実行停止時間が短時間で済む、New領域のみを対象としたCopyGCを実行する。このCopyGCでは、レジスタ、実行時スタック、グローバル変数といったルートセットからオブジェクト参照を順次辿ることによって到達可能なオブジェクトのうち、Eden領域に格納されたオブジェクト、及び、From領域に格納されたオブジェクトをコピー先の領域にコピーする。ここで、コピー先の領域は、コピー対象のオブジェクトが一定回数以上のCopyGCを経たオブジェクト、即ち、長命なオブジェクトの場合にはOld領域である。また、一定回数以上のCopyGCを経ていないオブジェクト、即ち、まだ長命であるか否かわからないオブジェクトの場合にはTo領域である。そして、コピーされることのなかったオブジェクトを不要なオブジェクトとして解放する。なお、CopyGCの終了後には、次回のCopyGCに備え、From領域とTo領域の役割を交代する。 Objects created dynamically during program execution are initially stored in the Eden area. When the Eden area is depleted, the garbage collector executes CopyGC for the New area only, which requires only a short time to stop executing the application program. In this copy garbage collection, the objects stored in the Eden area and the objects stored in the From area among the objects that can be reached by sequentially tracing object references from the root set such as registers, runtime stacks, and global variables are copied to Copy to the area. Here, the copy destination area is an Old area when the object to be copied has undergone CopyGC more than a certain number of times, that is, a long-lived object. In addition, the To region is used for an object that has not passed CopyGC more than a certain number of times, that is, an object that is not yet long-lived. Then, an object that has not been copied is released as an unnecessary object. Note that after the end of CopyGC, the roles of the From area and To area are changed in preparation for the next CopyGC.
他方、Old領域が枯渇した場合には、ガベージコレクタが、アプリケーションプログラムの実行停止時間が長時間に及ぶ、New領域とOld領域の両方を含む全領域を対象としたFullGCを実行する。このFullGCでは、ルートセットからオブジェクト参照を順次辿ることによって到達可能なオブジェクトに対して、プログラムの実行に必要なオブジェクトであることを示す印をつけていく。そして、ルートセットから到達可能なオブジェクトを全て辿った後で、印のついていないオブジェクトを不要なオブジェクトとして解放する。 On the other hand, when the Old area is depleted, the garbage collector executes FullGC for the entire area including both the New area and the Old area where the execution stop time of the application program is long. In this FullGC, objects that can be reached by sequentially tracing object references from the root set are marked as being necessary for program execution. Then, after all the reachable objects are traced from the root set, the objects not marked are released as unnecessary objects.
近年、先に説明したJava を基盤としたシステム(以下、「Javaシステム」という。)は、金融系や基幹系といった24時間、365日、正常に機能し続けなければならない等のミッションクリティカルな分野でも利用されることが多くなっている。また、Javaシステムは大規模化、複雑化の傾向にあり、扱うデータ量も増加している。しかし、Javaヒープ領域を大きくすると、ガベージコレクタが処理しなければならないデータ量も多くなるため、GCの発生による業務プログラムの実行停止時間が長時間化する傾向にある。そのため、JavaシステムにおけるGCの発生、特に、FullGCの発生が大きな問題の1つになっている。 In recent years, the Java-based system described above (hereinafter referred to as “Java system”) is a mission-critical field that must continue to function normally for 24 hours, 365 days, such as the financial and mission critical systems. But it is increasingly used. Java systems are also becoming larger and more complex, and the amount of data handled is also increasing. However, if the Java heap area is increased, the amount of data that the garbage collector must process increases, so the business program execution stop time tends to increase due to the occurrence of GC. Therefore, the occurrence of GC in the Java system, especially the occurrence of FullGC, is one of the major problems.
この問題を解決する方法として、特許文献1に開示されている方法が知られている。特許文献1に開示されている方法では、JavaVMは、GCによるオブジェクト解放の対象となるJavaヒープ領域の他に、GCによらないオブジェクト解放の対象となるヒープ領域(以下、「外部ヒープ領域」という。)を有する。外部ヒープ領域は、プログラム開発者によるメモリ管理が可能な領域であり、外部ヒープ領域に対するオブジェクトの生成、及び、解放は、プログラム開発者によるプログラムソースコード記述に従うようになっている。即ち、ガベージコレクタによる自動メモリ管理に対して、プログラムソースコード記述による明示的なメモリ管理(以下、「明示メモリ管理」という。)を行うことができる。
As a method for solving this problem, a method disclosed in
プログラム開発者は、外部ヒープ領域内の外部ヒープにオブジェクトを生成するようプログラムソースコードを記述することによって、プログラム実行中、必要に応じて外部ヒープが確保され、その外部ヒープにオブジェクトが生成される。また、外部ヒープに格納されたオブジェクトを解放するため、その外部ヒープを解放するようプログラムソースコードを記述することによって、外部ヒープの解放が実行される。外部ヒープの解放では、解放対象の外部ヒープに以降のプログラム実行において必要なオブジェクトが存在するか否かをチェックする。チェックの結果、必要なオブジェクトが存在しない場合には、その外部ヒープを解放する。また、必要なオブジェクトが存在する場合には、解放対象の外部ヒープとは別のヒープ領域にそのオブジェクトを移動した上で、その外部ヒープを解放する。そして、外部ヒープを解放することによって、その外部ヒープに格納されたオブジェクトをGCによらず解放する。長命なオブジェクトを外部ヒープに確保、及び、外部ヒープで解放することによって、Old領域の使用量が抑えられ、Old領域の枯渇によるFullGCの発生を抑止することができる。 The program developer writes the program source code to generate an object in the external heap in the external heap area, so that the external heap is secured as needed during program execution, and the object is generated in the external heap. . Moreover, in order to release the object stored in the external heap, the external heap is released by writing the program source code so as to release the external heap. In releasing the external heap, it is checked whether or not an object necessary for subsequent program execution exists in the external heap to be released. If the required object does not exist as a result of the check, the external heap is released. If a necessary object exists, the object is moved to a heap area different from the external heap to be released, and then the external heap is released. Then, by releasing the external heap, the objects stored in the external heap are released regardless of the GC. By securing a long-lived object in the external heap and releasing it in the external heap, the usage amount of the Old area can be suppressed, and the occurrence of FullGC due to the exhaustion of the Old area can be suppressed.
Old領域の枯渇によるFullGCの発生を抑止するために外部ヒープ領域を利用する場合、プログラム開発者は、プログラム実行時のオブジェクトの寿命を推定し、外部ヒープ領域に格納すべき長命なオブジェクトが外部ヒープ領域に格納されるように、プログラムソースコードを記述する必要がある。しかし、オジェクトの寿命を推定するためには、プログラム実行時のオブジェクトの参照関係に基づくオブジェクトのライフサイクルを考慮する必要があり、高度な知識と経験が必要である。
また、Javaシステムの大規模化や複雑化、複数人分担によるプログラム開発、及び、プログラムソースコードに記述されていない暗黙的なオブジェクト生成とオブジェクト参照の存在といった様々な理由によって、プログラム開発者が、プログラム実行時に動的に変化するオブジェクトの参照関係を予め把握することは極めて困難である。そのため、外部ヒープ領域に格納すべき長命なオブジェクトであっても、実際は外部ヒープ領域に格納できていないオブジェクトが存在する可能性がある。逆に、このようなオブジェクトを動的に検出し外部ヒープ領域に格納できれば、FullGCの発生をさらに抑止できる。
When using an external heap area to prevent the occurrence of FullGC due to the depletion of the Old area, the program developer estimates the lifetime of the object when the program is executed, and the long-lived object to be stored in the external heap area is the external heap. It is necessary to write program source code to be stored in the area. However, in order to estimate the life of an object, it is necessary to consider the life cycle of the object based on the reference relationship of the object at the time of program execution, and advanced knowledge and experience are required.
In addition, for various reasons such as the large scale and complexity of Java systems, program development by sharing of multiple people, and the existence of implicit object generation and object references not described in the program source code, the program developer It is extremely difficult to grasp in advance the reference relationship of objects that dynamically change during program execution. Therefore, even a long-lived object that should be stored in the external heap area may actually be an object that cannot be stored in the external heap area. Conversely, if such an object can be detected dynamically and stored in the external heap area, the occurrence of FullGC can be further suppressed.
本発明の目的は、外部ヒープ領域に格納すべき長命なオブジェクトの多くを動的に検出できるようにすること、それらオブジェクトを外部ヒープ領域に格納できるようにすることである。 An object of the present invention is to make it possible to dynamically detect many long-lived objects to be stored in the external heap area and to store these objects in the external heap area.
上記目的を達成するために、本発明は、Javaシステムのような、メモリ管理機構を備える言語処理実行システムにおいて、まず、FullGCによってOld領域で解放される長命なオブジェクトの参照関係を解析することで、参照関係のルートに当たるオブジェクト(以下、「起点オブジェクト」という。)を動的に検出する。次に、オブジェクト生成命令ごとに、そのオブジェクト生成命令によって生成した起点オブジェクトがFullGCによってOld領域で解放される割合をプロファイリングすることで、長命な起点オブジェクトを生成しているオブジェクト生成命令を検出する。そして、長命な起点オブジェクトを生成しているオブジェクト生成命令については、そのオブジェクト生成先を外部ヒープに変更し、起点オブジェクトを外部ヒープ領域に生成するようにする。さらに、起点オブジェクトから参照されているオブジェクト(以下、「メンバオブジェクト」という。)について、メンバオブジェクトがCopyGCによるNew領域からOld領域への移動対象となった場合には、起点オブジェクトが解放されることによって一緒に解放される割合の高いメンバオブジェクトを起点オブジェクトと同じ外部ヒープに移動させる。
このようにして、外部ヒープ領域に格納すべき長命なオブジェクトを外部ヒープ領域に格納することができるので、GCの発生、特に、FullGCの発生を抑止することができる。
詳細は後記する。
In order to achieve the above object, the present invention, in a language processing execution system having a memory management mechanism such as a Java system, first analyzes the reference relationship of a long-lived object released in the Old area by FullGC. The object corresponding to the root of the reference relationship (hereinafter referred to as “starting object”) is dynamically detected. Next, for each object generation instruction, profiling the rate at which the starting object generated by the object generation instruction is released in the Old area by FullGC, thereby detecting the object generation instruction generating the long-lived starting object. Then, for an object generation instruction that generates a long-lived starting point object, the object generation destination is changed to the external heap, and the starting point object is generated in the external heap area. Furthermore, for an object referenced from the origin object (hereinafter referred to as “member object”), the origin object is released when the member object is moved from the New area to the Old area by CopyGC. Move the member objects that are released at a high rate to the same external heap as the origin object.
In this way, since a long-lived object to be stored in the external heap area can be stored in the external heap area, the occurrence of GC, in particular, the occurrence of FullGC can be suppressed.
Details will be described later.
本発明によれば、外部ヒープ領域に格納すべき長命のオブジェクトの多くを動的に検出し、実際に外部ヒープ領域に格納することができる。 According to the present invention, many long-lived objects to be stored in the external heap area can be dynamically detected and actually stored in the external heap area.
以下、本発明を実施するための形態として、JavaVMを例に、適宜図面を参照して詳細に説明する。
図1は、本発明の実施の形態のJavaVMが動作する計算機システム101の構成、及び、入出力データを示す図である。
Hereinafter, as a mode for carrying out the present invention, a Java VM will be described as an example in detail with reference to the drawings as appropriate.
FIG. 1 is a diagram showing a configuration of a computer system 101 on which Java VM according to the embodiment of this invention operates, and input / output data.
計算機システム(情報処理装置)101では、Java言語によって記述されたJavaソースファイル104がJavaコンパイラ109によってコンパイルされることによって、JavaVM110がインタプリタ実行により解釈、及び、実行可能な形式であるバイトコードで記述されたJavaクラスファイル103が生成される。さらに、Javaクラスファイル103がJavaVM110によって実行されることで、所定の業務処理が実行される。従って、Javaクラスファイル103は、前記所定の業務処理を実行するためのプログラムといえる。
In the computer system (information processing apparatus) 101, the Java source file 104 described in the Java language is compiled by the
計算機システム101は、プロセッサ(制御部)129、主記憶(記憶部)107、補助記憶(記憶部)102、入力装置130、及び、出力装置131といったハードウェア資源を含む。プロセッサ129、主記憶107、補助記憶102、入力装置130、及び、出力装置131は、バス128を介して互いに接続される。
The computer system 101 includes hardware resources such as a processor (control unit) 129, a main storage (storage unit) 107, an auxiliary storage (storage unit) 102, an
プロセッサ129は、主記憶107に記憶された各種プログラムを実行することによって各種処理を実行する。
主記憶107は、プログラム、プログラムの実行に必要な情報、及び、プログラムの処理結果を記憶する。主記憶107は、揮発性メモリであってもよいし、不揮発性メモリであってもよい。主記憶107は、Javaコンパイラ109、JavaVM110、データ領域108、及び、オペレーティングシステム127を記憶する。
The
The
補助記憶102は、業務処理の実行に使用されるJavaクラスファイル103、このJavaクラスファイル103を生成するためのJavaソースファイル104、オブジェクト解析情報126の保存に使用されるオブジェクト解析情報ファイル105、及び、JavaVM110の動作を制御するフラグやパラメータの閾値を記録する設定ファイル106を含む。
The auxiliary storage 102 includes a
入力装置130は、計算機システム101に必要な情報を入力するためのインタフェースである。入力装置130は、例えば、キーボード、又は、マウスなどである。
出力装置131は、処理結果などの情報を外部に出力する装置である。出力装置131は、例えば、ディスプレイなどである。
The
The
データ領域108は、プログラムの実行に必要な情報、及び、プログラムの処理結果が記憶される領域である。データ領域108は、メソッドのバイトコードであるバイトコード情報112、GC対象のオブジェクト格納領域であるJavaヒープ領域(第1のメモリ領域)115、GC対象外のオブジェクト格納領域である外部ヒープ領域(第2のメモリ領域)116、及び、オブジェクトの生成に係る情報やオブジェクトのプロファイリングに係る情報などであるオブジェクト解析情報126を含む。外部ヒープ領域116は、さらに、外部ヒープ1(117)、外部ヒープ2(118)、外部ヒープ3(119)、・・・といったように、外部ヒープ領域116内で必要に応じて確保と解放が可能な領域を含む。
The
ここで、主記憶107に記憶されるJavaVM110について説明する。JavaVM110は、不要になったメモリ領域を動的に解放するメモリ管理機構を備える言語処理実行システムである。
Here, the
JavaVM110は、バイトコード読み込み部111、オブジェクト生成先変更部113、メソッド実行部114、メモリ管理部120、及び、オブジェクト解析部125を含む。バイトコード読み込み部111、オブジェクト生成先変更部113、メソッド実行部114、メモリ管理部120、及び、オブジェクト解析部125は、プロセッサ129によって実行されるプログラムである。
The
バイトコード読み込み部111は、JavaVM110が受け付けたJavaクラスファイル103からメソッドのバイトコードを読み込み、データ領域108に当該メソッドに係るバイトコード情報112を生成する。その際、オブジェクト生成先変更部113を実行することによってバイトコード情報112に存在するオブジェクト生成命令のオブジェクト生成先を変更する場合や、バイトコード情報112に係るオブジェクト解析情報126を生成、更新する場合がある。バイトコード読み込み部111の処理の詳細は、図13で説明する。
The
オブジェクト生成先変更部113は、オブジェクト生成情報テーブル301(図4参照)を参照して、オブジェクト生成命令に係るオブジェクト生成先を、適宜、Javaヒープ領域115から外部ヒープ領域116に変更する。オブジェクト生成先変更部113の処理の詳細は、図14で説明する。
The object generation
メソッド実行部114は、バイトコード情報112の各命令に従い、メソッドを実行する。そして、次に実行する命令がオブジェクト生成命令の場合には、オブジェクト生成部121にオブジェクト生成処理を要求する(オブジェクト生成処理要求)。メソッド実行部114は、最初、メソッドをインタプリタ実行する。一方、インタプリタ実行において実行頻度が高いメソッドについては、バイトコード情報112の命令列を動的にコンパイルし、メソッドをコンパイルコード実行する。なお、メソッド実行部114は、最初から最後までメソッドをインタプリタ実行してもよいし、最初からコンパイルコード実行してもよい。また、メソッド実行部114が、メソッドをコンパイルコード実行している途中で、バイトコード情報112が書き換えられた場合、メソッド実行部114は、メソッドをコンパイルコード実行するのを止め、インタプリタ実行に一旦戻り処理を継続する場合もある。メソッド実行部114の処理の詳細は、図15で説明する。
The
メモリ管理部120は、JavaVM110で使用するメモリ領域を管理する。メモリ管理部120は、オブジェクト生成部121、及び、GC部122を含む。
The
オブジェクト生成部121は、メソッド実行部114からのオブジェクト生成処理要求を受け付けると、オブジェクト生成処理要求の内容に従い、Javaヒープ領域115、又は、外部ヒープ領域116へのオブジェクト生成を試みる。ここで、オブジェクトを生成する領域に空きがあり、オブジェクト生成に成功した場合には、生成したオブジェクトを呼び元に返却する。
一方、Javaヒープ領域115に空きがなく、Javaヒープ領域115へのオブジェクト生成に失敗した場合には、GC部122にGC処理を要求し(GC処理要求)、GC部122がGC処理を実行し、Javaヒープ領域115で不要になったメモリ領域を解放する。そして、再びオブジェクト生成を試み、さらに失敗した場合にはメモリ不足エラーを発生させる。
また、外部ヒープ領域116に空きがなく、外部ヒープ領域116へのオブジェクト生成に失敗した場合には、Javaヒープ領域115へのオブジェクト生成を試みる。さらにJavaヒープ領域115へのオブジェクト生成にも失敗した場合には、GC部122にGC処理を要求し、GC部122がGC処理を実行し、Javaヒープ領域115で不要になったメモリ領域を解放する。そして、再びオブジェクト生成を試み、さらに失敗した場合にはメモリ不足エラーを発生させる。
When the
On the other hand, when there is no free space in the
If there is no free space in the
なお、オブジェクト生成部121は、生成したオブジェクトに対し、当該オブジェクト生成命令によって生成されたオブジェクトであることを識別するためのオブジェクトIDを生成したオブジェクトに記録し、当該オブジェクト生成命令によってオブジェクトを生成したことをオブジェクトプロファイリング情報テーブル302(図5参照)に記録する場合がある。オブジェクト生成部121の処理の詳細は、図16で説明する。
The
GC部122は、CopyGC部124、及び、FullGC部123を含む。GC部122は、オブジェクト生成部121からのGC処理要求を受け付けると、New領域が枯渇している場合にはCopyGC部124、Old領域が枯渇している場合にはFullGC部123に対して、実際のGC処理を要求する。GC部122の処理の詳細は、図16で説明する。
The
CopyGC部124は、GC部122からのGC処理要求を受け付けると、Javaヒープ領域115内のNew領域のみを対象としたCopyGCを実行する。その際、CopyGCによってJavaヒープ領域115のNew領域からOld領域の移動対象となったオブジェクトをNew領域から外部ヒープ117(外部ヒープ領域116内に確保した外部ヒープの一つであり、「外部ヒープ1」と称する場合もある。)に移動させる場合や、不要な外部ヒープ117を解放する場合、及び、オブジェクト生成先変更部113を実行することによってバイトコード情報112に存在するオブジェクト生成命令のオブジェクト生成先を変更する場合がある。CopyGC部124の処理の詳細は、図21で説明する。
When the
FullGC部123は、GC部122からのGC処理要求を受け付けると、Javaヒープ領域115内のNew領域とOld領域を含む、GC対象の全領域を対象としたFullGCを実行する。その際、オブジェクト解析部125を実行し、オブジェクトプロファイリング処理を実行する場合がある。FullGC部123の処理の詳細は、図18で説明する。
When receiving the GC processing request from the
オブジェクト解析部125は、FullGCによってOld領域で解放される長命なオブジェクトの参照関係を解析することで、参照関係のルートに当たる起点オブジェクトを動的に検出する。そして、オブジェクト生成命令ごとに、そのオブジェクト生成命令によって生成した起点オブジェクトがFullGCによってOld領域で解放された回数をプロファイリングする。また、起点オブジェクトから参照されているメンバオブジェクトについて、起点オブジェクトが解放されたことによってメンバオブジェクトも一緒に解放された回数をプロファイリングする。オブジェクト解析部125の処理の詳細は、図19で説明する。
The
なお、JavaVM110は、動作を制御するためのフラグ(以下、「設定フラグ」という。)やパラメータの閾値(以下、「設定閾値」という。)をもつ。そして、設定フラグや設定閾値のデフォルト値は、設定ファイル106や入力装置130で指定することによって変更することができる。
The
JavaVM110は、FullGCによってOld領域で解放される長命なオブジェクトの参照関係を解析することで、外部ヒープ領域116に格納すべきオブジェクトを検出し、それらオブジェクトを外部ヒープ領域116に格納していくことで、FullGCを抑止していく。一方、FullGCによってOld領域で解放される長命なオブジェクトの参照関係の解析結果を記録したオブジェクト解析情報ファイル105を使用し、設定フラグによるJavaVM110の動作変更によって、外部ヒープ領域116に格納すべきオブジェクトを検出するためのオブジェクトプロファイリングを行わないようにし、JavaVM110の起動時からFullGCを抑止した状態で実行してもよい。
The
図2は、Java言語により記述されたJavaソースファイル104の例を示す図である。
1行目から17行目は、Sampleクラスの内容を示している。
3行目から9行目、及び、11行目から15行目は、それぞれ、methodA()メソッド、及び、methodB()メソッドの処理の内容を示している。
5行目、及び、13行目は、クラスの型がClassAであるオブジェクトをJavaヒープ領域115に生成することをnew演算子により指示している。また、6行目は、クラスの型がClassZであるオブジェクトをJavaヒープ領域115に生成することをnew演算子により指示している。これにより、例えばmethodA()を5回実行すると、クラスの型がClassAであるオブジェクトが5個、クラスの型がClassZであるオブジェクトが5個、それぞれ生成される。さらにmethodB()を10回実行すると、クラスの型がClassAであるオブジェクトがもう10個生成される。
FIG. 2 is a diagram illustrating an example of the Java source file 104 described in the Java language.
The third to ninth lines and the eleventh to fifteenth lines indicate the contents of the processing of the methodA () method and the methodB () method, respectively.
ここで、methodA()とmethodB()の実行により、クラスの型が同じClassAであるオブジェクトが生成されるが、methodA()の5行目で生成を指示されたオブジェクトと、methodB()の13行目で生成を指示されたオブジェクトとでは、クラスの型が同じClassAであっても同じようなオブジェクトの寿命になるとは限らない。一方、methodA()の実行により、methodA()の5行目で生成を指示された5個のオブジェクトについては、methodA()の同じ処理により生成されたオブジェクトであるため、同じようなオブジェクトの寿命になる可能性が高いと言える。 Here, by executing methodA () and methodB (), an object having the same class type, ClassA, is generated, but the object instructed for generation in the fifth line of methodA () and 13 of methodB () For an object that is instructed to generate on the line, even if the class type is the same ClassA, the lifetime of the same object is not necessarily the same. On the other hand, the five objects that are instructed to be generated in the fifth line of methodA () by the execution of methodA () are objects generated by the same process of methodA (), and therefore, the lifetime of similar objects. It can be said that there is a high possibility of becoming.
オブジェクトプロファイリングでは、クラスの型が同じであっても、オブジェクトの生成を指示された場所が異なるオブジェクトは区別することで、より詳細にオブジェクトをプロファイリングすることができる。 In object profiling, even if the class type is the same, it is possible to profile objects in more detail by distinguishing objects that differ in the location where the generation of the object is directed.
図3は、本発明の実施の形態のオブジェクト解析情報126の一例を示す図である。
オブジェクト解析情報126は、バイトコード情報112に係るオブジェクト解析の情報を格納しており、オブジェクト生成情報テーブル301、オブジェクトプロファイリング情報テーブル302、及び、メンバオブジェクト情報303を含む。メンバオブジェクト生成情報テーブル301、オブジェクトプロファイリング情報テーブル302、及び、メンバオブジェクト情報303の詳細は、それぞれ、図4、図5、及び、図6で説明する。
FIG. 3 is a diagram illustrating an example of the
The
図4は、本発明の実施の形態のオブジェクト生成情報テーブル301の一例を示す図である。
オブジェクト生成情報テーブル301の各行は、オブジェクト生成命令に係る情報を格納しており、オブジェクト生成命令アドレス401、オブジェクトID(Identifier)402、クラス名403、及び、オブジェクト生成先404を含む。
FIG. 4 is a diagram illustrating an example of the object generation information table 301 according to the embodiment of this invention.
Each row of the object generation information table 301 stores information related to an object generation command, and includes an object
オブジェクト生成命令アドレス401は、オブジェクト生成命令の位置を格納する。オブジェクト生成命令の位置は、例えば、図2に示すJavaソースファイル104の例におけるnew演算子のようなオブジェクト生成指示に対応するバイトコード情報112内のオブジェクト生成命令が存在するアドレスである。なお、オブジェクト解析情報126をオブジェクト解析情報ファイル105に保存する場合など、オブジェクト生成命令の位置は、バイトコード情報112の先頭からオブジェクト生成命令が存在する位置までのオフセットで示される場合もある。
The object
オブジェクトID402は、オブジェクト生成命令ごとに割当てられる一意の値を格納する。そして、オブジェクトプロファイリング処理の対象であるオブジェクトのオブジェクトIDフィールド702(図7参照)に、当該オブジェクトを生成したオブジェクト生成命令に係るオブジェクトID402が格納される。これにより、オブジェクトがどのオブジェクト生成命令によって生成されたかを判別できる。例えば、図2に示すJavaソースファイル104の例において、5行目で生成を指示されたクラスの型がClassAであるオブジェクトと13行目で生成を指示されたクラスの型がClassAであるオブジェクトでは、オブジェクトヘッダ701に格納されたオブジェクトIDが#0、#4といったように異なる。一方、5行目で生成を指示されたクラスの型がClassAであるオブジェクトが複数存在しても、オブジェクトの生成を指示された位置が同じであるオブジェクトでは、オブジェクトIDが#0といったように同じになる。
The
クラス名403は、オブジェクト生成命令によって生成されるオブジェクトのクラスの型の名前を格納する。
The
オブジェクト生成先404は、オブジェクト生成命令によって生成されるオブジェクトの生成先を格納する。オブジェクトの生成先は、初期状態では“Javaヒープ領域”となっているが、オブジェクト生成先変更部113によって、オブジェクトプロファイリング処理の結果に応じて“外部ヒープ1”などに変更される。また、オブジェクトの生成先は、“Javaヒープ固定”にすることで、オブジェクト生成先変更部113によって変更されないようにしたり、“指定外部ヒープ”にしたりすることで、明示メモリ管理API(明示メモリ管理を実行するAPIをいう。「API」は、「application programming interface」の略。)によって指定された外部ヒープにしたりすることも可能である。なお、明示メモリ管理APIによって指定された外部ヒープに生成されたオブジェクトは、明示メモリ管理APIによって解放され、不要な外部ヒープ117ごと自動的に解放されることはない。オブジェクトプロファイリング処理の詳細は、図19で説明する。
The
図5は、本発明の実施の形態のオブジェクトプロファイリング情報テーブル302の一例を示す図である。
オブジェクトプロファイリング情報テーブル302は、オブジェクトID402に係るオブジェクトについてのオブジェクトプロファイリング処理の結果を格納しており、オブジェクトID501、オブジェクト生成回数502、オブジェクトプロファイリング回数503、及び、メンバオブジェクト情報アドレス504を含む。
FIG. 5 is a diagram illustrating an example of the object profiling information table 302 according to the embodiment of this invention.
The object profiling information table 302 stores the result of the object profiling process for the object associated with the
オブジェクトID501は、オブジェクト生成情報テーブル301の行データとオブジェクトプロファイリング情報テーブル302の行データを結びつけるためのオブジェクトIDを格納する。このオブジェクトIDをキーとした検索により、このオブジェクトIDによって識別されるオブジェクトについてのオブジェクト生成情報テーブル301の行データとオブジェクトプロファイリング情報テーブル302の行データが参照可能である。ここで、例えば、オブジェクト生成情報テーブル301の行データに対するオブジェクトプロファイリング情報テーブル302の行データを予め用意する場合、オブジェクト生成情報テーブル301の行データとオブジェクトプロファイリング情報テーブル302の行データは1対1に対応するため、オブジェクト生成情報テーブル301とオブジェクトプロファイリング情報テーブル302を1つのテーブルにまとめてしまってもよい。また、オブジェクトプロファイリング情報テーブル302のために確保するメモリ領域を節約するために、オブジェクトID402で識別されるオブジェクトが初めて生成されたとき、オブジェクト生成情報テーブル301の行データに対するオブジェクトプロファイリング情報テーブル302の行データを登録するようにしてもよい。なお、本発明の実施の形態の一例では、オブジェクト生成情報テーブル301の行データに対するオブジェクトプロファイリング情報テーブル302の行データを予め用意するが、便宜上、オブジェクト生成情報テーブル301とオブジェクトプロファイリング情報テーブル302を別々のテーブルとして示す。
The
オブジェクト生成回数502は、オブジェクトID501で識別されるオブジェクトをオブジェクトID501に係るオブジェクト生成命令によって実際に生成した回数を格納する。
The
オブジェクトプロファイリング回数503は、オブジェクトID501で識別されるOld領域に格納してあるオブジェクトがFullGCによって解放された回数、つまり、オブジェクトID501で識別されるオブジェクトに対して、オブジェクトプロファイリング処理を実行した回数を格納する。オブジェクトプロファイリング処理の詳細は、図19で説明する。
The object profiling count 503 stores the number of times the object stored in the Old area identified by the
メンバオブジェクト情報アドレス504は、オブジェクトID501で識別されるオブジェクトに係るメンバオブジェクト情報303のアドレスを格納する。メンバオブジェクト情報303の詳細は、図6で説明する。
The member
図6は、本発明の実施の形態のメンバオブジェクト情報303の一例を示す図である。
メンバオブジェクト情報303は、オブジェクトプロファイリング処理によってプロファイリングされたオブジェクトの参照関係の状況についての情報を格納しており、起点オブジェクトについての情報を格納するデータ構造(以下、「起点オブジェクトデータ構造」という。)、及び、メンバオブジェクトについての情報を格納するデータ構造(以下、「メンバオブジェクトデータ構造」という。)を含む。起点オブジェクトは、オブジェクトプロファイリング処理の起点となるOld領域に格納してあるオブジェクトであり、前回のFullGCの終了後から今回のFullGCの開始前までの間に、ルートセットや必要オブジェクトから参照されなくなったオブジェクト、又は、ルートセットや必要オブジェクトから参照されなくなった可能性の高いオブジェクトである。また、メンバオブジェクトは、起点オブジェクトからオブジェクト参照を順次辿ることによって到達可能なオブジェクトのうち、起点オブジェクトがFullGCによって解放されることによって一緒に解放されるオブジェクト、又は、一緒に解放される可能性の高いオブジェクトである。オブジェクトプロファイリング処理の詳細は、図19で説明する。
FIG. 6 is a diagram showing an example of
The
本発明の実施の形態の一例では、メンバオブジェクト情報303は、起点オブジェクトデータ構造601、及び、メンバオブジェクトデータ構造602〜607がポインタによって接続された木構造として示す。また、図6において、起点オブジェクトデータ構造は二重線の長方形で示し、メンバオブジェクトデータ構造は一重線の長方形で示す。
In an example of the embodiment of the present invention, the
起点オブジェクトデータ構造601は、起点オブジェクトから参照先メンバオブジェクトへの参照関係の状況を記録するために、メンバオブジェクトに対応するメンバオブジェクトデータ構造へのポインタをオブジェクト参照フィールドごとに格納する。例えば、本発明の実施の形態の一例は、起点オブジェクトデータ構造601が、メンバオブジェクトデータ構造602、及び、メンバオブジェクトデータ構造603をポインタによって接続していることを示す。
The origin
メンバオブジェクトデータ構造602〜607は、メンバオブジェクトから参照先メンバオブジェクトの参照関係の状況を記録するために、参照先メンバオブジェクトに対応するメンバオブジェクトデータ構造へのポインタをオブジェクト参照フィールドごとに格納する。例えば、本発明の実施の形態の一例は、メンバオブジェクトデータ構造603が、メンバオブジェクトデータ構造605とメンバオブジェクトデータ構造606をポインタによって接続していることを示す。なお、ポインタ608は、クラスの型がClassFであるオブジェクトにオブジェクト参照フィールドは存在するが、そのオブジェクト参照フィールドによって参照しているオブジェクトは記録されていないことを示す(NULL)。
The member
また、メンバオブジェクトデータ構造602〜607は、メンバオブジェクトのクラスの型の名前と、起点オブジェクトがFullGCによって解放されたことによってメンバオブジェクトも一緒に解放された回数、つまり、起点オブジェクトに対してオブジェクトプロファイリング処理を実行したときに、メンバオブジェクトに対してもオブジェクトプロファイリング処理を実行した回数(以下、「メンバオブジェクトプロファイリング回数」という。)を格納する。例えば、本発明の実施の形態の一例は、起点オブジェクトデータ構造601によって示される起点オブジェクトがFullGCによって解放されたことによってメンバオブジェクトデータ構造605によって示されるClassEのメンバオブジェクトも一緒に解放された回数が2回であることを示す。
ここで、ポインタに付された数字は、便宜上のメンバオブジェクト適合率を示す。メンバオブジェクト適合率は、起点オブジェクトがFullGCによって解放されたことによってメンバオブジェクトも一緒に解放された割合である。例えば、メンバオブジェクトデータ構造606によって示されるClassFのメンバオブジェクト適合率は、メンバオブジェクトデータ構造601によって示されるClassAの起点オブジェクトが4回解放されたうちClassFのメンバオブジェクトは3回解放されたので、0.75になる。また、メンバオブジェクトデータ構造607によって示されるClassGのメンバオブジェクト適合率は、メンバオブジェクトデータ構造601によって示されるClassAの起点オブジェクトが4回解放されたうちClassGのメンバオブジェクトは1回解放されたので、0.25になる。
また、破線の囲み線はメンバオブジェクト適合率が0.6である便宜上の境界を示しており、破線で囲まれた内側は、メンバオブジェクト適合率が0.6以上であることを示している。
The member
Here, the number attached to the pointer indicates the member object relevance ratio for convenience. The member object conformance rate is a rate at which the member object is released together with the origin object being released by FullGC. For example, the membership rate of the ClassF member object indicated by the member
Further, a broken line indicates a convenient boundary where the member object matching rate is 0.6, and an inner side surrounded by the broken line indicates that the member object matching rate is 0.6 or more.
なお、メンバオブジェクト情報アドレス504には、メンバオブジェクト情報303のアドレスとして、起点オブジェクトデータ構造のアドレスが格納される。例えば、本発明の実施の形態の一例は、オブジェクトID501に格納されているオブジェクトIDが#4であるオブジェクトに対するメンバオブジェクト情報アドレス504に、起点オブジェクトデータ構造601のアドレスである0x81b2e23cが格納されていることを示す。また、本発明の実施の形態では一例として、起点オブジェクトデータ構造601がオブジェクトID(下付き数字の「4」)、オブジェクトのクラスの型の名前(ClassA)、プロファイリングの実行回数(括弧内の数字の「4」)を格納するように便宜上記載してある。
The member
図7は、本発明の実施の形態のオブジェクトプロファイリング用オブジェクトのデータ構造の一例を示す図である。オブジェクトプロファイリング用オブジェクトは、オブジェクトヘッダ701、オブジェクトIDフィールド702、及び、オブジェクトデータ703から構成される。オブジェクトプロファイリング用オブジェクトとは、オブジェクトプロファイリング処理の対象となるオブジェクトである。
FIG. 7 is a diagram illustrating an example of the data structure of the object profiling object according to the embodiment of this invention. The object profiling object includes an
オブジェクトヘッダ701は、オブジェクトの管理情報である。
オブジェクトIDフィールド702は、オブジェクトを識別するためのオブジェクトIDを格納する。このオブジェクトIDは、当該オブジェクトを生成したオブジェクト生成命令に係るオブジェクトID402である。なお、オブジェクトプロファイリング処理の対象ではない通常オブジェクトのデータ構造は、オブジェクトヘッダ701とオブジェクトデータ703で構成される。また、オブジェクトプロファイリング処理の対象であっても、オブジェクトヘッダ701の空き領域やオブジェクトデータ703、及び、オブジェクトのデータ構造以外の領域にオブジェクトIDを格納するなどしてオブジェクトを識別できれば、オブジェクトIDフィールドのための領域を別途確保する必要はない。
オブジェクトデータ703は、オブジェクトのデータ本体である。
The
The
The
なお、オブジェクトへのポインタの下位数ビットは、オブジェクトヘッダ701のサイズに応じて0とすることができるため、ビットフラグとして使用可能である。例えば、オブジェクトヘッダ701のサイズが8バイトである場合、オブジェクトへのポインタの下位3ビットは0になる。本発明の実施の形態では、オブジェクトへのポインタの下位数ビットをビットフラグとして使用する場合がある。
Note that the lower-order bits of the pointer to the object can be set to 0 according to the size of the
図8は、本発明の実施の形態のオブジェクト種別ビットの一例を示す図である。
オブジェクト種別ビット802の値は、オブジェクト種別801に対応する。本発明の実施の形態では、オブジェクトヘッダ701に含まれる2ビットをオブジェクト種別ビットとして使用する。
FIG. 8 is a diagram illustrating an example of the object type bit according to the embodiment of this invention.
The value of the
具体的には、オブジェクト種別ビット802が“00”の場合には、GC処理やオブジェクトプロファイリング処理において未解析なオブジェクトである“未解析”オブジェクトであることを示す。
また、オブジェクト種別ビット802が“01”の場合には、FullGC処理においてプログラムの実行に必要なオブジェクトであると判定済みの“必要”オブジェクトであることを示す。
同様に、オブジェクト種別ビット802が“10”の場合には、オブジェクトプロファイリング処理の起点となるオブジェクトであり、前回のFullGCから今回のFullGCまでの間に、必要オブジェクトから参照されなくなったオブジェクト、又は、必要オブジェクトから参照されなくなった可能性の高いオブジェクトである“起点”オブジェクトであることを示す。
さらに、オブジェクト種別ビット802が“11”の場合には、起点オブジェクトからオブジェクト参照を順次辿ることによって到達可能なオブジェクトのうち、起点オブジェクトがFullGCによって解放されることによって一緒に解放されるオブジェクト、又は、一緒に解放される可能性の高いオブジェクトである“メンバ”オブジェクトであることを示す。
Specifically, when the
Further, when the
Similarly, when the
Further, when the
図9は、本発明の実施の形態の外部ヒープ117のデータ構造の一例を示す図である。外部ヒープ117は、外部ヒープヘッダ901、オブジェクト格納領域902から構成される。
外部ヒープヘッダ901は、オブジェクトの管理情報であり、外部ヒープ117に格納された起点オブジェクトを生成したオブジェクト生成命令に係るメンバオブジェクト参照情報アドレス504に格納されたメンバオブジェクト情報303のアドレスを格納する。
オブジェクト格納領域902は、オブジェクトを格納するための領域である。
FIG. 9 is a diagram illustrating an example of a data structure of the
The
The
図13は、本発明の実施の形態のバイトコード読み込み処理の手順を示すフローチャートである。本処理は、プロセッサ129がバイトコード読み込み部111を処理することによって、実行される。なお、図10〜図12に関する説明は後記する。
FIG. 13 is a flowchart showing a procedure of byte code reading processing according to the embodiment of the present invention. This process is executed when the
プロセッサ129がバイトコード読み込み部111を実行すると、バイトコード読み込み部111は、まず、JavaVM110が受け付けたJavaクラスファイル103からメソッドのバイトコードを読み込み、データ領域108に当該メソッドに係るバイトコード情報112を生成する(ステップ1301)。
When the
ステップ1301の処理の終了後には、JavaVM110の設定フラグを参照し、バイトコード読み込み処理時に、当該メソッドに係るバイトコード情報112に存在するオブジェクト生成命令のオブジェクト生成先を変更するか否かを判定する(ステップ1302)。
After the processing of
オブジェクト生成先を変更する場合には(ステップ1302の結果が「YES」)、JavaVM110が受け付けたオブジェクト解析情報ファイル105に保存してある当該メソッドに係るオブジェクト解析情報の実行結果をオブジェクト解析情報126に読み込み、当該メソッドに係るオブジェクトプロファイリング情報テーブル302に登録された行データで示されるオブジェクトに対して、オブジェクト生成先変更部113を実行し、オブジェクト生成先変更処理を実行する(ステップ1303)。
When the object generation destination is changed (the result of
オブジェクト生成先を変更しない場合(ステップ1302の結果が「NO」)、又は、ステップ1303の処理が終了した場合には、JavaVM110の設定フラグを参照し、オブジェクトプロファイリングを行うか否かを判定する(ステップ1304)。
When the object generation destination is not changed (the result of
オブジェクトプロファイリングを行う場合には(ステップ1304の結果が「YES」)、ステップ1301の処理で生成したバイトコード情報112に係るオブジェクト解析情報126を生成し、バイトコード情報112に存在する全てのオブジェクト生成命令について、オブジェクト生成命令のアドレス、オブジェクト生成命令に割り当てられる一意のオブジェクトID、及び、オブジェクト生成命令で生成されるオブジェクトのクラス名を、それぞれ、オブジェクト生成命令アドレス401、オブジェクトID402、及び、クラス名403に登録する(更新も含む)。さらに、オブジェクト生成先404を“Javaヒープ領域”で登録する(ステップ1305)。ただし、ステップ1303の処理で、JavaVM110が受け付けたオブジェクト解析情報ファイル105に保存してある当該メソッドに係るオブジェクト解析情報の実行結果をオブジェクト解析情報126に反映しているオブジェクト生成命令については、ステップ1305の処理を行わない。
When performing object profiling (the result of
オブジェクトプロファイリングを行わない場合(ステップ1304の結果が「NO」)、又は、ステップ1305の処理の終了後には、本処理を終了する。
When object profiling is not performed (the result of
図14は、本発明の実施の形態のオブジェクト生成先変更処理1303の手順を示すフローチャートである。本処理は、プロセッサ129がオブジェクト生成先変更部113を処理することによって、実行される。
FIG. 14 is a flowchart illustrating a procedure of object generation
プロセッサ129がオブジェクト生成先変更部113を実行すると、オブジェクト生成先変更部113は、まず、処理対象のオブジェクトプロファイリングテーブル302について、オブジェクトID501に未処理のオブジェクトIDが存在するか否かを判定する(ステップ1401)。
When the
オブジェクトID501に未処理のオブジェクトIDが存在する場合には(ステップ1401の結果が「YES」)、当該オブジェクトIDで識別されるオブジェクトのオブジェクト生成回数502が、JavaVM110の設定閾値(第1の閾値)以上であるか否かを判定する(ステップ1402)。このステップ1402では、オブジェクト生成先を変更するか否かを判定するのに十分な回数のオブジェクト生成が実施済みか否かを判定する。例えば、オブジェクト生成回数の設定閾値が1000回の場合、オブジェクトID501が#0であるオブジェクト生成命令は、オブジェクト生成回数502が5872回であることから(図5参照)、オブジェクト生成先を変更するか否かを判定するのに十分な回数のオブジェクト生成を実施済みと判定できる。一方、オブジェクトID501が#104であるオブジェクト生成命令は、オブジェクト生成回数502が950回であることから(図5参照)、オブジェクト生成先を変更するか否かを判定するのに十分な回数のオブジェクト生成を実施済みでないと判定できる。
When there is an unprocessed object ID in the object ID 501 (the result of
オブジェクト生成回数502が設定閾値以上である場合には(ステップ1402の結果が「YES」)、当該オブジェクトIDに係るオブジェクト生成回数502に対するオブジェクトプロファイリング回数503が、JavaVM110の設定閾値(第2の閾値)以上であるか否かを判定する(ステップ1403)。このステップ1403では、当該オブジェクトIDに係るオブジェクト生成命令によって生成されたオブジェクトが、FullGCによって解放された割合の高さ、つまり、当該オブジェクト生成命令によって生成されたオブジェクトが、外部ヒープ領域に格納すべき長命なオブジェクトになる割合の高さに基づき、当該オブジェクト生成命令のオブジェクト生成先を外部ヒープ領域に変更するべきか否かを判定する。例えば、オブジェクト生成回数に対するオブジェクトプロファイリング回数の設定閾値(割合)が0.50の場合、オブジェクトID501が#0であるオブジェクト生成命令によって生成されたオブジェクトは5872個であり(図5参照)、そのうち、5830個がFullGCによって解放されたので、FullGCによって解放された割合は0.99であり、設定閾値より大きいので、当該オブジェクト生成命令のオブジェクト生成先を外部ヒープ領域に変更するべきと判定できる。一方、オブジェクトID501が#103であるオブジェクト生成命令によって生成されたオブジェクトは10281個であり、そのうち、237個がFullGCによって解放されたので、FullGCによって解放された割合は0.02であり、設定閾値0.50より小さいので、当該オブジェクト生成命令のオブジェクト生成先を外部ヒープ領域に変更するべきではないと判定できる。
If the
オブジェクト生成回数502に対するオブジェクトプロファイリング回数503が設定閾値以上である場合には(ステップ1403の結果が「YES」)、オブジェクト生成情報テーブル301を参照して、当該オブジェクトIDに係るオブジェクト生成先404を“Javaヒープ領域”以外の、例えば、“外部ヒープ領域1”に変更する(ステップ1404)。
If the
オブジェクト生成回数502が設定閾値以上でない場合(ステップ1402の結果が「NO」)、オブジェクト生成回数502に対するオブジェクトプロファイリング回数503が設定閾値以上でない場合(ステップ1403の結果が「NO」)、又は、ステップ1404の処理の終了後には、ステップ1401の処理に戻る。そして、未処理のオブジェクトIDに対して、本処理の実行を継続する。
If the
オブジェクトID501に未処理のオブジェクトIDが存在しない場合には(ステップ1401の結果が「NO」)、本処理を終了する。なお、ステップ1402やステップ1403の判定では、当該オブジェクトIDに係るオブジェクトのクラスサイズなどに応じて、比較対象値に重み付けを行ってもよい。
If there is no unprocessed object ID in the object ID 501 (the result of
図15は、本発明の実施の形態のメソッド実行処理の手順を示すフローチャートである。本処理は、プロセッサ129がメソッド実行部114を処理することによって、実行される。
バイトコード読み込み部111が生成した実行対象メソッドに係るバイトコード情報112は、一つ以上の命令を含み、各命令には、命令種別が付与されている。
FIG. 15 is a flowchart illustrating a procedure of method execution processing according to the embodiment of this invention. This process is executed when the
The
プロセッサ129がメソッド実行部114を実行すると、メソッド実行部114は、まず、実行対象のメソッドの命令種別がオブジェクト生成命令であるか否かを判定する(ステップ1501)。
When the
命令種別がオブジェクト生成命令でない場合には(ステップ1501の結果が「NO」)、当該命令を実行する(ステップ1504)。
命令種別がオブジェクト生成命令である場合には(ステップ1501の結果が「YES」)、オブジェクト生成部121を実行し、オブジェクト生成処理を実行する(ステップ1502)。
If the instruction type is not an object generation instruction (the result of
If the instruction type is an object generation instruction (the result of
ステップ1502の処理の終了後には、オブジェクトの生成に成功したか否かを判定する(ステップ1503)。
オブジェクトの生成に失敗した場合には(ステップ1503の結果が「NO」)、メソッドの実行を中断し、メモリ不足エラーを発生させる(ステップ1505)。
After the processing in
If the object generation has failed (the result of
オブジェクトの生成に成功した場合(ステップ1503の結果が「YES」)、又は、ステップ1504の処理の終了後には、次に実行すべき命令があるか否かを判定する(ステップ1506)。
次に実行すべき命令がある場合には(ステップ1506の結果が「YES」)、ステップ1501の処理を実行し、メソッド実行処理を継続する。
If the object has been successfully generated (the result of
If there is an instruction to be executed next (the result of
次に実行すべき命令がない、つまり、すべての命令の処理が終了した場合には(ステップ1506の結果が「NO」)、又は、ステップ1505の処理の終了後には、本処理を終了する。
If there is no instruction to be executed next, that is, if all the instructions have been processed (the result of
図16は、本発明の実施の形態のオブジェクト生成処理1502の手順を示すフローチャートである。本処理は、プロセッサ129がオブジェクト生成部121を処理することによって、実行される。
FIG. 16 is a flowchart showing a procedure of
プロセッサ129がオブジェクト生成部121を実行すると、オブジェクト生成部121は、まず、生成を要求されたオブジェクトを生成するのに必要な量のメモリを当該オブジェクト生成命令に係るオブジェクト生成先404(図4参照)に格納されたオブジェクト生成先に確保可能であるか否かを判定する。オブジェクト生成先が外部ヒープ領域116であり、生成を要求されたオブジェクトを生成するのに必要な量のメモリを外部ヒープ領域116に確保可能でない場合には、さらに、生成を要求されたオブジェクトを生成するのに必要な量のメモリをJavaヒープ領域115に確保可能であるか否かを判定する。(ステップ1601)。
When the
生成を要求されたオブジェクトを生成するのに必要な量のメモリをオブジェクト生成先に確保できない場合には(ステップ1601の結果が「NO」)、Javaヒープ領域115の不要なメモリ領域を解放するために、GC部122を実行し、GC処理を実行する(ステップ1602)。
When an amount of memory necessary for generating the object requested to be generated cannot be secured in the object generation destination (the result of
ステップ1602の処理の実行後、生成を要求されたオブジェクトを生成するのに必要な量のメモリをJavaヒープ領域115に確保可能であるか否かを再び判定する(ステップ1603)。
After the execution of the processing in
生成を要求されたオブジェクトを生成するのに必要な量のメモリをJavaヒープ領域115に確保できない場合には(ステップ1603の結果が「NO」)、オブジェクト生成処理の実行元にオブジェクト生成に失敗した旨を通知する(ステップ1611)。
If the amount of memory required to generate the object requested to be generated cannot be secured in the Java heap area 115 (the result of
生成を要求されたオブジェクトを生成するのに必要な量のメモリをオブジェクト生成先に確保可能な場合には(ステップ1601、又は、ステップ1603の結果が「YES」)、今回のオブジェクト生成先がどこであるかを判定する(ステップ1604)。
When the amount of memory necessary for generating the object requested to be generated can be secured in the object generation destination (the result of
今回のオブジェクト生成先がJavaヒープ領域115である場合には(ステップ1604の結果が「Javaヒープ領域」)、JavaVM110の設定フラグを参照し、オブジェクトプロファイリングを行うか否かを判定する(ステップ1606)。
If the current object generation destination is the Java heap area 115 (the result of
オブジェクトプロファイリングを行う場合には(ステップ1606の結果が「YES」)、オブジェクトプロファイリング用オブジェクトをJavaヒープ領域115に生成し、当該オブジェクト生成命令によって生成されたオブジェクトであることを識別するための当該オブジェクト生成命令に係るオブジェクトID402を当該オブジェクトのオブジェクトIDフィールド702に記録する(ステップ1607)。
When object profiling is performed (the result of
ステップ1607の処理の終了後には、当該オブジェクト生成命令によってオブジェクトを生成したことを記録するために、当該オブジェクト生成命令に係るオブジェクト生成回数502の値に1を加算して、オブジェクトプロファイリング情報テーブル302を更新する(ステップ1609)。
After the process of
今回のオブジェクト生成先が外部ヒープ領域116である場合には(ステップ1604の結果が「外部ヒープ領域」)、オブジェクト生成先となる外部ヒープ117を生成する。そして、外部ヒープ117の外部ヒープヘッダ901に、当該生成命令に係るメンバオブジェクト情報アドレス504を記録する(ステップ1605)。なお、外部ヒープを生成する際の初期サイズは、当該生成命令に係る起点オブジェクトのクラスサイズ、及び、当該生成命令に係り、メンバオブジェクト適合率が設定閾値以上であるメンバオブジェクトのクラスサイズの合計に基づき設定される。
If the current object generation destination is the external heap area 116 (the result of
オブジェクトプロファイリングを行わない場合(ステップ1606の結果が「NO」)、又は、ステップ1605の処理の終了後には、オブジェクトIDフィールド702を含まない、通常オブジェクトをオブジェクト生成先に生成する(ステップ1608)。
When object profiling is not performed (the result of
ステップ1608の処理の終了後、又は、ステップ1609の処理の終了後には、オブジェクト生成処理の実行元に生成したオブジェクトを通知する(ステップ1610)。
ステップ1610の処理の終了後、又は、ステップ1611の処理の終了後には、本処理を終了する。
After the process of
After the process of
なお、オブジェクト生成先やオブジェクトプロファイリングを行うか否かに応じた専用のオブジェクト生成命令と、それに対するオブジェクト生成処理を用意し、バイトコード情報112のオブジェクト生成命令を適宜書き換えることで、所定のオブジェクト生成処理を実行するようにしてもよい。その場合、例えば、ステップ1604やステップ1607の判定が不要になることもある。
It should be noted that a dedicated object generation instruction according to whether the object generation destination or object profiling is performed and an object generation process corresponding thereto are prepared, and a predetermined object generation is performed by appropriately rewriting the object generation instruction of the
図17は、本発明の実施の形態のGC処理1602の手順を示すフローチャートである。本処理は、プロセッサ129がGC部122を処理することによって、実行される。
プロセッサ129がGC部122を実行すると、GC部122は、まず、オブジェクト生成処理1502で枯渇している領域がJavaヒープ領域115のNew領域とOld領域のどちらかを判定する(ステップ1701)。
FIG. 17 is a flowchart showing a procedure of the
When the
オブジェクト生成処理1502で枯渇している領域がJavaヒープ領域115のNew領域である場合には(ステップ1701の結果が「New領域」)、CopyGC部124を実行し、CopyGC処理を実行する(ステップ1702)。
If the area depleted in the
オブジェクト生成処理1502で枯渇している領域がJavaヒープ領域115のOld領域である場合には(ステップ1701の結果が「Old領域」)、FullGC部123を実行し、FullGC処理を実行する(ステップ1703)。
ステップ1702の処理の終了後、又は、ステップ1703の処理の終了後には、本処理を終了する。
When the area depleted in the
After the process of
図18は、本発明の実施の形態のFullGC処理1703の手順を示すフローチャートである。本処理は、プロセッサ129がFullGC部123を処理することによって、実行される。
FIG. 18 is a flowchart showing a procedure of the
プロセッサ129がFullGC部123を実行すると、FullGC部123は、まず、FullGC対象の全オブジェクトに対して、オブジェクトヘッダ701にオブジェクト種別“未解析”を設定する。また、以降のプログラムの実行に必要なオブジェクトであることを示すために、レジスタ、実行時スタック、グローバル変数といったルートセットからオブジェクト参照を順次辿ることによって到達可能なオブジェクトに対して、オブジェクトヘッダ701にオブジェクト種別“必要”を設定する。そして、ルートセットから到達可能なオブジェクトを全て辿った後で、オブジェクトヘッダ701のオブジェクト種別が“必要”であるオブジェクトを以降のプログラムの実行に必要なオブジェクト、オブジェクトヘッダ701のオブジェクト種別が“未解析”であるオブジェクトを以降のプログラムの実行に不要なオブジェクトとして、オブジェクトの必要・不要を判定する(ステップ1801)。
When the
図10は、本発明の実施の形態のFullGC処理1703のステップ1801の処理の終了時点におけるJavaヒープ領域115のOld領域に格納されたオブジェクトの状態を示す図である。
FIG. 10 is a diagram illustrating a state of an object stored in the Old area of the
各ノードはオブジェクトを示している。二重丸で示すオブジェクトは、FullGC処理1703のステップ1801の処理によってオブジェクトヘッダ701にオブジェクト種別“必要”が設定されたオブジェクトである。なお、ノード内の記号はクラス名、クラス名の右下の数字はオブジェクトIDフィールド702に格納されたオブジェクトIDを示している。
Each node represents an object. An object indicated by a double circle is an object in which the object type “necessary” is set in the
また、オブジェクトを連結する矢印は、オブジェクトの参照関係を示している。実線の矢印は、FullGC処理1703のステップ1801の処理によって辿られたオブジェクト参照であり、破線の矢印は、オブジェクト参照は存在するが、FullGC処理1703のステップ1801の処理によって辿られることのなかったオブジェクト参照を示している。
An arrow connecting the objects indicates the reference relationship of the objects. A solid line arrow is an object reference traced by the process of
ルートセット1001は、レジスタ、実行時スタック、グローバル変数などである。ルートセット1001に保持されるオブジェクト参照を起点としてFullGC処理1703のステップ1801の処理が実行されると、ルートセット1001からオブジェクト参照を順次辿ることによって到達可能なオブジェクトは全て必要オブジェクトと判定される。したがって、図10に示すように、オブジェクト1002、オブジェクト1003、オブジェクト1004、オブジェクト1005などの二重丸で示すオブジェクトは必要オブジェクトである。一方、ルートセット1001からオブジェクト参照を順次辿ることによって到達することのできなかったオブジェクトは全て未解析オブジェクト(不要オブジェクト)と判定される。したがって、図10に示すように、オブジェクト1006、オブジェクト1007、オブジェクト1008などの一重丸で示すオブジェクトは未解析オブジェクトである。これら未解析オブジェクトは、FullGC処理1703によって実際に解放されるオブジェクトであるが、Javaヒープ115のOld領域の使用量を抑え、FullGC処理1703の発生を抑止するためには、外部ヒープ領域116に格納し、GCによらず解放することが望ましい。
The route set 1001 is a register, a runtime stack, a global variable, and the like. When the processing of
また、未解析オブジェクトの参照関係において参照関係のルートに当たるオブジェクト1006、オブジェクト1007、オブジェクト1008などの起点オブジェクトは、これらオブジェクトがルートセット1001や必要オブジェクトから参照されなくなったことによって、起点オブジェクトからオブジェクトを順次辿ることによってのみ到達可能なオブジェクトも一緒に解放される。そのため、起点オブジェクトを含め、起点オブジェクトからオブジェクトを順次辿ることによって到達可能なオブジェクトを外部ヒープ領域116に格納するようにすれば、Javaヒープ115のOld使用量をより多く抑えることができる。そのためには、起点オブジェクトを特定し、それら起点オブジェクトを外部ヒープ領域116に生成するようにする必要がある。この起点オブジェクトの特定方法については、図11で説明する。
In addition, starting objects such as the
ここで、図18のFullGC処理1703のフローチャートの説明に戻る。
ステップ1801の処理の終了後には、JavaVM110の設定フラグを参照し、オブジェクトプロファイリングを行うか否かを判定する(ステップ1802)。
Here, the description returns to the flowchart of the
After the processing in
オブジェクトプロファイリングを行う場合には(ステップ1802の結果が「YES」)、オブジェクト解析部125を実行し、オブジェクトプロファイリング処理を実行する(ステップ1803)。
When performing object profiling (the result of
オブジェクトプロファイリングを行わない場合(ステップ1802の結果が「NO」)、又は、ステップ1803の処理の終了後には、オブジェクトヘッダ701のオブジェクト種別が“必要”でないオブジェクトを不要なオブジェクトとして解放する(ステップ1804)。
ステップ1804の処理の終了後には、本処理を終了する。
When object profiling is not performed (the result of
After the process of
図19は、本発明の実施の形態のオブジェクトプロファイリング処理1803の手順を示すフローチャートである。本処理は、プロセッサ129がオブジェクト解析部125を処理することによって、実行される。
本処理のステップ1901からステップ1904までの処理を実行することによって、起点オブジェクトを特定することができる。
FIG. 19 is a flowchart showing a procedure of
By executing the processing from
本処理を実行すると、まず、ステップ1801で不要なオブジェクトと判定された全オブジェクトについて、未処理の不要オブジェクトが存在するか否かを判定する(ステップ1901)。 When this process is executed, first, it is determined whether or not there is an unprocessed unnecessary object for all the objects determined to be unnecessary in step 1801 (step 1901).
未処理の不要オブジェクトが存在する場合には(ステップ1901の結果が「YES」)、当該オブジェクトのオブジェクトヘッダ701のオブジェクト種別を参照し、オブジェクト種別が“未解析”であるか否かを判定する(ステップ1902)。
If an unprocessed unnecessary object exists (the result of
オブジェクト種別が“未解析”である場合には(ステップ1902の結果が「YES」)、当該オブジェクトのオブジェクトヘッダ701のオブジェクト種別を“起点”に設定する(ステップ1903)。
If the object type is “unanalyzed” (the result of
ステップ1903の処理の終了後には、ステップ1903の起点オブジェクトに対して、メンバオブジェクト処理を呼び出し、メンバオブジェクト処理を実行する(ステップ1904)。
After the process of
オブジェクト種別が“未解析”でない場合(ステップ1902の結果が「NO」)、又は、ステップ1904の処理の終了後には、ステップ1901の処理に戻る。そして、未処理の不要オブジェクトに対して、本処理の実行を継続する。
If the object type is not “unanalyzed” (the result of
未処理の不要オブジェクトが存在しない場合には(ステップ1901の結果が「NO」)、オブジェクトヘッダ701のオブジェクト種別が“起点”である起点オブジェクトについて、当該起点オブジェクトのオブジェクトIDフィールド702を参照し、当該起点オブジェクトのオブジェクトIDを取得する。そして、当該オブジェクトIDに係るオブジェクトプロファイリング回数503の値に1を加算して、オブジェクトプロファイリング情報テーブル302を更新する。また、当該オブジェクトIDに係るメンバオブジェクト情報アドレス504に格納してあるポインタにより当該起点オブジェクトに係るメンバオブジェクト情報303を参照する。なお、当該起点オブジェクトに係るメンバオブジェクト情報303が存在しない場合には、当該起点オブジェクトに係るメンバオブジェクト情報303を生成する。そして、当該起点オブジェクトと当該起点オブジェクトからオブジェクト参照を順次辿ることによって到達可能なメンバオブジェクトの参照関係に応じて、メンバオブジェクトデータ構造を当該メンバオブジェクト情報303に適宜追加し、該当するメンバオブジェクトデータ構造に格納されている、メンバオブジェクトプロファイリング回数に1を加算して、メンバオブジェクト情報303を更新する(ステップ1905)。
ステップ1905の処理の終了後には、本処理を終了する。
If there is no unprocessed unnecessary object (the result of
After the process of
図20は、本発明の実施の形態のメンバオブジェクト処理1904の手順を示すフローチャートである。本処理は、オブジェクトプロファイリング処理1803から呼び出されることやメンバオブジェクト処理1904から再帰的に呼び出されることによって、実行される。
FIG. 20 is a flowchart showing a procedure of
本処理を実行すると、まず、本処理の処理対象となったオブジェクトについて、未処理の参照先オブジェクトが存在するか否かを判定する(ステップ2001)。
未処理の参照先オブジェクトが存在する場合には(ステップ2001の結果が「YES」)、参照先オブジェクトのオブジェクトヘッダ701のオブジェクト種別を参照し、オブジェクト種別を判定する(ステップ2002)。
When this processing is executed, it is first determined whether or not there is an unprocessed reference destination object for the object that is the processing target of this processing (step 2001).
If there is an unprocessed reference destination object (the result of
オブジェクト種別が“起点”である場合には(ステップ2002の結果が「起点」)、参照先オブジェクトがメンバオブジェクト処理1803の呼び出し元の起点オブジェクトと同じであるか否かを判定する(ステップ2003)。
参照先オブジェクトがメンバオブジェクト処理1803の呼び出し元の起点オブジェクトと同じでない場合には(ステップ2003の結果が「NO」)、参照先オブジェクトのオブジェクトヘッダ701のオブジェクト種別を“メンバ”に設定する(ステップ2005)。
When the object type is “starting point” (the result of
If the reference destination object is not the same as the calling source object of the member object processing 1803 (the result of
オブジェクト種別が“未解析”である場合には(ステップ2002の結果が「未解析」)、参照先オブジェクトのオブジェクトヘッダ701のオブジェクト種別を“メンバ”に設定する(ステップ2004)。
ステップ2004の処理の終了後には、当該参照先オブジェクトに対して、メンバオブジェクト処理1904を実行する(ステップ1904)。
When the object type is “unanalyzed” (the result of
After the processing of
オブジェクト種別が“メンバ”である場合(ステップ2002の結果が「メンバ」)、参照先オブジェクトがメンバオブジェクト処理1803の呼び出し元の起点オブジェクトと同じである場合(ステップ2003の結果が「YES」)、ステップ2005の処理の終了後、又は、ステップ2004の後に実行するステップ1904の処理の終了後には、ステップ2001の処理に戻る。そして、未処理の参照先オブジェクトに対して(ステップ2001の結果が「YES」)、本処理の実行を継続する。
未処理の参照先オブジェクトが存在しない場合には(ステップ2001の結果が「NO」)、本処理を終了する。
When the object type is “member” (the result of
If there is no unprocessed reference destination object (the result of
図11は、本発明の実施の形態のオブジェクトプロファイリング処理1803のステップ1901からステップ1904までの処理を実行することによって、起点オブジェクトを特定する具体的な手順を示す図である。
FIG. 11 is a diagram showing a specific procedure for identifying the starting object by executing the processing from
各ノードはオブジェクトを示している。細線の一重丸で示すオブジェクトは、FullGC処理1703のステップ1801の処理によってオブジェクトヘッダ701にオブジェクト種別“未解析”が設定されたままの不要オブジェクトである。なお、ノード内の記号はクラス名、クラス名の右下の数字はオブジェクトIDフィールド702に格納されたオブジェクトIDを示している。
Each node represents an object. An object indicated by a single circle of a thin line is an unnecessary object in which the object type “unanalyzed” is still set in the
また、オブジェクトを連結する矢印は、オブジェクトの参照関係を示している。実線の矢印は、オブジェクトプロファイリング処理1803のステップ1901からステップ1904までの処理を実行することによって辿られたオブジェクト参照であり、破線の矢印は、オブジェクト参照は存在するが、オブジェクトプロファイリング処理1803のステップ1901からステップ1904までの処理を実行することによってまだ辿られていないオブジェクト参照を示している。
An arrow connecting the objects indicates the reference relationship of the objects. A solid line arrow is an object reference traced by executing the processing from
図11(a)は、FullGC処理1703のステップ1801の処理の終了時点の状態を示している。なお、オブジェクトの参照関係が判明していない状態から、オブジェクト1009、オブジェクト1011、オブジェクト1008、オブジェクト1010、オブジェクト1012の順にオブジェクトを処理していくものとする。
FIG. 11A shows the state at the end of the processing of
図11(b)は、オブジェクト1009を処理し、オブジェクトプロファイリング処理1803のステップ1902の判定においてオブジェクト種別が“未解析”であるため、オブジェクト1009のオブジェクトヘッダ701のオブジェクト種別を“起点”に設定した状態を示している。その結果、起点オブジェクトであるオブジェクト1009は太線の一重丸で示す。
FIG. 11B processes the
図11(c)は、オブジェクト1009の参照先であるオブジェクト1011を処理し、メンバオブジェクト処理1904のステップ2002の判定においてオブジェクト種別が“未解析”であるため、オブジェクト1011のオブジェクトヘッダ701のオブジェクト種別を“メンバ”に設定した状態を示す。その結果、メンバオブジェクトであるオブジェクト1011は×を付した一重丸で示す。オブジェクト1011の参照先オブジェクトは存在しないため、オブジェクト1009の処理はここで終了となる。
また、オブジェクト1011を処理し、オブジェクトプロファイリング処理1803のステップ1902の判定においてオブジェクト種別が“未解析”でないため、オブジェクト1011の処理はここで終了となる。
FIG. 11C processes the
Further, since the
図11(d)は、オブジェクト1008を処理し、オブジェクトプロファイリング処理1803のステップ1902の判定においてオブジェクト種別が“未解析”であるため、オブジェクト1008のオブジェクトヘッダ701のオブジェクト種別を“起点”に設定した状態を示している。
FIG. 11D processes the
図11(e)は、オブジェクト1008の参照先であるオブジェクト1009を処理し、メンバオブジェクト処理1904のステップ2002の判定においてオブジェクト種別が“起点”であり、メンバオブジェクト処理1904のステップ2003の判定において、参照先であるオブジェクト1009と呼び出し元のオブジェクト1008は同じでないため、参照先であるオブジェクト1009のオブジェクトヘッダ701のオブジェクト種別を“メンバ”に設定した状態を示している。
また、オブジェクト1008の参照先であるオブジェクト1010を処理し、メンバオブジェクト処理1904のステップ2002の判定においてオブジェクト種別が“未解析”であるため、参照先であるオブジェクト1010のオブジェクトヘッダ701のオブジェクト種別を“メンバ”に設定した状態を示している。さらに、オブジェクト1010の参照先であるオブジェクト1012を処理し、メンバオブジェクト処理1904のステップ2002の判定においてオブジェクト種別が“未解析”であるため、参照先であるオブジェクト1012のオブジェクトヘッダ701にオブジェクト種別“メンバ”を設定した状態を示している。なお、オブジェクト1012の参照先であるオブジェクト1008は、メンバオブジェクト処理1904のステップ2002の判定においてオブジェクト種別が“起点”であり、メンバオブジェクト処理1904のステップ2003の判定において、呼び出し元のオブジェクト1008と同じであるため、オブジェクト1008の処理はここで終了となる。
さらに、オブジェクト1010を処理し、オブジェクトプロファイリング処理1803のステップ1902の判定においてオブジェクト種別が“未解析”でないため、オブジェクト1010の処理はここで終了となる。オブジェクト1012についても同様である。
FIG. 11 (e) processes the
In addition, since the
Furthermore, since the
図11(f)は、オブジェクト1009、オブジェクト1011、オブジェクト1008、オブジェクト1010、オブジェクト1012の処理が全て終了した状態を示しており、このオブジェクトの参照関係の解析により、オブジェクト1008が起点オブジェクトであると特定することができる。また、オブジェクト1009、オブジェクト1011、オブジェクト1010、及び、オブジェクト1012はメンバオブジェクトであり、メンバオブジェクトから起点オブジェクトへのオブジェクト参照1013は、存在しないものとして処理する。
FIG. 11 (f) shows a state in which all the processing of the
図21は、本発明の実施の形態のCopyGC処理1702の手順を示すフローチャートである。本処理は、プロセッサ129がCopyGC部124を処理することによって、実行される。
FIG. 21 is a flowchart showing a procedure of the copy
プロセッサ129がCopyGC部124を実行すると、CopyGC部124は、まず、New領域に格納してある以降のプログラム実行に必要なオブジェクトをNew領域内の別の領域に順次移動させ、移動されることのなかったオブジェクトを不要なオブジェクトとして解放する(ステップ2101)。なお、ステップ2101の処理において、外部ヒープ領域116に格納されている起点オブジェクトからオブジェクト参照を順次辿ることによって到達可能なオブジェクトについては、起点オブジェクトに対して、メンバオブジェクト移動処理を呼び出し、メンバオブジェクト移動処理を実行することで、適切な移動先に移動させる。メンバオブジェクト移動処理の詳細は、図22で説明する。
When the
ステップ2101の処理の終了後には、例えば、外部ヒープ117へのオブジェクト参照を検査し、どこからも参照されていない不要な外部ヒープ117が存在するか否かを判定する(ステップ2102)。
不要な外部ヒープ117が存在する場合には(ステップ2102の結果が「YES」)、不要な外部ヒープ領域116、例えば、外部ヒープ1や外部ヒープ3を解放することで、外部ヒープ1や外部ヒープ3に格納してある不要なオブジェクトを解放する(ステップ2103)。
After the processing of
If there is an unnecessary external heap 117 (the result of
不要な外部ヒープ117が存在しない場合(ステップ2102の結果が「NO」)、又は、ステップ2103の処理の終了後には、JavaVM110の設定フラグを参照し、CopyGC処理時にオブジェクト生成命令のオブジェクト生成先を変更するか否かを判定する(ステップ2104)。
オブジェクト生成先を変更する場合には(ステップ2104の結果が「YES」)、オブジェクト生成情報テーブル301に対して、オブジェクト生成先変更部113を実行し、オブジェクト生成先変更処理を実行する(ステップ1303)。
オブジェクト生成先を変更しない場合(ステップ2104の結果が「NO」)、又は、ステップ1303の処理の終了後には、本処理を終了する。
If there is no unnecessary external heap 117 (the result of
When changing the object generation destination (the result of
When the object generation destination is not changed (the result of
なお、本発明の実施の形態では、CopyGC処理時に不要な外部ヒープの解放とオブジェクト生成命令のオブジェクト生成先の変更を実施しているが、CopyGC処理時以外の所定のタイミングでこれらの処理を実施してもよい。 In the embodiment of the present invention, unnecessary external heap release and change of the object generation destination of the object generation instruction are performed at the time of CopyGC processing, but these processing are performed at a predetermined timing other than at the time of CopyGC processing. May be.
図22は、本発明の実施の形態のメンバオブジェクト移動処理の手順を示すフローチャートである。本処理は、CopyGC処理1702のステップ2101の処理において、実行される。
FIG. 22 is a flowchart illustrating a procedure of member object movement processing according to the embodiment of this invention. This process is executed in the process of
本処理を実行すると、まず、本処理の処理対象となったオブジェクトについて、未処理の参照先オブジェクトが存在するか否かを判定する(ステップ2201)。
未処理の参照先オブジェクトが存在する場合には(ステップ2201の結果が「YES」)、参照先オブジェクトがCopyGC処理1702のステップ2101の処理によるNew領域からOld領域への移動対象であるか否かを判定する(ステップ2202)。なお、参照先オブジェクトがCopyGC処理によるNew領域からOld領域への移動対象であるとは、少なくともその参照先オブジェクトがOld領域に移動するのに十分な回数のCopyGCを経ている長命なオブジェクトであることを意味する。
When this processing is executed, it is first determined whether or not there is an unprocessed reference destination object for the object that is the processing target of this processing (step 2201).
If there is an unprocessed reference destination object (the result of
参照先オブジェクトがNew領域からOld領域への移動対象である場合には(ステップ2202の結果が「YES」)、参照先オブジェクトのメンバオブジェクト適合率が、JavaVM110の設定閾値(第3の閾値)以上であるか否かを判定する(ステップ2203)。なお、この判定では、メンバオブジェクトのクラスサイズなどに応じて、メンバオブジェクト適合率に重み付けを行ってもよい。
When the reference destination object is a movement target from the New area to the Old area (the result of
参照先オブジェクトのメンバオブジェクト適合率が、設定閾値以上である場合には(ステップ2203の結果が「YES」)、参照先オブジェクトを起点オブジェクトと同じ外部ヒープに移動する(ステップ2204)。
If the member object conformance rate of the reference destination object is equal to or greater than the set threshold value (the result of
図12は、本発明の実施の形態のメンバオブジェクト移動処理の(a)開始時点、及び、(b)終了時点における外部ヒープ1、外部ヒープ2、及び、Javaヒープ115のNew領域とOld領域に格納されたオブジェクトの状態を示す図である。
各ノードはオブジェクトを示している。なお、ノード内の記号はクラス名の略称を示している。例えば、ノード内の記号が“A”であるオブジェクト1201のクラス名は“ClassA”になる。また、オブジェクトを連結する矢印は、オブジェクトの参照関係を示している。
FIG. 12 shows the New and Old areas of the
Each node represents an object. Note that symbols in the nodes indicate class names. For example, the class name of the
ここで、オブジェクト1201は、外部ヒープ1に格納された起点オブジェクトである。また、オブジェクト1208は、外部ヒープ2に格納された起点オブジェクトである。オブジェクト1201が格納された外部ヒープ1の外部ヒープヘッダ901には、オブジェクト1201に係るメンバオブジェクト情報303へのポインタが格納してあり、このポインタによりオブジェクト1201に係るメンバオブジェクト情報303を参照する。同様に、オブジェクト1208が格納された外部ヒープ2の外部ヒープヘッダ901には、オブジェクト1208に係るメンバオブジェクト情報303へのポインタが格納してあり、このポインタによりオブジェクト1208に係るメンバオブジェクト情報303を参照する。なお、ここでは、オブジェクト1201に係るメンバオブジェクト情報303は図6に示してあるメンバオブジェクト情報303であるものとする。このメンバオブジェクト情報303の起点オブジェクトデータ構造601を参照して、ClassAの起点オブジェクトはFullGCによってOld領域で4回解放されたことがわかる。また、メンバオブジェクト情報303のメンバオブジェクトデータ構造606を参照して、ClassAの起点オブジェクトがFullGCによって解放されたことによってClassFのメンバオブジェクトがOld領域で3回解放されたこと、メンバオブジェクト情報303のメンバオブジェクトデータ構造605を参照して、ClassAの起点オブジェクトがFullGCによって解放されたことによってClassEのメンバオブジェクトがOld領域で2回解放されたことなどがわかる。
Here, the
ここで、ClassB、ClassC、ClassD、ClassE、ClassF、及び、ClassGのメンバオブジェクト適合率は、それぞれ、1.00、1.00、1.00、0.50、0.75、0.25である。メンバオブジェクト適合率が高いメンバオブジェクトは、起点オブジェクトが不要になると同時に不要になる可能性が高いので、メンバオブジェクト適合率が高いメンバオブジェクトを起点オブジェクトと同じ外部ヒープに格納するようにすることによって、起点オブジェクトが不要になると同時に、その外部ヒープを解放することによって、メンバオブジェクト適合率が高いメンバオブジェクトを解放できる可能性も高くなる。そのため、メンバオブジェクト移動処理では、メンバオブジェクト適合率の高いメンバオブジェクトを起点オブジェクトと同じ外部ヒープに移動するようにする。例えば、メンバオブジェクト適合率の設定閾値が0.60の場合、メンバオブジェクト適合率が0.60以上であるオブジェクト1202、オブジェクト1203、オブジェクト1204、及び、オブジェクト1206は、メンバオブジェクト移動処理によって、オブジェクト1201と同じ外部ヒープ1に移動する。一方、メンバオブジェクト適合率が0.60以上でないオブジェクト1205は、メンバオブジェクト移動処理によって、ステップ2203の結果が「YES」となる別の起点オブジェクトであるオブジェクト1208と同じ外部ヒープ2に移動する。また、オブジェクト1207は、外部ヒープ領域116に格納された起点オブジェクトからオブジェクト参照を順次辿ることによって到達可能なオブジェクトであるが、メンバオブジェクト適合率が0.60以上ではないので、Javaヒープ領域115のOld領域に移動する。
Here, the member object matching rates of ClassB, ClassC, ClassD, ClassE, ClassF, and ClassG are 1.00, 1.00, 1.00, 0.50, 0.75, and 0.25, respectively. A member object with a high member object conformance rate is likely to be unnecessary at the same time as the starting object becomes unnecessary, so by storing a member object with a high member object conformance rate in the same external heap as the starting object, At the same time as the starting object becomes unnecessary, releasing the external heap also increases the possibility of releasing a member object having a high member object matching rate. For this reason, in the member object moving process, a member object having a high member object matching rate is moved to the same external heap as the starting object object. For example, when the setting threshold value of the member object conformance rate is 0.60, the
ここで、図22のメンバオブジェクト移動処理のフローチャートの説明に戻る。
ステップ2204の処理の終了後には、参照先オブジェクトに対して、メンバオブジェクト移動処理を呼び出し、メンバオブジェクト移動処理を実行する(ステップ2205)。
Now, the description returns to the flowchart of the member object movement process of FIG.
After the process of
参照先オブジェクトがNew領域からOld領域への移動対象でない場合(ステップ2202の結果が「NO」)、参照先オブジェクトのメンバオブジェクト適合率が、設定閾値以上でない場合(ステップ2203の結果が「NO」)、及び、ステップ2205の処理の終了後には、ステップ2201の処理に戻る。そして、未処理の参照先オブジェクトに対して、本処理の実行を継続する。
未処理の参照先オブジェクトが存在しない場合には(ステップ2201の結果が「NO」)、本処理を終了する。
When the reference destination object is not the object to be moved from the New area to the Old area (the result of
If there is no unprocessed reference destination object (the result of
なお、このメンバオブジェクト移動処理において、ステップ2202の処理は省略してもよい。つまり、参照先オブジェクト(メンバオブジェクト)を起点オブジェクトが存在する外部ヒープと同じ外部ヒープに移動するか否かの判断は、ステップ2203の判定だけで行ってもよい。換言すれば、場合によっては、参照先オブジェクトがOld領域へ移るほど長命でなくても、参照先オブジェクトを起点オブジェクトと同じ外部ヒープに移動するように処理してGCの発生を抑えるほうが好都合である。ただ、一概にはいえないが、図22の処理のように、ステップ2202の判定を設けて、より長命な参照先オブジェクトを起点オブジェクトと同じ外部ヒープに移動することは効果的である。
In this member object movement process, the process of
本発明の実施の形態では、例えば図23のネットワーク構成に示すように、複数の計算機システム101とウェブサーバ201とがネットワーク203を介して通信可能に接続している。計算機システム101は、Javaソースファイル104の記述内容に従って機能するJavaアプリケーション132を有しており、JavaVM110がJavaアプリケーション132を実行することで所定のサービスを実現する。
In the embodiment of the present invention, for example, as shown in the network configuration of FIG. 23, a plurality of computer systems 101 and a web server 201 are communicably connected via a network 203. The computer system 101 has a
一方、ウェブサーバ201は、入力装置、出力装置、プロセッサ、記憶装置といったハードウェア資源を有するコンピュータである。このウェブサーバ201は、例えばJavaサーブレット202を有している。ウェブサーバ201は、Javaサーブレット202を機能させることにより、動的にウェブページを生成し、そのウェブページをリクエストのあった計算機システム101に送信する。
On the other hand, the web server 201 is a computer having hardware resources such as an input device, an output device, a processor, and a storage device. The web server 201 has a
なお、計算機システム101は、Javaアプリケーション132ではなく、Javaアプレットを有していてもよい。この場合、ウェブサーバ201が提供するウェブページを閲覧するウェブブラウザを用いてJavaアプレットを実行することで所定のサービスを実現する。
また、計算機システム101が有するJavaVM110は、予め出荷時に搭載されたものであってもよいし、ウェブサーバ201から取得したものであってもよい。
The computer system 101 may have a Java applet instead of the
Further, the
≪その他≫
前記した各実施形態は、本発明を実施するために好適のものであるが、その実施形式はこれらに限定されるものでなく、本発明の要旨を変更しない範囲内において種々変形することが可能である。
≪Others≫
Each of the above-described embodiments is suitable for carrying out the present invention, but the form of implementation is not limited to these, and various modifications can be made without departing from the scope of the present invention. It is.
例えば、本実施形態で取り扱ったGCは、世代別GCであったが、本発明が適用可能なGCはこれに限らない。例えばパラレルGCに対しても適用可能である。 For example, the GC handled in this embodiment is a generational GC, but the GC to which the present invention is applicable is not limited to this. For example, it can be applied to a parallel GC.
また、オブジェクトプロファイリング情報テーブル302において登録するオブジェクトプロファイリング回数503は、FullGCの回数でなく、CopyGCの回数であったり、他のGCの回数であったりしてもよい。
In addition, the
その他、ハードウェア、ソフトウェア、各フローチャート等の具体的な構成について、本発明の趣旨を逸脱しない範囲で適宜変更が可能である。 In addition, specific configurations of hardware, software, flowcharts, and the like can be appropriately changed without departing from the spirit of the present invention.
101 計算機システム(情報処理装置)
102 補助記憶(記憶部)
103 Javaクラスファイル
104 Javaソースファイル
105 オブジェクト解析情報ファイル
106 設定ファイル
107 主記憶(記憶部)
108 データ領域
109 Javaコンパイラ
110 JavaVM
111 バイトコード読み込み部
112 バイトコード情報
113 オブジェクト生成先変更部
114 メソッド実行部
115 Javaヒープ領域(第1のメモリ領域)
116 外部ヒープ領域(第2のメモリ領域)
117 外部ヒープ1
118 外部ヒープ2
119 外部ヒープ3
120 メモリ管理部
121 オブジェクト生成部
122 GC部
123 FullGC部
124 CopyGC部
125 オブジェクト解析部
126 オブジェクト解析情報
127 オペレーティングシステム
128 バス
129 プロセッサ(制御部)
130 入力装置
131 出力装置
132 Javaアプリケーション
201 ウェブサーバ
202 Javaサーブレット
203 ネットワーク
301 オブジェクト生成情報テーブル
302 オブジェクトプロファイリング情報テーブル
303 メンバオブジェクト情報
101 Computer system (information processing equipment)
102 Auxiliary storage (storage unit)
103
108
111 Byte
116 External heap area (second memory area)
117
118
119
DESCRIPTION OF
DESCRIPTION OF
Claims (7)
前記情報処理装置の記憶部は、
前記メモリ領域として、前記自動解放機能の対象となる第1のメモリ領域と、
前記メモリ領域として、前記自動解放機能の対象外となる第2のメモリ領域と、を有し、
プログラムを実行するときに生成されるオブジェクトごとに、当該オブジェクトに係るオブジェクト生成命令と、前記オブジェクト生成命令により当該オブジェクトを前記第1のメモリ領域に生成した回数を示すオブジェクト生成回数と、前記自動解放機能により前記第1のメモリ領域を解放した回数を示すオブジェクトプロファイリング回数と、を含むオブジェクト解析情報を記憶しており、
前記情報処理装置の制御部は、
前記オブジェクト解析情報を参照して、前記オブジェクトのオブジェクト生成回数が、前記記憶部に記憶されている第1の閾値以上であるか否かを判定するステップと、
前記オブジェクト生成回数が前記第1の閾値以上であるとき、前記オブジェクト生成回数に対する前記オブジェクトプロファイリング回数の割合が、前記記憶部に記憶されている第2の閾値以上であるか否かを判定するステップと、
前記割合が前記第2の閾値以上であるとき、前記オブジェクト生成命令によるオブジェクトの生成先を前記第2のメモリ領域に変更するステップと、を実行する
ことを特徴とするメモリ管理方法。 A memory management method in an information processing apparatus that operates a virtual machine having an automatic release function that automatically releases a memory area that is no longer necessary in a memory area reserved for executing a program,
The storage unit of the information processing apparatus
As the memory area, a first memory area targeted for the automatic release function;
A second memory area that is not subject to the automatic release function, as the memory area;
For each object generated when the program is executed, an object generation instruction related to the object, an object generation count indicating the number of times the object is generated in the first memory area by the object generation instruction, and the automatic release Object analysis information including the object profiling count indicating the number of times the first memory area has been released by the function,
The control unit of the information processing apparatus
Referring to the object analysis information, determining whether the number of object generations of the object is equal to or greater than a first threshold stored in the storage unit;
Determining whether a ratio of the object profiling frequency to the object generation frequency is equal to or greater than a second threshold value stored in the storage unit when the object generation frequency is equal to or greater than the first threshold value; When,
When the ratio is equal to or greater than the second threshold, the step of changing the generation destination of the object by the object generation instruction to the second memory area is executed.
前記第1のメモリ領域に生成されたオブジェクトのうち、前記仮想マシンが直接参照可能なオブジェクト、および前記直接参照可能なオブジェクトが直接的または間接的に参照するオブジェクトを除くオブジェクトを特定するステップと、
前記オブジェクト解析情報を参照して、前記特定したオブジェクトのオブジェクト生成回数が前記第1の閾値以上であり、当該オブジェクト生成回数に対する前記オブジェクトプロファイリング回数の割合が前記第2の閾値以上であるとき、前記オブジェクト生成命令によるオブジェクトの生成先を前記第2のメモリ領域に変更するステップと、を実行する
ことを特徴とする請求項1に記載のメモリ管理方法。 The control unit of the information processing apparatus
Identifying objects other than objects that can be directly referred to by the virtual machine and objects that are directly or indirectly referenced by the directly referenceable objects among the objects generated in the first memory area;
With reference to the object analysis information, when the object generation count of the identified object is equal to or greater than the first threshold, and a ratio of the object profiling count to the object generation count is equal to or greater than the second threshold, The memory management method according to claim 1, further comprising: changing a generation destination of an object by an object generation instruction to the second memory area.
前記特定したオブジェクトにおいて、前記仮想マシンから直接参照されず、並びにいずれのオブジェクトからも参照されないオブジェクトである起点オブジェクト、および前記起点オブジェクトが直接的または間接的に参照するオブジェクトであるメンバオブジェクトを設定するステップと、
前記起点オブジェクトのオブジェクトプロファイリング回数に対する前記メンバオブジェクトのオブジェクトプロファイリング回数の割合が、前記記憶部に記憶されている第3の閾値以上であるか否かを判定するステップと、
前記割合が前記第3の閾値以上であるとき、前記メンバオブジェクトも前記第2のメモリ領域に移動するステップと、を実行する
ことを特徴とする請求項2に記載のメモリ管理方法。 The control unit of the information processing apparatus
In the specified object, a starting object that is an object that is not directly referenced from the virtual machine and that is not referred to by any object, and a member object that is an object that the starting object directly or indirectly references are set. Steps,
Determining whether the ratio of the object profiling count of the member object to the object profiling count of the starting object is equal to or greater than a third threshold stored in the storage unit;
The memory management method according to claim 2, wherein when the ratio is equal to or greater than the third threshold, the member object is also moved to the second memory area.
前記第1のメモリ領域は、長命でないオブジェクトが格納されるNew領域と、長命なオブジェクトが格納されるOld領域とを含んで構成される
ことを特徴とする請求項1から請求項3のいずれか一項に記載のメモリ管理方法。 The automatic release function is an automatic release function by generational garbage collection,
The first memory area includes a New area in which an object that is not long-lived is stored, and an Old area in which an object that is long-lived is stored. The memory management method according to one item.
ことを特徴とする請求項4に記載のメモリ管理方法。 The memory management method according to claim 4, wherein the release of the first memory area indicated by the number of times of object profiling is a release for an area including both the New area and the Old area.
前記情報処理装置の記憶部は、
前記メモリ領域として、前記自動解放機能の対象となる第1のメモリ領域と、
前記メモリ領域として、前記自動解放機能の対象外となる第2のメモリ領域と、を有し、
プログラムを実行するときに生成されるオブジェクトごとに、当該オブジェクトに係るオブジェクト生成命令と、前記オブジェクト生成命令により当該オブジェクトを前記第1のメモリ領域に生成した回数を示すオブジェクト生成回数と、前記自動解放機能により前記第1のメモリ領域を解放した回数を示すオブジェクトプロファイリング回数と、を含むオブジェクト解析情報を記憶しており、
前記メモリ管理プログラムは、前記情報処理装置の制御部に、
前記オブジェクト解析情報を参照して、前記オブジェクトのオブジェクト生成回数が、前記記憶部に記憶されている第1の閾値以上であるか否かを判定する処理と、
前記オブジェクト生成回数が前記第1の閾値以上であるとき、前記オブジェクト生成回数に対する前記オブジェクトプロファイリング回数の割合が、前記記憶部に記憶されている第2の閾値以上であるか否かを判定する処理と、
前記割合が前記第2の閾値以上であるとき、前記オブジェクト生成命令によるオブジェクトの生成先を前記第2のメモリ領域に変更する処理と、を実行させる
ことを特徴とするメモリ管理プログラム。 A memory management program that functions as an information processing apparatus that operates a virtual machine having an automatic release function that automatically releases a memory area that is no longer necessary in a memory area reserved for executing a program,
The storage unit of the information processing apparatus
As the memory area, a first memory area targeted for the automatic release function;
A second memory area that is not subject to the automatic release function, as the memory area;
For each object generated when the program is executed, an object generation instruction related to the object, an object generation count indicating the number of times the object is generated in the first memory area by the object generation instruction, and the automatic release Object analysis information including the object profiling count indicating the number of times the first memory area has been released by the function,
The memory management program is stored in the control unit of the information processing apparatus.
With reference to the object analysis information, a process of determining whether or not the number of object generations of the object is equal to or greater than a first threshold stored in the storage unit;
A process of determining whether a ratio of the object profiling frequency to the object generation frequency is equal to or greater than a second threshold value stored in the storage unit when the object generation frequency is equal to or greater than the first threshold value. When,
When the ratio is equal to or greater than the second threshold value, a process of changing an object generation destination by the object generation instruction to the second memory area is executed.
前記メモリ領域として、前記自動解放機能の対象となる第1のメモリ領域と、
前記メモリ領域として、前記自動解放機能の対象外となる第2のメモリ領域と、を有し、
プログラムを実行するときに生成されるオブジェクトごとに、当該オブジェクトに係るオブジェクト生成命令と、前記オブジェクト生成命令により当該オブジェクトを前記第1のメモリ領域に生成した回数を示すオブジェクト生成回数と、前記自動解放機能により前記第1のメモリ領域を解放した回数を示すオブジェクトプロファイリング回数と、を含むオブジェクト解析情報を記憶している記憶部と、
前記オブジェクト解析情報を参照して、前記オブジェクトのオブジェクト生成回数が、前記記憶部に記憶されている第1の閾値以上であるか否かを判定する制御と、
前記オブジェクト生成回数が前記第1の閾値以上であるとき、前記オブジェクト生成回数に対する前記オブジェクトプロファイリング回数の割合が、前記記憶部に記憶されている第2の閾値以上であるか否かを判定する制御と、
前記割合が前記第2の閾値以上であるとき、前記オブジェクト生成命令によるオブジェクトの生成先を前記第2のメモリ領域に変更する制御と、を実行する制御部とを有する
ことを特徴とする情報処理装置。 An information processing apparatus that operates a virtual machine having an automatic release function that automatically releases a memory area that is no longer necessary in a memory area reserved for executing a program,
As the memory area, a first memory area targeted for the automatic release function;
A second memory area that is not subject to the automatic release function, as the memory area;
For each object generated when the program is executed, an object generation instruction related to the object, an object generation count indicating the number of times the object is generated in the first memory area by the object generation instruction, and the automatic release A storage unit storing object analysis information including an object profiling count indicating the number of times the first memory area is released by a function;
Control for referring to the object analysis information to determine whether the number of times the object has been generated is equal to or greater than a first threshold stored in the storage unit;
Control for determining whether a ratio of the object profiling frequency to the object generation frequency is equal to or greater than a second threshold value stored in the storage unit when the object generation frequency is equal to or greater than the first threshold value. When,
A control unit that executes control to change a generation destination of the object by the object generation instruction to the second memory area when the ratio is equal to or greater than the second threshold. apparatus.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009236257A JP5199975B2 (en) | 2009-10-13 | 2009-10-13 | Memory management method, memory management program, and information processing apparatus |
PCT/JP2010/053520 WO2011045949A1 (en) | 2009-10-13 | 2010-03-04 | Memory management method, memory management program, and information processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009236257A JP5199975B2 (en) | 2009-10-13 | 2009-10-13 | Memory management method, memory management program, and information processing apparatus |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2011085985A true JP2011085985A (en) | 2011-04-28 |
JP2011085985A5 JP2011085985A5 (en) | 2011-06-16 |
JP5199975B2 JP5199975B2 (en) | 2013-05-15 |
Family
ID=43876004
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009236257A Expired - Fee Related JP5199975B2 (en) | 2009-10-13 | 2009-10-13 | Memory management method, memory management program, and information processing apparatus |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP5199975B2 (en) |
WO (1) | WO2011045949A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014171002A1 (en) * | 2013-04-19 | 2014-10-23 | 株式会社日立製作所 | Memory management method, computer, and recording medium |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110543357B (en) * | 2018-05-28 | 2023-01-13 | 华为云计算技术有限公司 | Method, related device and system for managing application program object |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003241967A (en) * | 2002-02-15 | 2003-08-29 | Matsushita Electric Ind Co Ltd | Program execution device, its method and program executed therein |
US6681234B2 (en) * | 2000-12-12 | 2004-01-20 | Sun Microsystems, Inc. | Method and apparatus for storing long-lived objects in a virtual machine |
US20070180002A1 (en) * | 2006-01-27 | 2007-08-02 | Sun Microsystems, Inc. | Method and apparatus for reducing object pre-tenuring overhead in a generational garbage collector |
JP2010044532A (en) * | 2008-08-11 | 2010-02-25 | Hitachi Ltd | Memory management method, memory management program and memory management device |
-
2009
- 2009-10-13 JP JP2009236257A patent/JP5199975B2/en not_active Expired - Fee Related
-
2010
- 2010-03-04 WO PCT/JP2010/053520 patent/WO2011045949A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6681234B2 (en) * | 2000-12-12 | 2004-01-20 | Sun Microsystems, Inc. | Method and apparatus for storing long-lived objects in a virtual machine |
JP2003241967A (en) * | 2002-02-15 | 2003-08-29 | Matsushita Electric Ind Co Ltd | Program execution device, its method and program executed therein |
US20070180002A1 (en) * | 2006-01-27 | 2007-08-02 | Sun Microsystems, Inc. | Method and apparatus for reducing object pre-tenuring overhead in a generational garbage collector |
JP2010044532A (en) * | 2008-08-11 | 2010-02-25 | Hitachi Ltd | Memory management method, memory management program and memory management device |
Non-Patent Citations (2)
Title |
---|
CSNG200900328001; 小幡 元樹: 'Javaにおける明示的メモリ管理' 情報処理学会論文誌 論文誌ジャーナル 第50巻,第7号, 20090715, p.1693-1715, 社団法人情報処理学会 * |
JPN6013002426; 小幡 元樹: 'Javaにおける明示的メモリ管理' 情報処理学会論文誌 論文誌ジャーナル 第50巻,第7号, 20090715, p.1693-1715, 社団法人情報処理学会 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014171002A1 (en) * | 2013-04-19 | 2014-10-23 | 株式会社日立製作所 | Memory management method, computer, and recording medium |
Also Published As
Publication number | Publication date |
---|---|
JP5199975B2 (en) | 2013-05-15 |
WO2011045949A1 (en) | 2011-04-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7904493B2 (en) | Method and system for object age detection in garbage collection heaps | |
US7406684B2 (en) | Compiler, dynamic compiler, and replay compiler | |
US9417931B2 (en) | Unified metadata for external components | |
US20080244531A1 (en) | Method and system for generating a hierarchical tree representing stack traces | |
US8990790B2 (en) | Java native interface array handling in a distributed java virtual machine | |
US8856752B2 (en) | Monitoring asset state to enable partial build | |
Roemer et al. | Smarttrack: efficient predictive race detection | |
JP5031470B2 (en) | Memory management method, information processing apparatus, and memory management program | |
US8397045B2 (en) | Memory management device, memory management method, and memory management program | |
WO2009055914A1 (en) | Static analysis defect detection in the presence of virtual function calls | |
US7096339B2 (en) | System and method for detecting memory management programming errors | |
EP3084598B1 (en) | Execution guards in dynamic programming | |
WO2014159147A1 (en) | Diagnostics of state transitions | |
US20060101420A1 (en) | Programming language support for integrating undo and exception handling | |
US8296742B2 (en) | Automatic native generation | |
US7409677B1 (en) | Method and system for creation and use of embedded trace description | |
US9158516B2 (en) | Dual mode evaluation for programs containing recursive computation | |
EP3635561B1 (en) | Asynchronous operation query | |
JP2006350876A (en) | Heap dump acquisition method | |
JP5199975B2 (en) | Memory management method, memory management program, and information processing apparatus | |
US11106522B1 (en) | Process memory resurrection: running code in-process after death | |
US8839207B2 (en) | Debugging extensible markup language | |
CN112487438B (en) | Heap object Use-After-Free vulnerability detection method based on identifier consistency | |
JP2008102748A (en) | Program execution method, language processing system, and run-time routine | |
US20230236835A1 (en) | Cooperative garbage collection barrier elision |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110308 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110308 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20130129 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130208 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20160215 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |