|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jrockit.memleak.util.MemLeakAdapter
com.jrockit.memleak.mlp.AbstractMemLeak
com.jrockit.memleak.mlp.MemLeakR26
public class MemLeakR26
Gives access to the memory leak detection system in JRockit.
Nested Class Summary | |
---|---|
class |
MemLeakR26.LargestArrayR26
|
Nested classes/interfaces inherited from class com.jrockit.memleak.mlp.AbstractMemLeak |
---|
AbstractMemLeak.AsyncCallbackThread, AbstractMemLeak.DelayedResult<V>, AbstractMemLeak.DelayedTruncatable<T>, AbstractMemLeak.ReqProcessor<T>, AbstractMemLeak.VoidResult |
Field Summary |
---|
Fields inherited from class com.jrockit.memleak.mlp.AbstractMemLeak |
---|
callbackThread, channel, classInfoResolver, enabledRequests, factory, features, histogramCutoff, infoCache, INVALID_CLASS_INFO, INVALID_OBJECT_INFO, META_MLP_REQUEST_REVISIONS, META_SUPPORTED_MLP_REQUESTS, notificationService, numIgnoredBytes |
Fields inherited from class com.jrockit.memleak.util.MemLeakAdapter |
---|
EMPTY_INT_ARRAY, metaData |
Fields inherited from interface com.jrockit.memleak.IMemLeak |
---|
FOREVER, META_IGNORED_REPLY_BYTES, META_KNOWN_KEYS, META_READ_BYTES, META_SERVER_PORT, META_SHORT_PROTOCOL_NAME, OBJECT_ID_INVALID, OBJECT_ID_NULL, UNLIMITED_DEPTH, UNLIMITED_INSTANCES, UNLIMITED_SIZE |
Constructor Summary | |
---|---|
MemLeakR26(com.jrockit.memleak.mlp.CommunicationChannel channel,
int port)
Create a new instance for the established connection. |
|
MemLeakR26(java.lang.String host,
int port)
Create a new MemLeak instance which will be connected to the server. |
Method Summary | |
---|---|
protected com.jrockit.memleak.mlp.ServerRequest |
createEnableAllocTracesForClassReq(ITypeSpecifier type,
int bufferSize,
int interval)
|
protected com.jrockit.memleak.mlp.ServerRequest |
createHeapHistogramReq()
|
protected com.jrockit.memleak.mlp.ServerRequest |
createInstanceRelationshipsReq(ITypeSpecifier fromType,
ITypeSpecifier toType,
int maxRelations,
long stopAt,
int maxMillis)
|
protected com.jrockit.memleak.mlp.ServerRequest |
createTypesPointingToReq(ITypeSpecifier type)
|
IResult<IValue[]> |
getArrayData(IObjectSpecifier objectSpec,
int from,
int len)
Get the data from an array. |
IClassInfo |
getClassInfo(IClassRef classRef)
Requires Feature.CLASS_NAME_OF_OBJECT . |
IResult<IFieldValue[]> |
getFieldValues(IObjectSpecifier objectSpec)
Get values and names for all fields in the object identified by objectSpec. |
ITruncatable<IRelationshipInfo> |
getInstanceRelationships(ITypeSpecifier fromType,
ITypeSpecifier toType,
int maxRelations,
long stopAt,
int maxMillis)
Get all instances of fromType that points to instances of
toType . |
IInstanceReferrers |
getInstancesPointingTo(IObjectSpecifier objectSpec,
Policy policy)
Find all instances pointing to this object id. |
IResult<LimitedNumber> |
getKeepAliveSizeOf(IObjectSpecifier objectSpec,
long stopAt)
Get the total size of all objects held on to by this object (the transitive closure). |
ITruncatable<IArraySizeInfo> |
getLargestArrays(ITypeSpecifier type)
Get the 10 largest arrays on the heap. |
IResult<IObjectInfo> |
getObjectInfo(IObjectSpecifier objectSpec)
Requires Feature.CLASS_NAME_OF_OBJECT . |
IResult<IFieldValue[]> |
getStaticFields(IClassRef classRef)
Get values and names for all static fields in the class identified by classRef. |
protected void |
initFeatures(java.util.EnumSet<Feature> features,
java.util.EnumSet<RequestType> requests)
Initialize the feature set based on the supported requests. |
protected ITrace[] |
parseAllocTraces(java.io.DataInputStream dis)
|
protected IClassInfo |
parseClass(java.io.DataInputStream dis)
Read a class from a stream, obtaining data required, but not provided in the stream, from caches or by implicit sub-requests. |
protected IClassRef |
parseClassRef(java.io.DataInputStream dis)
Read a class from a stream, obtaining data required, but not provided in the stream, from caches or by implicit sub-requests. |
protected IFieldValue[] |
parseFieldValues(java.io.DataInputStream dis,
boolean onlyStatics)
|
protected ITruncatable<IRelationshipInfo> |
parseInstanceRelationsships(java.io.DataInputStream dis,
ITypeSpecifier fromType)
|
protected IMethodInfo |
parseMethodInfo(java.io.DataInputStream dis)
|
protected IObjectInfo |
parseObject(java.io.DataInputStream dis)
|
protected IObjectInfo |
parseObject(java.io.DataInputStream dis,
IClassInfo classInfo)
|
protected IObjectInfo |
parseObjectAndClass(java.io.DataInputStream dis)
Used where there traditionally has been an object ID followed by a class name. |
protected IObjectSpecifier |
parseObjectSpec(java.io.DataInputStream dis)
|
Methods inherited from class com.jrockit.memleak.util.MemLeakAdapter |
---|
deleteAllObjectIds, deleteObjectId, enableAllocTracesForClass, getClasses, getClasses, getInstanceRelationships, getInstances, getLargestArrays, getPathPointingTo, getTypesPointingTo, hasFeatures, pollDiscardedObjects |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemLeakR26(java.lang.String host, int port) throws java.io.IOException
host
- name of the hostport
- port on the host
java.io.IOException
- if there is a communication related problem, more
specifically:
UnknownHostException
if the host could not be
found.ConnectException
if no server could be found at
the specified port.IllegalArgumentException
if the port is out of
range.public MemLeakR26(com.jrockit.memleak.mlp.CommunicationChannel channel, int port)
channel
- established communication channelport
- port on the hostMethod Detail |
---|
protected void initFeatures(java.util.EnumSet<Feature> features, java.util.EnumSet<RequestType> requests)
AbstractMemLeak
initFeatures
in class AbstractMemLeak
protected com.jrockit.memleak.mlp.ServerRequest createHeapHistogramReq()
createHeapHistogramReq
in class AbstractMemLeak
ServerRequest
protected com.jrockit.memleak.mlp.ServerRequest createTypesPointingToReq(ITypeSpecifier type)
createTypesPointingToReq
in class AbstractMemLeak
ServerRequest
(FIXME:or null?)public ITruncatable<IArraySizeInfo> getLargestArrays(ITypeSpecifier type)
IMemLeak
ITruncatable.Reason.EMPTY_REPLY
is returned. (Since a class
loader may or may not be specified, these last two cases are not easily
differentiated.) Non-array types may give a NotAnArrayException as
reason.
getLargestArrays
in interface IMemLeak
getLargestArrays
in class MemLeakAdapter
type
- the type of the arrays
ITruncatable
with IArraySizeInfo
s on the
largest arrays or a reason of
ITruncatable.Reason.EMPTY_REPLY
if the type isn't loadedpublic IInstanceReferrers getInstancesPointingTo(IObjectSpecifier objectSpec, Policy policy) throws GarbageCollectedException, SpiException
IMemLeak
IInstanceReferrers.getThreadRoots()
are not accurate but
a best guess, considering what is on the stack.
Note that null may be returned, if the policy
allows it.
getInstancesPointingTo
in interface IMemLeak
getInstancesPointingTo
in class MemLeakAdapter
objectSpec
- an object specifierpolicy
- the policy to use
GarbageCollectedException
SpiException
protected com.jrockit.memleak.mlp.ServerRequest createInstanceRelationshipsReq(ITypeSpecifier fromType, ITypeSpecifier toType, int maxRelations, long stopAt, int maxMillis)
fromType
- toType
- maxRelations
- stopAt
- maxMillis
-
ServerRequest
public IResult<IFieldValue[]> getFieldValues(IObjectSpecifier objectSpec)
IMemLeak
getFieldValues
in interface IMemLeak
getFieldValues
in class MemLeakAdapter
objectSpec
- an object specifier
IResult
whose get()
method
either will return an array of IFieldValue
s representing
the fields, or throw an exception.public IResult<IFieldValue[]> getStaticFields(IClassRef classRef)
IMemLeak
getStaticFields
in interface IMemLeak
getStaticFields
in class MemLeakAdapter
classRef
- a class reference
IResult
whose get()
method
either will return an array of IFieldValue
s representing
the static fields, or throw an exception.public IResult<IValue[]> getArrayData(IObjectSpecifier objectSpec, int from, int len)
IMemLeak
getArrayData
in interface IMemLeak
getArrayData
in class MemLeakAdapter
objectSpec
- the arrayfrom
- starting indexlen
- how many elements to fetch
IResult
whose IResult.get()
either will return
an array of IValue
s representing the array elements, or
throw an exception.protected com.jrockit.memleak.mlp.ServerRequest createEnableAllocTracesForClassReq(ITypeSpecifier type, int bufferSize, int interval)
createEnableAllocTracesForClassReq
in class AbstractMemLeak
ServerRequest
protected ITrace[] parseAllocTraces(java.io.DataInputStream dis) throws java.io.IOException, GarbageCollectedException, SpiException
parseAllocTraces
in class AbstractMemLeak
ITrace
array
java.io.IOException
GarbageCollectedException
SpiException
protected IFieldValue[] parseFieldValues(java.io.DataInputStream dis, boolean onlyStatics) throws java.io.IOException, GarbageCollectedException, SpiException
parseFieldValues
in class AbstractMemLeak
onlyStatics
- if only static fields should be included. (Will only return
any fields for java.lang.Class objects.)
IFieldValue
array
java.io.IOException
GarbageCollectedException
SpiException
protected IMethodInfo parseMethodInfo(java.io.DataInputStream dis) throws java.io.IOException
parseMethodInfo
in class AbstractMemLeak
IMethodInfo
java.io.IOException
protected IObjectInfo parseObject(java.io.DataInputStream dis) throws java.io.IOException
parseObject
in class AbstractMemLeak
IObjectInfo
java.io.IOException
protected IObjectInfo parseObject(java.io.DataInputStream dis, IClassInfo classInfo) throws java.io.IOException
parseObject
in class AbstractMemLeak
classInfo
- a IClassInfo
to use for the object, unless already
known or in stream.
IObjectInfo
java.io.IOException
protected IObjectSpecifier parseObjectSpec(java.io.DataInputStream dis) throws java.io.IOException
parseObjectSpec
in class AbstractMemLeak
IObjectSpecifier
or null if the object reference is
null.
java.io.IOException
- iff an I/O operation on dis
failed.public IResult<IObjectInfo> getObjectInfo(IObjectSpecifier objectSpec)
IMemLeak
Feature.CLASS_NAME_OF_OBJECT
.
getObjectInfo
in interface IMemLeak
getObjectInfo
in class MemLeakAdapter
objectSpec
- an IObjectSpecifier
of an instance
IResult
whose get()
method
either will return an IObjectInfo
representing the
instance, or throw an exception.protected IObjectInfo parseObjectAndClass(java.io.DataInputStream dis) throws java.io.IOException, SpiException
dis
-
IObjectInfo
java.io.IOException
SpiException
protected IClassInfo parseClass(java.io.DataInputStream dis) throws java.io.IOException
AbstractMemLeak
parseClass
in class AbstractMemLeak
dis
- the stream to read the class identity from
IClassInfo
java.io.IOException
- iff an I/O operation on dis
failed.protected IClassRef parseClassRef(java.io.DataInputStream dis) throws java.io.IOException, SpiException
AbstractMemLeak
parseClassRef
in class AbstractMemLeak
dis
- the stream to read the class identity from
IClassInfo
java.io.IOException
- iff an I/O operation on dis
failed.
SpiException
- if a required sub-request (not on dis
) failed.public IClassInfo getClassInfo(IClassRef classRef) throws GarbageCollectedException, SpiException
IMemLeak
Feature.CLASS_NAME_OF_OBJECT
.
getClassInfo
in interface IMemLeak
getClassInfo
in class MemLeakAdapter
classRef
- an IClassRef
of a class
IClassInfo
of the class
GarbageCollectedException
SpiException
public ITruncatable<IRelationshipInfo> getInstanceRelationships(ITypeSpecifier fromType, ITypeSpecifier toType, int maxRelations, long stopAt, int maxMillis) throws OperationException, SpiException
IMemLeak
fromType
that points to instances of
toType
.
The returned array will be no larger than maxRelations
(it
may be smaller if there are fewer relations).
The returned array will be sorted on the keep-alive-size. This means that if keep-alive-sizes are calculated, and maxRelations is also set, only the instances with the highest keep-alive-size will be returned.
If stopAt
is >= 0 the maximum keep-alive-size reported in
each IRelationshipInfo
will be stopAt
(this is to
limit the amount of objects traversed to find the size). Specifying zero
will effectively disable the keep-alive-size calculation, and the array
will effectively be unsorted.
If stopAt
is IMemLeak.UNLIMITED_SIZE
, there is no max for
keep-alive-size, which means the actual keep-alive-size will be returned.
getInstanceRelationships
in interface IMemLeak
getInstanceRelationships
in class MemLeakAdapter
maxRelations
- maximum number of relations to return. To return all
relations, use IMemLeak.UNLIMITED_INSTANCES
(this can possibly
return a very large array).stopAt
- the limit in bytes for keep alive size calculation, see abovemaxMillis
- specifies the maximum amount of time (in milliseconds) the
server should spend completing the request. If more time has
elapsed the server will stop processing the request and return
the data as it is at that time. A value of IMemLeak.FOREVER
means infinite time.
ITruncatable
with IRelationshipInfo
s on all
instances of fromType that points to instances of
toType.
OperationException
SpiException
IMemLeak.getKeepAliveSizeOf(IObjectSpecifier, long)
protected ITruncatable<IRelationshipInfo> parseInstanceRelationsships(java.io.DataInputStream dis, ITypeSpecifier fromType) throws java.io.IOException
dis
- fromType
-
ITruncatable
<IRelationshipInfo
>
java.io.IOException
public IResult<LimitedNumber> getKeepAliveSizeOf(IObjectSpecifier objectSpec, long stopAt)
IMemLeak
stopAt
>= 0 than counting will
stop if the total size is larger than stopAt
.
getKeepAliveSizeOf
in interface IMemLeak
getKeepAliveSizeOf
in class MemLeakAdapter
objectSpec
- an object idstopAt
- the limit in bytes for keep alive size calculation, see above
IResult
whose get()
method will
give the total size in bytes of all objects held on to by this
object, limited by stopAt
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |