Java プラットフォームの監視と管理

com.sun.management
クラス GcInfo

java.lang.Object
  上位を拡張 com.sun.management.GcInfo
すべての実装されたインタフェース:
CompositeData, CompositeDataView

public class GcInfo
extends Object
implements CompositeData, CompositeDataView

ガベージコレクション情報。この情報には、GC 固有の属性と 1 つのガベージコレクションに関する次の情報が含まれています。

GcInfo は、CompositeData です。GC 固有の属性は、CompositeData インタフェースを使って取得できます。これは過去の名残りであり、ほかのクラスはこのパターンをコピーできません。代わりに CompositeDataView を使用してください。

MXBean のマッピング

GcInfo は、from メソッドに指定された属性を持つ CompositeData にマッピングされます。

導入されたバージョン:
1.5

メソッドの概要
 boolean containsKey(String key)
          Returns true if and only if this CompositeData instance contains an item whose name is key.
 boolean containsValue(Object value)
          Returns true if and only if this CompositeData instance contains an item whose value is value.
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
static GcInfo from(CompositeData cd)
          指定された CompositeData により表された GcInfo オブジェクトを返します。
 Object get(String key)
          Returns the value of the item whose name is key.
 Object[] getAll(String[] keys)
          Returns an array of the values of the items whose names are specified by keys, in the same order as keys.
 CompositeType getCompositeType()
          Returns the composite type of this composite data instance.
 long getDuration()
          この GC の経過時間をミリ秒単位で返します。
 long getEndTime()
          Java 仮想マシンが起動してからの GC の終了時刻をミリ秒単位で返します。
 long getId()
          このコレクタが実行したコレクション数のこのガベージコレクションの識別子を返します。
 Map<String,MemoryUsage> getMemoryUsageAfterGc()
          この GC が終了した時点の全メモリープールのメモリー使用状況を返します。
 Map<String,MemoryUsage> getMemoryUsageBeforeGc()
          この GC が開始された時点の全メモリープールのメモリー使用状況を返します。
 long getStartTime()
          Java 仮想マシンが起動してからの GC の開始時刻をミリ秒単位で返します。
 int hashCode()
          Returns a hash code value for the object.
 CompositeData toCompositeData(CompositeType ct)
          GC 固有の属性を含む、この GcInfoCompositeData 表現を返します。
 String toString()
          Returns a string representation of the object.
 Collection values()
          Returns an unmodifiable Collection view of the item values contained in this CompositeData instance.
 
クラス java.lang.Object から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

メソッドの詳細

getId

public long getId()
このコレクタが実行したコレクション数のこのガベージコレクションの識別子を返します。

戻り値:
ガベージコレクションの識別子 (このコレクタが実行したコレクションの数)

getStartTime

public long getStartTime()
Java 仮想マシンが起動してからの GC の開始時刻をミリ秒単位で返します。

戻り値:
GC の開始時刻

getEndTime

public long getEndTime()
Java 仮想マシンが起動してからの GC の終了時刻をミリ秒単位で返します。

戻り値:
GC の終了時刻

getDuration

public long getDuration()
この GC の経過時間をミリ秒単位で返します。

戻り値:
GC のミリ秒単位の経過時間

getMemoryUsageBeforeGc

public Map<String,MemoryUsage> getMemoryUsageBeforeGc()
この GC が開始された時点の全メモリープールのメモリー使用状況を返します。このメソッドは、対応するメモリープールの GC 開始前のメモリー使用状況に対する、メモリープールの名前の Map を返します。

戻り値:
メモリープールの GC 開始前のメモリー使用状況に対する、メモリープールの名前の Map

getMemoryUsageAfterGc

public Map<String,MemoryUsage> getMemoryUsageAfterGc()
この GC が終了した時点の全メモリープールのメモリー使用状況を返します。このメソッドは、対応するメモリープールの GC 終了時点のメモリー使用状況に対する、メモリープールの名前の Map を返します。

