com.jrockit.memleak.mlp
Class MemLeakR28

java.lang.Object
  extended by com.jrockit.memleak.util.MemLeakAdapter
      extended by com.jrockit.memleak.mlp.AbstractMemLeak
          extended by com.jrockit.memleak.mlp.MemLeakR28
All Implemented Interfaces:
IMemLeak

public class MemLeakR28
extends AbstractMemLeak

Gives access to the memory leak detection system in JRockit.

Since:
Creation date: 2004-sep-01
Author:
Staffan Larsen, Helena Åberg Östlund

Nested Class Summary
 class MemLeakR28.GetClassesR28
           
 class MemLeakR28.GetInstanceRelationshipsR28
           
 class MemLeakR28.LargestArrayR28
           
 
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
MemLeakR28(com.jrockit.memleak.mlp.CommunicationChannel channel, int port)
          Create a new instance for the established connection.
 
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 createTypesPointingToReq(ITypeSpecifier type)
           
 void deleteAllObjectIds()
          Delete all object IDs.
 void deleteObjectId(int objectId)
          Delete the given object ID.
 IResult<java.lang.Void> deleteObjectIds(int... objectIds)
          Delete the object IDs in objectIds.
protected  IClassInfo findJavaLangClass()
           
 IResult<IValue[]> getArrayData(IObjectSpecifier objectSpec, int from, int len)
          Get the data from an array.
 int getArrayLength(IObjectSpecifier objectSpec)
          Get the length of an array.
 IClassRef[] getClasses(ITypeSpecifier type, Policy policy)
          Requires Feature.CLASS_IDS.
 IClassInfo getClassInfo(IClassRef classRef)
          Requires Feature.CLASS_NAME_OF_OBJECT.
protected  IClassInfo getClassInfo(int classID)
          Find the IClassInfo cached locally, or if not found, retrieve it from the server.
 int[] getDiscardedIDs(IObjectSpecifier... objectSpecs)
           
 IResult<IFieldValue[]> getFieldValues(IObjectSpecifier objectSpec)
          Get values and names for all fields in the object identified by objectSpec.
protected  java.io.DataInputStream getInputStreamHandlingDiscarded(com.jrockit.memleak.mlp.ServerResponse response, IObjectSpecifier objectSpec)
          Create input stream from response, but in case of a GarbageCollectedException, also mark the IObjectInfo corresponding to objectSpec as discarded, if possible.
protected  java.io.DataInputStream getInspectStreamHandlingDiscarded(com.jrockit.memleak.mlp.ServerResponse response, IObjectSpecifier objectSpec)
          Create input stream from response, but in case of a GarbageCollectedException, also mark the IObjectInfo corresponding to objectSpec as discarded, if possible.
 ITruncatable<IRelationshipInfo> getInstanceRelationships(ITypeSpecifier fromType, ITypeSpecifier toType, int maxRelations, long stopAt, int maxMillis)
          Get all instances of fromType that points to instances of toType.
 ITruncatable<IObjectInfo> getInstances(IClassRef classRef, int maxInstances)
          Requires Feature.INSTANCES_OF_TYPE.
 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.
 java.lang.Object getMetaData(java.lang.Object key)
          Obtain meta data for this connection.
 IResult<IObjectInfo> getObjectInfo(IObjectSpecifier objectSpec)
          Requires Feature.CLASS_NAME_OF_OBJECT.
protected  IObjectInfo getObjectInfoBlocking(int objID)
          Find the IObjectInfo cached locally, or if not found, retrieve it from the server.
 ITruncatable<IInstanceReferrers> getPathPointingTo(IObjectSpecifier objectSpec, int maxDepth, int maxMillis)
          Find a path from a GC root to the object denoted by objectSpec.
protected  int[] getRequestRevisions()
          Experimental, for testing only, to determine request revisions.
 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  IClassInfo parseClassWithMetaData(java.io.DataInputStream dis)
          Parse a class ID followed by meta data.
protected  IFieldValue[] parseFieldValues(java.io.DataInputStream dis, boolean onlyStatics)
           
protected  IInstanceReferrers parseInstancePointingTo(java.io.DataInputStream dis)
           
protected  IMethodInfo parseMethodInfo(java.io.DataInputStream dis)
           
