United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6892742 : Improve root set used by jhat

Details
Type:
Enhancement
Submit Date:
2009-10-18
Status:
Closed
Updated Date:
2011-04-19
Project Name:
JDK
Resolved Date:
2011-04-19
Component:
core-svc
OS:
generic
Sub-Component:
tools
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
See http://mail.openjdk.java.net/pipermail/serviceability-dev/2009-October/001591.html


diff --git a/src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java b/src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java
--- a/src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java
+++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java
@@ -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();

                                    

Comments
EVALUATION

See description.
                                     
2009-10-18
EVALUATION

http://hg.openjdk.java.net/jdk7/tl/jdk/rev/ce94cd61b33e
                                     
2009-11-18
EVALUATION

http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/9fd2e11a9ae6
                                     
2009-12-08



Hardware and Software, Engineered to Work Together