6892742: Improve root set used by jhat

Reviewed-by: tbell, dcubed
This commit is contained in:
Keith Randall 2009-11-18 11:12:28 -08:00 committed by Kelly O'Hair
parent 5ef31ba152
commit f1fd7e28fe

View File

@ -57,7 +57,10 @@ public class JavaStatic {
id = ((JavaObjectRef)value).getId();
}
value = value.dereference(snapshot, field);
if (value.isHeapAllocated()) {
if (value.isHeapAllocated() &&
clazz.getLoader() == snapshot.getNullThing()) {
// static fields are only roots if they are in classes
// loaded by the root classloader.
JavaHeapObject ho = (JavaHeapObject) value;
String s = "Static reference from " + clazz.getName()
+ "." + field.getName();