protected  IObjectInfo parseObject(java.io.DataInputStream dis)
           
protected  IObjectInfo parseObject(java.io.DataInputStream dis, IClassInfo classInfo)
           
protected  IObjectSpecifier parseObjectSpec(java.io.DataInputStream dis)
           
 boolean pollDiscardedObjects()
          If supported, poll the server for objects (and classes) that have been garbage collected.
 boolean setVerboseMLP(MlpVerbosity objects, MlpVerbosity classes, MlpVerbosity classLoaders)
          Attempt to set protocol verbosity.
protected static boolean supportsMlpVersion(int major, int minor)
           
protected  void tryMarkDiscarded(IObjectSpecifier objectSpec)
          Mark the IObjectInfo corresponding to objectSpec as discarded, if possible.
 
Methods inherited from class com.jrockit.memleak.mlp.AbstractMemLeak
checkSpecValidity, checkSupported, createMemLeak, createMemLeak, createSafeSupportedReqs, destroy, disableAllocTraces, doFullGC, enableAllocTracesForClass, getAllocTraceFrequency, getFeatures, getHeapHistogram, getHistogramCutoff, getLastTypeHeapInfo, getLastTypeHeapInfo, getService, getSupportedRequests, getTypesPointingTo, isAllocTracesEnabled, isConnected, isJlcClass, isTrendAnalysisEnabled, parseHeapUsage, parseTypesPointingTo, pollAllocationTraces, readPrimitive, reportIgnoredBytes, reportUnusedBytes, setAllocTraceFrequency, setDisconnectCallback, setHistogramCutoff, setTrendAnalysisCallback, setTrendAnalysisEnabled, supportsRequest
 
Methods inherited from class com.jrockit.memleak.util.MemLeakAdapter
deleteObjectId, enableAllocTracesForClass, getClasses, getInstanceRelationships, getLargestArrays, getTypesPointingTo, hasFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemLeakR28

public MemLeakR28(com.jrockit.memleak.mlp.CommunicationChannel channel,
                  int port)
           throws SpiException
Create a new instance for the established connection.

Parameters:
channel - established communication channel
port - port on the host
Throws:
SpiException
Method Detail

supportsMlpVersion

protected static boolean supportsMlpVersion(int major,
                                            int minor)
Parameters:
major -
minor -
Returns:
true iff this implementation supports the given MLP version.

findJavaLangClass

protected IClassInfo findJavaLangClass()
Returns:
the IClassInfo for java.lang.Class. Used to construct IObjectInfos for IClassInfos.

setVerboseMLP

public boolean setVerboseMLP(MlpVerbosity objects,
                             MlpVerbosity classes,
                             MlpVerbosity classLoaders)
                      throws SpiException
Attempt to set protocol verbosity. Primarily public for testing purposes.

Parameters:
objects -
classes -
classLoaders -
Returns:
true if this seems to have been honored, false otherwise.
Throws:
SpiException

initFeatures

protected void initFeatures(java.util.EnumSet<Feature> features,
                            java.util.EnumSet<RequestType> requests)
Description copied from class: AbstractMemLeak
Initialize the feature set based on the supported requests.

Overrides:
initFeatures in class AbstractMemLeak

getRequestRevisions

protected int[] getRequestRevisions()
                             throws SpiException
Experimental, for testing only, to determine request revisions.

Returns:
an array of revisions, indexed by Enum.ordinal()
Throws:
SpiException

getMetaData

public java.lang.Object getMetaData(java.lang.Object key)
                             throws SpiException
Description copied from interface: IMemLeak
Obtain meta data for this connection. The keys are either META_* constants of this interface or implementation specific. Implementations unaware of the given key (including META_* constants) should return null. Used mainly for diagnostic purposes.

Specified by:
getMetaData in interface IMemLeak
Overrides:
getMetaData in class AbstractMemLeak
Parameters:
key - The kind of meta data to return
Returns:
the meta data of that kind or null
Throws:
SpiException

createHeapHistogramReq

protected com.jrockit.memleak.mlp.ServerRequest createHeapHistogramReq()
Specified by:
createHeapHistogramReq in class AbstractMemLeak
Returns:
a ServerRequest

createTypesPointingToReq

