com.sun.management
public class GcInfo extends Object implements CompositeData, CompositeDataView
- Start time
- End time
- Duration
- Memory usage before the collection starts
- Memory usage after the collection ends
GcInfo is a CompositeData
The GC-specific attributes can be obtained via the CompositeData
interface. This is a historical relic, and other classes should
not copy this pattern. Use CompositeDataView
instead.
CompositeData
with attributes as specified in the from
method.Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key) |
boolean |
containsValue(Object value) |
boolean |
equals(Object obj) |
static GcInfo |
from(CompositeData cd)
Returns a GcInfo object represented by the
given CompositeData.
|
Object |
get(String key) |
Object[] |
getAll(String[] keys) |
CompositeType |
getCompositeType() |
long |
getDuration()
Returns the elapsed time of this GC in milliseconds.
|
long |
getEndTime()
Returns the end time of this GC in milliseconds
since the Java virtual machine was started.
|
long |
getId()
Returns the identifier of this garbage collection which is
the number of collections that this collector has done.
|
Map<String,MemoryUsage> |
getMemoryUsageAfterGc()
Returns the memory usage of all memory pools
at the end of this GC.
|
Map<String,MemoryUsage> |
getMemoryUsageBeforeGc()
Returns the memory usage of all memory pools
at the beginning of this GC.
|
long |
getStartTime()
Returns the start time of this GC in milliseconds
since the Java virtual machine was started.
|
int |
hashCode() |
CompositeData |
toCompositeData(CompositeType ct)
Return the
CompositeData representation of this
GcInfo , including any GC-specific attributes. |
String |
toString() |
Collection |
values() |
public long getId()
public long getStartTime()
public long getEndTime()
public long getDuration()
public Map<String,MemoryUsage> getMemoryUsageBeforeGc()
public Map<String,MemoryUsage> getMemoryUsageAfterGc()
public static GcInfo from(CompositeData cd)
Attribute Name Type index java.lang.Long startTime java.lang.Long endTime java.lang.Long memoryUsageBeforeGc javax.management.openmbean.TabularData memoryUsageAfterGc javax.management.openmbean.TabularData
IllegalArgumentException
- if cd does not
represent a GcInfo object with the attributes
described above.public boolean containsKey(String key)
containsKey
in interface CompositeData
public boolean containsValue(Object value)
containsValue
in interface CompositeData
public boolean equals(Object obj)
equals
in interface CompositeData
equals
in class Object
public Object get(String key)
get
in interface CompositeData
public Object[] getAll(String[] keys)
getAll
in interface CompositeData
public CompositeType getCompositeType()
getCompositeType
in interface CompositeData
public int hashCode()
hashCode
in interface CompositeData
hashCode
in class Object
public String toString()
toString
in interface CompositeData
toString
in class Object
public Collection values()
values
in interface CompositeData
public CompositeData toCompositeData(CompositeType ct)
Return the CompositeData
representation of this
GcInfo
, including any GC-specific attributes. The
returned value will have at least all the attributes described
in the from
method, plus optionally
other attributes.
toCompositeData
in interface CompositeDataView
ct
- the CompositeType
that the caller expects.
This parameter is ignored and can be null.CompositeData
representation. Copyright © 2003, 2013, Oracle and/or its affiliates. All rights reserved.