changeset 1925:ce94cd61b33e

6892742: Improve root set used by jhat Reviewed-by: tbell, dcubed Contributed-by: Keith Randall <keith.randall@gmail.com>
author ohair
date Wed, 18 Nov 2009 11:12:28 -0800
parents f329c9e0d39f
children 041b482fdbe2
files src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java	Wed Nov 18 11:10:18 2009 -0800
+++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java	Wed Nov 18 11:12:28 2009 -0800
@@ -57,7 +57,10 @@
             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();