protected com.jrockit.memleak.mlp.ServerRequest createTypesPointingToReq(ITypeSpecifier type)
Specified by:
createTypesPointingToReq in class AbstractMemLeak
Returns:
a ServerRequest (FIXME:or null?)

getLargestArrays

public ITruncatable<IArraySizeInfo> getLargestArrays(ITypeSpecifier type)
Description copied from interface: IMemLeak
Get the 10 largest arrays on the heap. If the given array type does not have any instances, but is loaded, a zero length array is returned. If the type isn't loaded, or doesn't exist, a reason of 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.

Specified by:
getLargestArrays in interface IMemLeak
Overrides:
getLargestArrays in class MemLeakAdapter
Parameters:
type - the type of the arrays
Returns:
an ITruncatable with IArraySizeInfos on the largest arrays or a reason of ITruncatable.Reason.EMPTY_REPLY if the type isn't loaded

getInstancesPointingTo

public IInstanceReferrers getInstancesPointingTo(IObjectSpecifier objectSpec,
                                                 Policy policy)
                                          throws GarbageCollectedException,
                                                 SpiException
Description copied from interface: IMemLeak
Find all instances pointing to this object id. The methods in the returned 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.

Specified by:
getInstancesPointingTo in interface IMemLeak
Overrides:
getInstancesPointingTo in class MemLeakAdapter
Parameters:
objectSpec - an object specifier
policy - the policy to use
Returns:
information about all instances pointing to this object, or null according to policy
Throws:
GarbageCollectedException
SpiException

getInputStreamHandlingDiscarded

protected java.io.DataInputStream getInputStreamHandlingDiscarded(com.jrockit.memleak.mlp.ServerResponse response,
                                                                  IObjectSpecifier objectSpec)
                                                           throws GarbageCollectedException,
                                                                  SpiException
Create input stream from response, but in case of a GarbageCollectedException, also mark the IObjectInfo corresponding to objectSpec as discarded, if possible.

Parameters:
response -
objectSpec -
Returns:
the input stream
Throws:
GarbageCollectedException
SpiException

getInspectStreamHandlingDiscarded

protected java.io.DataInputStream getInspectStreamHandlingDiscarded(com.jrockit.memleak.mlp.ServerResponse response,
                                                                    IObjectSpecifier objectSpec)
                                                             throws GarbageCollectedException,
                                                                    SpiException
Create input stream from response, but in case of a GarbageCollectedException, also mark the IObjectInfo corresponding to objectSpec as discarded, if possible.

Parameters:
response -
objectSpec -
Returns:
the input stream
Throws:
GarbageCollectedException
SpiException

tryMarkDiscarded

protected void tryMarkDiscarded(IObjectSpecifier objectSpec)
Mark the IObjectInfo corresponding to objectSpec as discarded, if possible.

Parameters:
objectSpec -

parseInstancePointingTo

protected IInstanceReferrers parseInstancePointingTo(java.io.DataInputStream dis)
                                              throws java.io.IOException,
                                                     GarbageCollectedException,
                                                     SpiException
Parameters:
dis -
Returns:
an IInstanceReferrers
Throws:
java.io.IOException
GarbageCollectedException
SpiException

getPathPointingTo

public ITruncatable<IInstanceReferrers> getPathPointingTo(IObjectSpecifier objectSpec,
                                                          int maxDepth,
                                                          int maxMillis)
                                                   throws GarbageCollectedException,
                                                          OperationException,
                                                          SpiException
Description copied from interface: IMemLeak
Find a path from a GC root to the object denoted by objectSpec. Note that maxDepth is interpreted in such a way that if there's any root at most this many steps away, a root will always be returned. However, roots further away may still be reported due to implementation details. Perhaps minDepth or simply depth would be a better parameter name.

Requires Feature.INSTANCE_PATHS_TO_ROOT.

Specified by:
getPathPointingTo in interface IMemLeak
Overrides:
getPathPointingTo in class MemLeakAdapter
Parameters:
objectSpec - the object to find a root for
maxDepth - the maximum number of backward steps that will be taken to find a root, use IMemLeak.UNLIMITED_DEPTH for no limit
maxMillis - the maximum time in milliseconds to spend finding a root, not including any time required by garbage collection, use IMemLeak.FOREVER for no limit
Returns:
an array of IInstanceReferrers denoting a path from a root to the given IObjectSpecifier.
Throws:
GarbageCollectedException
OperationException
SpiException

