The function FollowReference should do a traversal over all objects that are reachable from the heap roots.
However, references from the expression stack are not considered.
Executing the following code and initiating FollowReferences at a breakpoint in the Function getIntAndWait(),
no instance of MyTestClass will be found.
public static void main(String[] args) {
setUp(MyTestClass.class);
int sum = sum (new MyTestClass( 3, 4, 5), getIntAndWait());
}
Triggering a HeapDump in getIntAndWait(), the instance of MyTestClass will be shown as unreachable.
I add a test consisting of a java file, the source for a jvmti agent that initiates the heap walk and a make file.
The test can be run by gnumake JDK=<path to jdk> OSNAME=linux OPT=false test.
The test will output
Failed: No reference found!
if the reference is not found via FollowRefences.
In addition the test triggers a HeapDump, that can be inspected using appropriate tools.
However, references from the expression stack are not considered.
Executing the following code and initiating FollowReferences at a breakpoint in the Function getIntAndWait(),
no instance of MyTestClass will be found.
public static void main(String[] args) {
setUp(MyTestClass.class);
int sum = sum (new MyTestClass( 3, 4, 5), getIntAndWait());
}
Triggering a HeapDump in getIntAndWait(), the instance of MyTestClass will be shown as unreachable.
I add a test consisting of a java file, the source for a jvmti agent that initiates the heap walk and a make file.
The test can be run by gnumake JDK=<path to jdk> OSNAME=linux OPT=false test.
The test will output
Failed: No reference found!
if the reference is not found via FollowRefences.
In addition the test triggers a HeapDump, that can be inspected using appropriate tools.
- relates to
-
JDK-8153625 the test for 8034867 needs to be in the VM SQE test base
-
- Closed
-