Package com.jprofiler.api.agent.heap
Interface HeapObject
- All Known Subinterfaces:
ClassObject,Instance,PrimitiveArray,StringInstance
public interface HeapObject
Represents an object from a heap dump. Provides information regarding the object's identity,
size, associated class description, and its relationship with other objects in the heap.
You can cast this object to its subinterfaces Instance, StringInstance, PrimitiveArray
and ClassObject to get further specific data. You can determine the object kind with the ClassDescriptor
provided by the classDescriptor() method. For PHD snapshots, only HeapObject and ClassObject is available.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the class descriptor associated with this heap object.longid()Retrieves a unique identifier of the object.Retrieves all objects referenced directly by this heap object.Retrieves all objects that directly reference this heap object.longsize()Retrieves the shallow size of the object.
-
Method Details
-
id
long id()Retrieves a unique identifier of the object.- Returns:
- a long value representing the unique identifier
-
size
long size()Retrieves the shallow size of the object.- Returns:
- the size as a long value.
-
classDescriptor
Retrieves the class descriptor associated with this heap object. The class descriptor contains metadata about the object's type, including its name, hierarchy, and fields.- Returns:
- the
ClassDescriptorinstance representing the class of this heap object, never null.
-
referencedObjects
Retrieves all objects referenced directly by this heap object. The references include field values, array values or other class specific referenced objects for aClassObject.- Returns:
- a collection of
HeapObjectinstances that are directly referenced by this object. The collection is never null but may be empty if no objects are referenced.
-
referencingObjects
Retrieves all objects that directly reference this heap object.- Returns:
- a collection of
HeapObjectinstances that reference this object. The collection is never null but may be empty if no objects reference this heap object.
-