getInstanceRelationships

public ITruncatable<IRelationshipInfo> getInstanceRelationships(ITypeSpecifier fromType,
                                                                ITypeSpecifier toType,
                                                                int maxRelations,
                                                                long stopAt,
                                                                int maxMillis)
                                                         throws OperationException,
                                                                SpiException
Description copied from interface: IMemLeak
Get all instances of 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.

Specified by:
getInstanceRelationships in interface IMemLeak
Overrides:
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 above
maxMillis - 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.
Returns:
an ITruncatable with IRelationshipInfos on all instances of fromType that points to instances of toType.
Throws:
OperationException
SpiException
See Also:
IMemLeak.getKeepAliveSizeOf(IObjectSpecifier, long)

getKeepAliveSizeOf

public IResult<LimitedNumber> getKeepAliveSizeOf(IObjectSpecifier objectSpec,
                                                 long stopAt)
Description copied from interface: IMemLeak
Get the total size of all objects held on to by this object (the transitive closure). If stopAt >= 0 than counting will stop if the total size is larger than stopAt.

Specified by:
getKeepAliveSizeOf in interface IMemLeak
Overrides:
getKeepAliveSizeOf in class MemLeakAdapter
Parameters:
objectSpec - an object id
stopAt - the limit in bytes for keep alive size calculation, see above
Returns:
An IResult whose get() method will give the total size in bytes of all objects held on to by this object, limited by stopAt.

getFieldValues

public IResult<IFieldValue[]> getFieldValues(IObjectSpecifier objectSpec)
Description copied from interface: IMemLeak
Get values and names for all fields in the object identified by objectSpec.

Specified by:
getFieldValues in interface IMemLeak
Overrides:
getFieldValues in class MemLeakAdapter
Parameters:
objectSpec - an object specifier
Returns:
An IResult whose get() method either will return an array of IFieldValues representing the fields, or throw an exception.

getStaticFields

public IResult<IFieldValue[]> getStaticFields(IClassRef classRef)
Description copied from interface: IMemLeak
Get values and names for all static fields in the class identified by classRef.

Specified by:
getStaticFields in interface IMemLeak
Overrides:
getStaticFields in class MemLeakAdapter
Parameters:
classRef - a class reference
Returns:
An IResult whose get() method either will return an array of IFieldValues representing the static fields, or throw an exception.

getArrayData

public IResult<IValue[]> getArrayData(IObjectSpecifier objectSpec,
                                      int from,
                                      int len)
Description copied from interface: IMemLeak
Get the data from an array.

Specified by:
getArrayData in interface IMemLeak
Overrides:
getArrayData in class MemLeakAdapter
Parameters:
objectSpec - the array
from - starting index
len - how many elements to fetch
Returns:
An IResult whose IResult.get() either will return an array of IValues representing the array elements, or throw an exception.

createEnableAllocTracesForClassReq

protected com.jrockit.memleak.mlp.ServerRequest createEnableAllocTracesForClassReq(ITypeSpecifier type,
                                                                                   int bufferSize,
                                                                                   int interval)
Specified by:
createEnableAllocTracesForClassReq in class AbstractMemLeak
Returns:
a ServerRequest

deleteObjectId

public void deleteObjectId(int objectId)
                    throws SpiException
Description copied from interface: IMemLeak
Delete the given object ID. Every object (or class) ID returned from the other methods must be deleted exactly once. Once deleted, an ID may be reused at any time.

Requires Feature.DELETE_OBJECT_ID.

Specified by:
deleteObjectId in interface IMemLeak
Overrides:
deleteObjectId in class AbstractMemLeak
Parameters:
objectId - an object ID
Throws:
SpiException

deleteObjectIds

public IResult<java.lang.Void> deleteObjectIds(int... objectIds)
Description copied from interface: IMemLeak
Delete the object IDs in objectIds. Every object (or class) ID returned from the other methods must be deleted exactly once. Once deleted, an ID may be reused at any time.

Requires Feature.DELETE_OBJECT_ID.

