JDK-4932038 : JDI: please add heap walking API in Java Debugger Interface
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2003-10-03
  • Updated: 2005-05-12
  • Resolved: 2005-05-12
Related Reports
Duplicate :  
Relates :  
Description
Currently, Java Debugger Interface (JDI) does not have a way to get java objects from heap.

While one can local variables and follow links from local objects, sometimes we want to get all heap objects of a specific type.

In particular, read-only JDI subset aimed at coredumps could have heap access API.

While debugging java core dumps, we may want to get java objects of a specific type or objects of all types. There can be a capability API that tells whether a given JDI implementation supports heap access or not.

The API proposed are as below:


Heap Walking API introduces facility to walk java walk from core files/process snapshots.
The heap walking API addes only 4 methods to VirtualMachine class

1) canWalkHeap

    boolean canWalkHeap();

    capability check method. returns true if a jdi implementation can walk heap. else returns false.

2) allObjects
    List/*&ltObjectReference>*/ allObjects();

    Returns list of all heap objects.

3) objectsByType
    List/*<ObjectReference>*/ objectsByType(ReferenceType type, boolean  includeSubtypes)

    Returns list of all objects of given type. If 'includeSubtypes' is true all objects of subtype of given type are included in result. If 'includeSubtypes' is false, only the objects of type exactly equal to given type are included in the result

4) objectsByType
    List/*<ObjectReference>*/ objectsByType(ReferenceType type);

    Returns list of all objects of given type or subtype of given type. This is equivalent to objectsByType(type, true);


###@###.### 2003-10-03