戻り値:
メモリープールの GC 終了時点のメモリー使用状況に対する、メモリープールの名前の Map

from

public static GcInfo from(CompositeData cd)
指定された CompositeData により表された GcInfo オブジェクトを返します。指定された CompositeData は、次のすべての属性を含む必要があります。

属性名
index java.lang.Long
startTime java.lang.Long
endTime java.lang.Long
memoryUsageBeforeGc javax.management.openmbean.TabularData
memoryUsageAfterGc javax.management.openmbean.TabularData

戻り値:
cdnull でない場合は cd により表される GcInfo オブジェクト、そうでない場合は null
例外:
IllegalArgumentException - cd が、上記の属性を持つ GcInfo オブジェクトを表さない場合

containsKey

public boolean containsKey(String key)
インタフェース javax.management.openmbean.CompositeData の記述:
Returns true if and only if this CompositeData instance contains an item whose name is key. If key is a null or empty String, this method simply returns false.

定義:
インタフェース CompositeData 内の containsKey
パラメータ:
key - the key to be tested.
戻り値:
true if this CompositeData contains the key.

containsValue

public boolean containsValue(Object value)
インタフェース javax.management.openmbean.CompositeData の記述:
Returns true if and only if this CompositeData instance contains an item whose value is value.

定義:
インタフェース CompositeData 内の containsValue
パラメータ:
value - the value to be tested.
戻り値:
true if this CompositeData contains the value.

equals

public boolean equals(Object obj)
クラス java.lang.Object の記述:
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

定義:
インタフェース CompositeData 内の equals
オーバーライド:
クラス Object 内の equals
パラメータ:
obj - the reference object with which to compare.
戻り値:
true if this object is the same as the obj argument; false otherwise.
関連項目:
Object.hashCode(), Hashtable

get

public Object get(String key)
インタフェース javax.management.openmbean.CompositeData の記述:
Returns the value of the item whose name is key.

定義:
インタフェース CompositeData 内の get
パラメータ:
key - the name of the item.
戻り値:
the value associated with this key.

getAll

public Object[] getAll(String[] keys)
インタフェース javax.management.openmbean.CompositeData の記述:
Returns an array of the values of the items whose names are specified by keys, in the same order as keys.

定義:
インタフェース CompositeData 内の getAll
パラメータ:
keys - the names of the items.
戻り値:
the values corresponding to the keys.

getCompositeType

public CompositeType getCompositeType()
インタフェース javax.management.openmbean.CompositeData の記述:
Returns the composite type of this composite data instance.

定義:
インタフェース CompositeData 内の getCompositeType
戻り値:
the type of this CompositeData.

hashCode

public int hashCode()
クラス java.lang.Object の記述:
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

定義:
インタフェース CompositeData 内の hashCode
オーバーライド:
クラス Object 内の hashCode
戻り値:
a hash code value for this object.
関連項目:
Object.equals(java.lang.Object), Hashtable

toString

public String toString()
クラス java.lang.Object の記述:
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

定義:
インタフェース CompositeData 内の toString
オーバーライド:
クラス Object 内の toString
戻り値:
a string representation of the object.

values

public Collection values()
インタフェース javax.management.openmbean.CompositeData の記述:
Returns an unmodifiable Collection view of the item values contained in this CompositeData instance. The returned collection's iterator will return the values in the ascending lexicographic order of the corresponding item names.

定義:
インタフェース CompositeData 内の values
戻り値:
the values.

toCompositeData

public CompositeData toCompositeData(CompositeType ct)

GC 固有の属性を含む、この GcInfoCompositeData 表現を返します。戻り値には、少なくとも from メソッドに記述されたすべての属性と、任意でその他の属性が含まれます。

定義:
インタフェース CompositeDataView 内の toCompositeData
パラメータ:
ct - 呼び出し側が予想する CompositeType。このパラメータは無視される。null にすることができる
戻り値:
CompositeData 表現

Java プラットフォームの監視と管理