Specified by:
deleteObjectIds in interface IMemLeak
Overrides:
deleteObjectIds in class AbstractMemLeak
Parameters:
objectIds - an array of object IDs
Returns:
An IResult whose get() method will return null

deleteAllObjectIds

public void deleteAllObjectIds()
                        throws SpiException
Description copied from interface: IMemLeak
Delete all object IDs. Every object (or class) ID returned from the other methods must be deleted exactly once. Once deleted, an ID may be reused at any time.

Requires Feature.DELETE_ALL_OBJECT_IDS.

Specified by:
deleteAllObjectIds in interface IMemLeak
Overrides:
deleteAllObjectIds in class MemLeakAdapter
Throws:
SpiException

pollDiscardedObjects

public boolean pollDiscardedObjects()
Description copied from interface: IMemLeak
If supported, poll the server for objects (and classes) that have been garbage collected. All INotificationService listeners will be notified with IObjectInfos and IClassInfos for any GC:d objects. This will also prevent those infos from being reachable from this SPI.

Specified by:
pollDiscardedObjects in interface IMemLeak
Overrides:
pollDiscardedObjects in class MemLeakAdapter
Returns:
true if this operation is supported.

getArrayLength

public int getArrayLength(IObjectSpecifier objectSpec)
                   throws GarbageCollectedException,
                          SpiException
Description copied from interface: IMemLeak
Get the length of an array.

Specified by:
getArrayLength in interface IMemLeak
Overrides:
getArrayLength in class AbstractMemLeak
Parameters:
objectSpec - the array
Returns:
the length of the array
Throws:
GarbageCollectedException
SpiException

getObjectInfo

public IResult<IObjectInfo> getObjectInfo(IObjectSpecifier objectSpec)
Description copied from interface: IMemLeak
Requires Feature.CLASS_NAME_OF_OBJECT.

Specified by:
getObjectInfo in interface IMemLeak
Overrides:
getObjectInfo in class MemLeakAdapter
Parameters:
objectSpec - an IObjectSpecifier of an instance
Returns:
An IResult whose get() method either will return an IObjectInfo representing the instance, or throw an exception.

getObjectInfoBlocking

protected IObjectInfo getObjectInfoBlocking(int objID)
                                     throws GarbageCollectedException,
                                            SpiException
Find the IObjectInfo cached locally, or if not found, retrieve it from the server.

Parameters:
objID -
Returns:
IObjectInfo
Throws:
GarbageCollectedException
SpiException

getClassInfo

public IClassInfo getClassInfo(IClassRef classRef)
                        throws GarbageCollectedException,
                               SpiException
Description copied from interface: IMemLeak
Requires Feature.CLASS_NAME_OF_OBJECT.

Specified by:
getClassInfo in interface IMemLeak
Overrides:
getClassInfo in class MemLeakAdapter
Parameters:
classRef - an IClassRef of a class
Returns:
the IClassInfo of the class
Throws:
GarbageCollectedException
SpiException

getClassInfo

protected IClassInfo getClassInfo(int classID)
                           throws GarbageCollectedException,
                                  SpiException
Find the IClassInfo cached locally, or if not found, retrieve it from the server.

Parameters:
classID -
Returns:
IClassInfo
Throws:
GarbageCollectedException
SpiException

getClasses

public IClassRef[] getClasses(ITypeSpecifier type,
                              Policy policy)
                       throws SpiException
Description copied from interface: IMemLeak
Requires Feature.CLASS_IDS.

Note that null may be returned, if the policy allows it.

Specified by:
getClasses in interface IMemLeak
Overrides:
getClasses in class MemLeakAdapter
Parameters:
type - a type specifier
policy - the policy to use
Returns:
Class ID:s of all classes specified by specifier, or null according to policy
Throws:
SpiException

getInstances

public ITruncatable<IObjectInfo> getInstances(IClassRef classRef,
                                              int maxInstances)
                                       throws GarbageCollectedException,
                                              SpiException
Description copied from interface: IMemLeak
Requires Feature.INSTANCES_OF_TYPE.

Specified by:
getInstances in interface IMemLeak
Overrides:
getInstances in class MemLeakAdapter
Parameters:
classRef - a type reference
maxInstances - the maximum number of instances to return, use IMemLeak.UNLIMITED_INSTANCES to return all instances
Returns:
an ITruncatable with IObjectInfos of all instances of classRef
Throws:
GarbageCollectedException - if the class designated by classRef has been garbage collected.
SpiException

parseAllocTraces

protected ITrace[] parseAllocTraces(java.io.DataInputStream dis)
                             throws java.io.IOException,
                                    GarbageCollectedException,
                                    SpiException
Specified by:
parseAllocTraces in class AbstractMemLeak
Returns:
an ITrace array
Throws:
java.io.IOException
GarbageCollectedException
SpiException

parseFieldValues

protected IFieldValue[] parseFieldValues(java.io.DataInputStream dis,
                                         boolean onlyStatics)
                                  throws java.io.IOException,
                                         GarbageCollectedException,
                                         SpiException
Specified by:
parseFieldValues in class AbstractMemLeak
onlyStatics - if only static fields should be included. (Will only return any fields for java.lang.Class objects.)
Returns:
an IFieldValue array
Throws:
java.io.IOException
GarbageCollectedException
SpiException

parseMethodInfo

protected IMethodInfo parseMethodInfo(java.io.DataInputStream dis)
                               throws java.io.IOException,
                                      GarbageCollectedException,
                                      SpiException
Specified by:
parseMethodInfo in class AbstractMemLeak
Returns:
a IMethodInfo
Throws:
java.io.IOException
GarbageCollectedException
SpiException

parseObject

protected IObjectInfo parseObject(java.io.DataInputStream dis)
                           throws java.io.IOException,
                                  GarbageCollectedException,
                                  SpiException
Specified by:
parseObject in class AbstractMemLeak
Returns:
an IObjectInfo
Throws:
java.io.IOException
GarbageCollectedException
SpiException

parseObject

protected IObjectInfo parseObject(java.io.DataInputStream dis,
                                  IClassInfo classInfo)
                           throws java.io.IOException,
                                  SpiException
Specified by:
parseObject in class AbstractMemLeak
classInfo - a IClassInfo to use for the object, unless already known or in stream.
Returns:
an IObjectInfo
Throws:
java.io.IOException
SpiException

parseObjectSpec

protected IObjectSpecifier parseObjectSpec(java.io.DataInputStream dis)
                                    throws java.io.IOException,
                                           SpiException
Specified by:
parseObjectSpec in class AbstractMemLeak
Returns:
an IObjectSpecifier or null if the object reference is null.
Throws:
java.io.IOException - iff an I/O operation on dis failed.
SpiException - if a required sub-request (not on dis) failed.

parseClassWithMetaData

protected IClassInfo parseClassWithMetaData(java.io.DataInputStream dis)
                                     throws java.io.IOException,
                                            SpiException
Parse a class ID followed by meta data. This typically follows a ReplyTag.ID_TAG_VERBOSE_CLASS.

Parameters:
dis -
Returns:
a IClassInfo
Throws:
java.io.IOException
SpiException

parseClass

protected IClassInfo parseClass(java.io.DataInputStream dis)
                         throws java.io.IOException,
                                GarbageCollectedException,
                                SpiException
Description copied from class: AbstractMemLeak
Read a class from a stream, obtaining data required, but not provided in the stream, from caches or by implicit sub-requests.

Specified by:
parseClass in class AbstractMemLeak
Parameters:
dis - the stream to read the class identity from
Returns:
an IClassInfo
Throws:
java.io.IOException - iff an I/O operation on dis failed.
GarbageCollectedException - if a sub-request indicated that this class must have been Garbage Collected.
SpiException - if a required sub-request (not on dis) failed.

parseClassRef

protected IClassRef parseClassRef(java.io.DataInputStream dis)
                           throws java.io.IOException,
                                  SpiException
Description copied from class: AbstractMemLeak
Read a class from a stream, obtaining data required, but not provided in the stream, from caches or by implicit sub-requests.

Specified by:
parseClassRef in class AbstractMemLeak
Parameters:
dis -
Returns:
an IClassRef or null if the object no longer exist (so the class couldn't be determined).
Throws:
java.io.IOException
SpiException

getDiscardedIDs

public int[] getDiscardedIDs(IObjectSpecifier... objectSpecs)
                      throws SpiException
Parameters:
objectSpecs -
Returns:
object/class IDs that have been discarded
Throws:
SpiException


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.